98 lines
2.3 KiB
Groovy
98 lines
2.3 KiB
Groovy
apply from: "$rootDir/gradle/instrumentation.gradle"
|
|
|
|
muzzle {
|
|
pass {
|
|
group = "com.google.gwt"
|
|
module = "gwt-servlet"
|
|
versions = "[2.0.0,)"
|
|
assertInverse = true
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
testapp {
|
|
java
|
|
resources {
|
|
srcDirs("src/webapp")
|
|
}
|
|
java.outputDir = file("$buildDir/testapp/classes")
|
|
compileClasspath += sourceSets.main.compileClasspath
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// these are needed for compileGwt task
|
|
if (findProperty('testLatestDeps')) {
|
|
compileOnly 'com.google.gwt:gwt-user:+'
|
|
compileOnly 'com.google.gwt:gwt-dev:+'
|
|
} else {
|
|
compileOnly 'com.google.gwt:gwt-user:2.0.0'
|
|
compileOnly 'com.google.gwt:gwt-dev:2.0.0'
|
|
}
|
|
|
|
library 'com.google.gwt:gwt-servlet:2.0.0'
|
|
|
|
testInstrumentation project(':instrumentation:servlet:servlet-3.0:javaagent')
|
|
testInstrumentation project(':instrumentation:servlet:servlet-javax-common:javaagent')
|
|
testInstrumentation project(':instrumentation:jetty:jetty-8.0:javaagent')
|
|
|
|
testImplementation "org.testcontainers:selenium:${versions.testcontainers}"
|
|
testImplementation 'org.seleniumhq.selenium:selenium-java:3.141.59'
|
|
|
|
testImplementation(project(':testing-common')) {
|
|
exclude group: 'org.eclipse.jetty', module: 'jetty-server'
|
|
}
|
|
testImplementation "org.eclipse.jetty:jetty-webapp:9.4.35.v20201120"
|
|
}
|
|
|
|
def warDir = "$buildDir/testapp/war"
|
|
|
|
task compileGwt(dependsOn: classes, type: JavaExec) {
|
|
// versions before 2.9 require java8
|
|
javaLauncher = javaToolchains.launcherFor {
|
|
languageVersion = JavaLanguageVersion.of(8)
|
|
}
|
|
|
|
def extraDir = "$buildDir/testapp/extra"
|
|
|
|
outputs.cacheIf { true }
|
|
|
|
outputs.dir extraDir
|
|
outputs.dir warDir
|
|
|
|
main = 'com.google.gwt.dev.Compiler'
|
|
|
|
classpath {
|
|
[
|
|
sourceSets.testapp.java.srcDirs,
|
|
sourceSets.testapp.compileClasspath
|
|
]
|
|
}
|
|
|
|
args = [
|
|
'test.gwt.Greeting', // gwt module
|
|
'-war', warDir,
|
|
'-logLevel', 'INFO',
|
|
'-localWorkers', '2',
|
|
'-compileReport',
|
|
'-extra', extraDir,
|
|
'-draftCompile' // makes compile a bit faster
|
|
]
|
|
}
|
|
|
|
task copyTestWebapp(type: Copy) {
|
|
dependsOn compileGwt
|
|
|
|
from file("src/testapp/webapp")
|
|
from warDir
|
|
|
|
into file("$buildDir/testapp/web")
|
|
}
|
|
|
|
test.dependsOn sourceSets.testapp.output, copyTestWebapp
|
|
|
|
test {
|
|
// add test app classes to classpath
|
|
classpath = project.sourceSets.test.runtimeClasspath + files("$buildDir/testapp/classes")
|
|
}
|