Ksawery Karwacki
09/16/2024, 3:20 PMtasks.named("test", Test::class.java) { test ->
test.systemProperty(PACT_BROKER_URL, ALPHA_PACT_BROKER_URL)
test.systemProperty(PACT_BROKER_ENABLE_PENDING, true)
test.systemProperty(PACT_BROKER_INCLUDE_WIP_PACTS_SINCE, "2023-10-19")
test.systemProperty(PACT_PROVIDER_NAME, project.versionProvider.map { it[ALPHA_VERSION_FILE_PROPERTY_NAME].orEmpty() })
test.systemProperty(PACT_PROVIDER_VERSION, project.versionProvider.map { it[ALPHA_VERSION_FILE_PROPERTY_VERSION].orEmpty() })
test.systemProperty(PACT_PROVIDER_BRANCH, project.versionProvider.map { it[ALPHA_VERSION_FILE_PROPERTY_GIT_COMMIT_BRANCH].orEmpty() })
test.systemProperty(PACT_VERIFIER_PUBLISH_RESULTS, System.getProperty(PACT_VERIFIER_PUBLISH_RESULTS))
}
But in the debugger those properties are never resolved properly:Thomas Broyer
09/16/2024, 3:34 PMKsawery Karwacki
09/16/2024, 3:36 PMclass Version(private val version: Provider<SemVer>) {
override fun toString(): String {
return version.get().toString()
}
}Ksawery Karwacki
09/16/2024, 3:36 PMVampire
09/16/2024, 9:07 PMtoString-lazy also works.
Hopefully with the propertization in Gradle 9 this will change anyway.
The alternative you could use is an argument provider.Vampire
09/16/2024, 9:08 PM