Skip to content

Commit 29adf18

Browse files
committed
chore: More laziness on some Gradle configurations and jvmArgs
1 parent d8ebdd5 commit 29adf18

File tree

1 file changed

+32
-16
lines changed

1 file changed

+32
-16
lines changed

dd-smoke-tests/osgi/build.gradle

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ apply from: "$rootDir/gradle/java.gradle"
1212
description = 'OSGi Application Smoke Tests.'
1313

1414
configurations {
15-
equinox
16-
felix
17-
knopflerfish
18-
bundles
15+
register('equinox')
16+
register('felix')
17+
register('knopflerfish')
18+
register('bundles')
1919
}
2020

2121
configurations.named('bundles') {
@@ -96,16 +96,32 @@ tasks.register('subscribingBundle', Bundle) {
9696
tasks.withType(Test).configureEach {
9797
dependsOn "commonBundle", "clientBundle", "messagingBundle", "publishingBundle", "subscribingBundle", "jar"
9898

99-
jvmArgs "-Ddatadog.smoketest.osgi.appJar.path=${tasks.jar.archiveFile.get()}"
100-
jvmArgs "-Ddatadog.smoketest.osgi.equinoxJar.path=${configurations.equinox.first().path}"
101-
jvmArgs "-Ddatadog.smoketest.osgi.felixJar.path=${configurations.felix.first().path}"
102-
jvmArgs "-Ddatadog.smoketest.osgi.knopflerfishJar.path=${configurations.knopflerfish.first().path}"
103-
104-
jvmArgs "-Ddatadog.smoketest.osgi.bundle.paths=" +
105-
"${tasks.commonBundle.archiveFile.get()}," +
106-
"${tasks.clientBundle.archiveFile.get()}," +
107-
"${tasks.messagingBundle.archiveFile.get()}," +
108-
"${tasks.publishingBundle.archiveFile.get()}," +
109-
"${tasks.subscribingBundle.archiveFile.get()}," +
110-
"${configurations.bundles*.path.join(',')}"
99+
jvmArgumentProviders.add(new CommandLineArgumentProvider() {
100+
@Override
101+
Iterable<String> asArguments() {
102+
def jarTask = tasks.named('jar', Jar).get()
103+
def equinoxJar = configurations.named('equinox').get().first().path
104+
def felixJar = configurations.named('felix').get().first().path
105+
def knopflerfishJar = configurations.named('knopflerfish').get().first().path
106+
107+
def bundlePaths = [
108+
tasks.named('commonBundle', Bundle).get().archiveFile.get(),
109+
tasks.named('clientBundle', Bundle).get().archiveFile.get(),
110+
tasks.named('messagingBundle', Bundle).get().archiveFile.get(),
111+
tasks.named('publishingBundle', Bundle).get().archiveFile.get(),
112+
tasks.named('subscribingBundle', Bundle).get().archiveFile.get(),
113+
*configurations.named('bundles').get().collect { it.path }
114+
].join(',')
115+
116+
println(bundlePaths)
117+
118+
return [
119+
"-Ddatadog.smoketest.osgi.appJar.path=${jarTask.archiveFile.get()}",
120+
"-Ddatadog.smoketest.osgi.equinoxJar.path=${equinoxJar}",
121+
"-Ddatadog.smoketest.osgi.felixJar.path=${felixJar}",
122+
"-Ddatadog.smoketest.osgi.knopflerfishJar.path=${knopflerfishJar}",
123+
"-Ddatadog.smoketest.osgi.bundle.paths=${bundlePaths}"
124+
]
125+
}
126+
})
111127
}

0 commit comments

Comments
 (0)