File tree Expand file tree Collapse file tree 2 files changed +22
-15
lines changed
Expand file tree Collapse file tree 2 files changed +22
-15
lines changed Original file line number Diff line number Diff line change 1- import java.time.Duration
2- import java.time.temporal.ChronoUnit
3-
41apply from : " $rootDir /gradle/java.gradle"
52description = ' JUnit Console Smoke Tests.'
63
@@ -11,7 +8,16 @@ dependencies {
118}
129
1310tasks. withType(Test ). configureEach {
14- jvmArgs " -Ddatadog.smoketest.junit.console.jar.path=${ configurations.runtimeClasspath.find { it.name.contains('junit-platform-console-standalone') }} "
11+ jvmArgumentProviders. add(new CommandLineArgumentProvider () {
12+ @Override
13+ Iterable<String > asArguments () {
14+ def consoleJarFile = configurations. named(" runtimeClasspath" )
15+ .get()
16+ .find { it. name. contains(" junit-platform-console-standalone" ) }
17+
18+ return [" -Ddatadog.smoketest.junit.console.jar.path=${ consoleJarFile} " ]
19+ }
20+ })
1521
1622 if (project. hasProperty(" mavenRepositoryProxy" )) {
1723 // propagate proxy URL to tests, to then propagate it to nested Gradle builds
Original file line number Diff line number Diff line change @@ -43,19 +43,20 @@ dependencies {
4343
4444tasks. register(" unzip" , Copy ) {
4545 def zipFileNamePrefix = " tomcat"
46- def zipPath = project. configurations. serverFile. find {
47- it. name. startsWith(zipFileNamePrefix)
48- }
49- if (zipPath != null ) {
50- def zipFile = file(zipPath)
51- def outputDir = file(" ${ buildDir} " )
52-
53- from zipTree(zipFile)
54- into outputDir
55- } else {
56- throw new GradleException (" Can't find server zip file that starts with: " + zipFileNamePrefix)
46+ def serverZipTree = providers. provider {
47+ // eager access
48+ def zipPath = project. configurations. serverFile. find {
49+ it. name. startsWith(zipFileNamePrefix)
50+ }
51+ if (zipPath == null ) {
52+ throw new GradleException (" Can't find server zip file that starts with: " + zipFileNamePrefix)
53+ }
54+ zipTree(zipPath)
5755 }
5856
57+ from serverZipTree
58+ into layout. buildDirectory
59+
5960 // When tests are disabled this would still be run, so disable this manually
6061 onlyIf { ! project. rootProject. hasProperty(" skipTests" ) }
6162}
You can’t perform that action at this time.
0 commit comments