Reputation: 9507
When I am running tests using bnd
(from the Bndtools project) through gradle, I would like to set a random value in test.bndrun
:
-runproperties: \
osgi.instance.area=random_value
Where random_value
would be something random (like "area_" + <currentTimeMillis>
).
Is there a possibility to express that without having a script or a gradle task to modify the test.bndrun
file?
Upvotes: 0
Views: 24
Reputation: 9507
I found a solution to this:
In the test.bndrun
I have:
-runproperties: \
osgi.instance.area=area_${randomTimestamp}
And in the Gradle Task, I prepare the value randomTimestamp
:
def testOSGi = tasks.register('testOSGi', aQute.bnd.gradle.TestOSGi) {
dependsOn resolve
bundles = files(sourceSets.osgiTest.runtimeClasspath, configurations.archives.artifacts.files)
bndrun = file('test.bndrun')
properties = ['randomTimestamp': System.currentTimeMillis()]
}
Upvotes: 0