You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
2.0 KiB
Groovy
76 lines
2.0 KiB
Groovy
5 years ago
|
plugins {
|
||
|
id 'java-library'
|
||
|
id 'org.springframework.boot.conventions'
|
||
|
id 'org.springframework.boot.deployed'
|
||
|
}
|
||
|
|
||
|
description = 'Spring Boot Antlib'
|
||
|
|
||
|
ext {
|
||
|
antVersion = "1.9.3"
|
||
|
}
|
||
|
|
||
|
configurations {
|
||
|
antUnit
|
||
|
antIvy
|
||
|
}
|
||
|
|
||
|
dependencies {
|
||
|
antUnit "org.apache.ant:ant-antunit:1.3"
|
||
|
antIvy "org.apache.ivy:ivy:2.4.0"
|
||
|
|
||
|
compileOnly project(":spring-boot-project:spring-boot-tools:spring-boot-loader")
|
||
|
compileOnly "org.apache.ant:ant:${antVersion}"
|
||
|
|
||
|
implementation enforcedPlatform(project(":spring-boot-project:spring-boot-dependencies"))
|
||
|
implementation project(":spring-boot-project:spring-boot-tools:spring-boot-loader-tools")
|
||
|
implementation "org.springframework:spring-core"
|
||
|
}
|
||
|
|
||
|
task copyIntegrationTestSources(type: Copy) {
|
||
|
from file("src/it")
|
||
|
into "${buildDir}/it"
|
||
|
}
|
||
|
|
||
|
processResources {
|
||
|
eachFile {
|
||
|
filter { it.replace('${spring-boot.version}', project.version) }
|
||
|
}
|
||
|
}
|
||
|
|
||
|
task integrationTest {
|
||
|
dependsOn copyIntegrationTestSources, jar
|
||
|
def resultsDir = file("${buildDir}/test-results/integrationTest")
|
||
|
inputs.dir file("src/it")
|
||
|
inputs.files sourceSets.main.runtimeClasspath
|
||
|
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("${buildDir}/test-results/integrationTest").mkdirs()
|
||
|
xmllistener(toDir: resultsDir)
|
||
|
fileset(dir: "${buildDir}/it", includes: "**/build.xml")
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
check {
|
||
|
dependsOn integrationTest
|
||
|
}
|