plugins { id "java-library" id "org.springframework.boot.deployed" } description = "Spring Boot Antlib" ext { antVersion = "1.10.7" } configurations { antUnit antIvy } dependencies { antUnit "org.apache.ant:ant-antunit:1.3" antIvy "org.apache.ivy:ivy:2.5.0" compileOnly(project(":spring-boot-project:spring-boot-tools:spring-boot-loader")) compileOnly("org.apache.ant:ant:${antVersion}") implementation(project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools")) implementation("org.springframework:spring-core") } task syncIntegrationTestSources(type: Sync) { destinationDir = file(layout.buildDirectory.dir("it")) from file("src/it") filter(springRepositoryTransformers.ant()) } processResources { def version = project.version eachFile { filter { it.replace('${spring-boot.version}', version) } } inputs.property "version", version } task integrationTest { dependsOn syncIntegrationTestSources, jar def resultsDir = file(layout.buildDirectory.dir("test-results/integrationTest")) inputs.dir(file("src/it")).withPathSensitivity(PathSensitivity.RELATIVE).withPropertyName("source") inputs.files(sourceSets.main.runtimeClasspath).withNormalizer(ClasspathNormalizer).withPropertyName("classpath") outputs.dirs resultsDir doLast { ant.with { taskdef(resource: "org/apache/ant/antunit/antlib.xml", classpath: configurations.antUnit.asPath) taskdef(resource: "org/apache/ivy/ant/antlib.xml", classpath: configurations.antIvy.asPath) taskdef(resource: "org/springframework/boot/ant/antlib.xml", classpath: sourceSets.main.runtimeClasspath.asPath, uri: "antlib:org.springframework.boot.ant") ant.property(name: "ivy.class.path", value: configurations.antIvy.asPath) ant.property(name: "antunit.class.path", value: configurations.antUnit.asPath) antunit { propertyset { ant.propertyref(name: "build.compiler") ant.propertyref(name: "antunit.class.path") ant.propertyref(name: "ivy.class.path") } plainlistener() file(layout.buildDirectory.dir("test-results/integrationTest")).mkdirs() xmllistener(toDir: resultsDir) fileset(dir: layout.buildDirectory.dir("it").get().asFile.toString(), includes: "**/build.xml") } } } } check { dependsOn integrationTest }