-
Notifications
You must be signed in to change notification settings - Fork 41.1k
/
Copy pathbuild.gradle
76 lines (66 loc) · 2.24 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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 {
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
}