@@ -8,8 +8,8 @@ apply from: "$rootDir/gradle/java.gradle"
88description = ' JBoss Modules Smoke Tests.'
99
1010configurations {
11- jbossModulesV1
12- jbossModulesV2
11+ register( ' jbossModulesV1' )
12+ register( ' jbossModulesV2' )
1313}
1414
1515configurations. matching { name =~ / jbossModules.*/ }. configureEach {
@@ -30,14 +30,14 @@ dependencies {
3030}
3131
3232tasks. register(' libraryModules' , Copy ) {
33- from configurations. compileClasspath
34- into libsDirectory . dir(' test-repo' )
33+ from configurations. named( ' compileClasspath' )
34+ into layout . buildDirectory . dir(' test-repo' )
3535 exclude ' **/jboss-modules-*'
3636 rename ' (.*)(-[0-9][^-]*)\\ .jar' , ' $1/main/$1.jar'
3737}
3838
3939def packageTestModule (jar , name ) {
40- jar. destinationDirectory = libsDirectory . dir(" test-repo/${ name} /main" )
40+ jar. destinationDirectory = layout . buildDirectory . dir(" test-repo/${ name} /main" )
4141 jar. archiveFileName = " ${ name} .jar"
4242 jar. from sourceSets. main. output
4343 jar. include " datadog/smoketest/jbossmodules/${ name} /**"
@@ -67,7 +67,7 @@ tasks.register('appModule', Jar) {
6767
6868tasks. register(' moduleDescriptors' , Copy ) {
6969 from sourceSets. main. output. resourcesDir
70- into libsDirectory . dir(' test-repo' )
70+ into layout . buildDirectory . dir(' test-repo' )
7171 dependsOn " processResources"
7272}
7373
@@ -81,7 +81,15 @@ tasks.withType(Test).configureEach {
8181 " subscribingModule" ,
8282 " appModule"
8383
84- jvmArgs " -Ddatadog.smoketest.jbossmodules.JBossModulesV1=${ configurations.jbossModulesV1.asPath} "
85- jvmArgs " -Ddatadog.smoketest.jbossmodules.JBossModulesV2=${ configurations.jbossModulesV2.asPath} "
86- jvmArgs " -Ddatadog.smoketest.jbossmodules.repoPath=${ libsDirectory.dir('test-repo').get()} "
84+ jvmArgumentProviders. add(new CommandLineArgumentProvider () {
85+ @Override
86+ Iterable<String > asArguments () {
87+ def jbossModulesV1Jar = configurations. named(' jbossModulesV1' ). get(). asPath
88+ def jbossModulesV2Jar = configurations. named(' jbossModulesV2' ). get(). asPath
89+
90+ return [" -Ddatadog.smoketest.jbossmodules.JBossModulesV1=${ jbossModulesV1Jar} " ,
91+ " -Ddatadog.smoketest.jbossmodules.JBossModulesV2=${ jbossModulesV2Jar} " ,
92+ " -Ddatadog.smoketest.jbossmodules.repoPath=${ layout.buildDirectory.dir('test-repo').get()} " ]
93+ }
94+ })
8795}
0 commit comments