2020-01-10 21:48:43 +08:00
|
|
|
plugins {
|
|
|
|
id 'org.springframework.boot.conventions'
|
|
|
|
id 'java-base'
|
|
|
|
}
|
|
|
|
|
|
|
|
description = 'Spring Boot Ant smoke test'
|
|
|
|
|
|
|
|
configurations {
|
|
|
|
antDependencies
|
|
|
|
testRepository
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
test
|
|
|
|
}
|
|
|
|
|
|
|
|
plugins.withType(EclipsePlugin) {
|
|
|
|
eclipse {
|
|
|
|
classpath {
|
|
|
|
plusConfigurations = [configurations.testRuntimeClasspath]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
antDependencies 'org.apache.ivy:ivy:2.4.0'
|
|
|
|
antDependencies project(path: ':spring-boot-project:spring-boot-tools:spring-boot-antlib')
|
2020-01-21 20:09:17 +08:00
|
|
|
antDependencies 'org.apache.ant:ant-launcher:1.9.3'
|
|
|
|
antDependencies 'org.apache.ant:ant:1.9.3'
|
2020-01-10 21:48:43 +08:00
|
|
|
|
|
|
|
testRepository project(path: ':spring-boot-project:spring-boot-tools:spring-boot-loader', configuration: 'mavenRepository')
|
|
|
|
testRepository project(path: ':spring-boot-project:spring-boot-starters:spring-boot-starter', configuration: 'mavenRepository')
|
|
|
|
|
2020-01-15 20:32:37 +08:00
|
|
|
testImplementation platform(project(':spring-boot-project:spring-boot-dependencies'))
|
2020-01-10 21:48:43 +08:00
|
|
|
testImplementation project(path: ':spring-boot-project:spring-boot-tools:spring-boot-loader-tools')
|
|
|
|
testImplementation 'org.assertj:assertj-core'
|
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter'
|
|
|
|
testImplementation 'org.springframework:spring-core'
|
|
|
|
}
|
|
|
|
|
|
|
|
task syncTestRepository(type: Sync) {
|
|
|
|
destinationDir = file("${buildDir}/test-repository")
|
|
|
|
from configurations.testRepository
|
|
|
|
rename {
|
|
|
|
it.replaceAll('-[0-9]+\\.[0-9]+-[0-9]+\\.', '-SNAPSHOT.')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-21 20:09:17 +08:00
|
|
|
task antRun(type: JavaExec) {
|
2020-01-10 21:48:43 +08:00
|
|
|
dependsOn syncTestRepository, configurations.antDependencies
|
2020-01-21 20:09:17 +08:00
|
|
|
classpath = configurations.antDependencies;
|
|
|
|
main = 'org.apache.tools.ant.launch.Launcher'
|
|
|
|
systemProperties = [
|
|
|
|
'ant-spring-boot.version' : version,
|
|
|
|
'projectDir': project.layout.projectDirectory
|
|
|
|
]
|
2020-01-10 21:48:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
task test(type: Test) {
|
2020-01-21 20:09:17 +08:00
|
|
|
dependsOn antRun
|
2020-01-10 21:48:43 +08:00
|
|
|
testClassesDirs = sourceSets.test.output.classesDirs
|
|
|
|
classpath = sourceSets.test.runtimeClasspath
|
|
|
|
}
|
|
|
|
|
|
|
|
check {
|
|
|
|
dependsOn test
|
|
|
|
}
|