-
Notifications
You must be signed in to change notification settings - Fork 334
Expand file tree
/
Copy pathbuild.gradle
More file actions
207 lines (185 loc) · 6.71 KB
/
build.gradle
File metadata and controls
207 lines (185 loc) · 6.71 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
ext {
// Play doesn't work with Java 9+ until 2.6.12
maxJavaVersionForTests = JavaVersion.VERSION_1_8
}
def scalaVersion = '2.11'
def playVersion = '2.6.0'
muzzle {
extraRepository("typesafe", "https://repo.typesafe.com/typesafe/maven-releases/")
pass {
name = 'play26Plus'
group = 'com.typesafe.play'
module = "play_$scalaVersion"
versions = "[$playVersion,)"
assertInverse = true
javaVersion = 11
}
pass {
name = 'play26Plus'
group = 'com.typesafe.play'
module = 'play_2.12'
versions = "[$playVersion,)"
assertInverse = true
javaVersion = 11
}
pass {
name = 'play26Plus'
group = 'com.typesafe.play'
module = 'play_2.13'
versions = "[$playVersion,)"
assertInverse = true
javaVersion = 11
}
pass {
name = 'play26Only'
group = 'com.typesafe.play'
module = 'play-java_2.11'
versions = "[2.6.0,2.7.0)"
assertInverse = true
}
pass {
name = 'play27'
group = 'com.typesafe.play'
module = 'play-java_2.13'
versions = "[2.7.0,)"
assertInverse = true
javaVersion = 11
}
}
apply from: "$rootDir/gradle/java.gradle"
apply plugin: 'scala'
repositories {
maven {
// for muzzle because of play-2.3
// only place that has 'com.typesafe.netty:netty-http-pipelining:1.1.2' publicly accessible
name 'typesafe'
url 'https://repo.typesafe.com/typesafe/maven-releases/'
}
}
addTestSuite('baseTest')
addTestSuite('latestDepTest')
sourceSets {
main_play27 {
java.srcDirs "${project.projectDir}/src/main/java_play27"
}
}
jar {
from sourceSets.main_play27.output
}
compileMain_play27Java.dependsOn compileJava
project.afterEvaluate { p ->
instrumentJava.dependsOn compileMain_play27Java
forbiddenApisMain_play27.dependsOn instrumentMain_play27Java
}
instrument {
additionalClasspath = [
instrumentJava: compileMain_play27Java.destinationDirectory
]
}
dependencies {
compileOnly group: 'com.typesafe.play', name: "play_$scalaVersion", version: playVersion
compileOnly group: 'com.typesafe.play', name: "play-java_$scalaVersion", version: playVersion
main_play27CompileOnly group: 'com.typesafe.play', name: "play-java_$scalaVersion", version: '2.7.0'
main_play27CompileOnly project(':internal-api')
main_play27CompileOnly project(':dd-java-agent:agent-tooling')
main_play27CompileOnly project(':dd-java-agent:agent-bootstrap')
main_play27CompileOnly files("${project.buildDir}/classes/java/raw") {
builtBy = ['compileJava']
}
baseTestImplementation group: 'com.typesafe.play', name: "play-java_$scalaVersion", version: playVersion
// TODO: Play WS is a separately versioned library starting with 2.6 and needs separate instrumentation.
baseTestImplementation(group: 'com.typesafe.play', name: "play-test_$scalaVersion", version: playVersion) {
exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
}
testRuntimeOnly project(':dd-java-agent:instrumentation:netty-4.0')
testRuntimeOnly project(':dd-java-agent:instrumentation:netty-4.1')
testRuntimeOnly project(':dd-java-agent:instrumentation:akka-http:akka-http-10.0')
testRuntimeOnly project(':dd-java-agent:instrumentation:akka-concurrent')
testRuntimeOnly project(':dd-java-agent:instrumentation:akka-init')
testRuntimeOnly project(':dd-java-agent:instrumentation:scala-concurrent')
testRuntimeOnly project(':dd-java-agent:instrumentation:scala-promise:scala-promise-2.10')
testRuntimeOnly project(':dd-java-agent:instrumentation:scala-promise:scala-promise-2.13')
latestDepTestRuntimeOnly sourceSets.baseTest.output
latestDepTestImplementation libs.scala213
latestDepTestImplementation group: 'com.typesafe.play', name: "play-java_2.13", version: '2.+'
latestDepTestImplementation(group: 'com.typesafe.play', name: "play-test_2.13", version: '2.+') {
exclude group: 'org.eclipse.jetty.websocket', module: 'websocket-client'
}
latestDepTestImplementation group: 'com.typesafe.play', name: 'play-akka-http-server_2.13', version: '2.+'
}
configurations.matching({ it.name.startsWith('latestDepTest') }).each({
it.resolutionStrategy {
// logback-classic 1.4.11 doesn't like being loaded in the bootstrap classloader (NPE)
force group: 'ch.qos.logback', name: 'logback-classic', version: '1.4.5'
}
})
tasks.named("compileLatestDepTestJava").configure {
it.sourceCompatibility = JavaVersion.VERSION_11
it.targetCompatibility = JavaVersion.VERSION_11
setJavaVersion(it, 11)
}
compileLatestDepTestScala {
javaLauncher = getJavaLauncherFor(11)
classpath = classpath + files(compileBaseTestJava.destinationDirectory)
dependsOn 'compileBaseTestJava'
}
latestDepTest {
javaLauncher = getJavaLauncherFor(11)
testClassesDirs = testClassesDirs + sourceSets.baseTest.output.classesDirs
}
final generatedRoutes = layout.buildDirectory.dir('generated/sources/latestDepTestRoutes/scala')
sourceSets {
routeGenerator {
scala {
srcDir "${project.projectDir}/src/routeGenerator/scala"
}
}
latestDepTestGenerated {
scala {
srcDir generatedRoutes
}
}
}
dependencies {
routeGeneratorImplementation libs.scala213
routeGeneratorImplementation group: 'com.typesafe.play', name: "routes-compiler_2.13", version: '2.+'
}
configurations {
latestDepTestGeneratedCompileClasspath.extendsFrom(latestDepTestCompileClasspath)
}
tasks.register('buildLatestDepTestRoutes', JavaExec) {
String routesFile = "${project.projectDir}/src/latestDepTest/routes/conf/routes"
def outputDir = generatedRoutes
it.inputs.file routesFile
it.outputs.dir outputDir
it.mainClass.set 'generator.CompileRoutes'
it.args routesFile, outputDir.get().asFile.absolutePath
it.classpath configurations.routeGeneratorRuntimeClasspath
it.classpath compileRouteGeneratorScala.destinationDirectory
it.classpath compileLatestDepTestScala.destinationDirectory
it.javaLauncher.set getJavaLauncherFor(11)
dependsOn compileRouteGeneratorScala, compileLatestDepTestScala
}
compileLatestDepTestGeneratedScala {
javaLauncher = getJavaLauncherFor(11)
classpath = classpath + files(compileLatestDepTestScala.destinationDirectory)
dependsOn buildLatestDepTestRoutes, compileLatestDepTestScala
}
forbiddenApisLatestDepTestGenerated {
enabled = false
}
compileLatestDepTestGroovy {
javaLauncher = getJavaLauncherFor(11)
classpath = classpath +
files(compileLatestDepTestScala.destinationDirectory) +
files(compileBaseTestGroovy.destinationDirectory) +
files(compileBaseTestJava.destinationDirectory) +
files(compileLatestDepTestGeneratedScala.destinationDirectory)
dependsOn 'compileLatestDepTestScala'
dependsOn 'compileBaseTestGroovy'
dependsOn 'compileBaseTestJava'
dependsOn 'compileLatestDepTestGeneratedScala'
}
dependencies {
latestDepTestRuntimeOnly sourceSets.latestDepTestGenerated.output
}