You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
2.2 KiB
75 lines
2.2 KiB
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-classic")) |
|
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 { |
|
eachFile { |
|
filter { it.replace('${spring-boot.version}', project.version) } |
|
} |
|
inputs.property "version", project.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 |
|
}
|
|
|