Files
iam-login/build.gradle

87 lines
3.4 KiB
Groovy

plugins {
id 'java'
id 'org.springframework.boot' version '4.1.1'
id 'io.spring.dependency-management' version '1.1.7'
id 'org.graalvm.buildtools.native' version '1.1.8'
}
group = 'top.ddupan.iam'
version = '0.0.1-SNAPSHOT'
description = 'Independent IAM login and authentication service for Hydra'
java {
toolchain {
languageVersion = JavaLanguageVersion.of(25)
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-data-ldap'
implementation 'org.springframework.boot:spring-boot-starter-opentelemetry'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-webmvc'
implementation 'org.springframework.security:spring-security-webauthn'
implementation 'org.springframework.security:spring-security-ldap'
compileOnly 'org.projectlombok:lombok'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'
annotationProcessor 'org.projectlombok:lombok'
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
testImplementation 'org.springframework.boot:spring-boot-starter-actuator-test'
testImplementation 'org.springframework.boot:spring-boot-starter-data-ldap-test'
testImplementation 'org.springframework.boot:spring-boot-starter-ldap'
testImplementation 'org.springframework.boot:spring-boot-starter-opentelemetry-test'
testImplementation 'org.springframework.boot:spring-boot-starter-security-test'
testImplementation 'org.springframework.boot:spring-boot-starter-validation-test'
testImplementation 'org.springframework.boot:spring-boot-starter-webmvc-test'
testImplementation 'org.springframework.boot:spring-boot-testcontainers'
testImplementation 'com.unboundid:unboundid-ldapsdk'
testImplementation 'org.testcontainers:testcontainers-grafana'
testImplementation 'org.testcontainers:testcontainers-junit-jupiter'
testCompileOnly 'org.projectlombok:lombok'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
testAnnotationProcessor 'org.projectlombok:lombok'
}
tasks.named('test') {
useJUnitPlatform()
}
// Run generated AOT test context on the JVM before the more expensive native compile.
tasks.register('testAot', Test) {
dependsOn tasks.named('aotTestClasses')
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath + sourceSets.aotTest.output
systemProperty 'spring.aot.enabled', 'true'
useJUnitPlatform()
shouldRunAfter tasks.named('test')
}
// Native tests check behavior, not throughput. Keep the application binary optimized.
graalvmNative {
binaries {
test {
quickBuild = true
runtimeArgs.add(providers.systemProperty('user.home').map { "-Duser.home=${it}" })
}
}
}
// Vite owns the HTML and hashed assets; only the controller can serve the page shell.
// Build it with `npm ci && npm run build` in frontend/ before invoking Gradle.
tasks.named('processResources') {
inputs.files(fileTree('frontend/dist'))
doFirst {
if (!file('frontend/dist/index.html').exists()) {
throw new GradleException('Missing UI build: run npm ci && npm run build in frontend/')
}
}
from('frontend/dist') { into 'ui' }
}