Skip to content

Commit

Permalink
Merge war resources (#2660)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuraag Agrawal authored Mar 30, 2021
1 parent cc666f4 commit 2b2bec7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions instrumentation/gwt-2.0/javaagent/gwt-2.0-javaagent.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ dependencies {
testImplementation group: 'org.eclipse.jetty', name: 'jetty-webapp', version: '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"
def warDir = "$buildDir/testapp/war"

outputs.cacheIf { true }

Expand All @@ -79,7 +80,16 @@ task compileGwt(dependsOn: classes, type: JavaExec) {
]
}

test.dependsOn sourceSets.testapp.output, compileGwt
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GwtTest extends AgentInstrumentationSpecification implements HttpServerTes
Server startServer(int port) {
WebAppContext webAppContext = new WebAppContext()
webAppContext.setContextPath(getContextPath())
webAppContext.setBaseResource(Resource.newResource(new File("build/testapp/war")))
webAppContext.setBaseResource(Resource.newResource(new File("build/testapp/web")))

def jettyServer = new Server(port)
jettyServer.connectors.each {
Expand Down

0 comments on commit 2b2bec7

Please sign in to comment.