CORDA-2668 - TestCordapp – minor refactoring in jar building (#4805)

This commit is contained in:
Andrius Dagys 2019-02-22 18:26:40 +00:00 committed by Katelyn Baker
parent b52c7a09a3
commit 9d04eccc8a
2 changed files with 9 additions and 8 deletions

View File

@ -37,7 +37,7 @@ dependencies {
compile "org.eclipse.jetty:jetty-webapp:${jetty_version}"
compile "javax.servlet:javax.servlet-api:3.1.0"
compile "org.gradle:gradle-tooling-api:4.10.1"
compile "org.gradle:gradle-tooling-api:${gradle.gradleVersion}"
// Jersey for JAX-RS implementation for use in Jetty
compile "org.glassfish.jersey.core:jersey-server:${jersey_version}"

View File

@ -94,6 +94,7 @@ data class TestCordappImpl(val scanPackage: String, override val config: Map<Str
}
val projectConnection = gradleConnector.connect()
projectConnection.use {
val build = projectConnection.newBuild().apply {
forTasks("jar")
addProgressListener { event: ProgressEvent ->
@ -102,7 +103,7 @@ data class TestCordappImpl(val scanPackage: String, override val config: Map<Str
}
// Blocks until the build is complete
build.run()
projectConnection.close()
}
}
}
}