I'm trying to configure PTS as part of a trial, bu...
# develocity
n
I'm trying to configure PTS as part of a trial, but I'm not sure how to configure it given our current setup. We apply the develocity plugin in an init script of our custom gradle distribution. This seems to put the develocity extension in a separate classloader, as I'm getting an untyped generated accessor in my project's build:
Copy code
public val org.gradle.api.Project.develocity: kotlin.Any /* compiled code */
    public final get

public fun org.gradle.api.Project.develocity(configure: org.gradle.api.Action<kotlin.Any>): kotlin.Unit { /* compiled code */ }
We'd like to be able to configure
develocity.predictiveTestSelection
per project, directly through the extension, if at all possible.
✅ 1
I tried adding the plugin to the classpath of the build by adding this to the settings script of my project
Copy code
plugins {
    // applied in init script but we need a typesafe accessor
    id("com.gradle.develocity") version "3.17.6" apply false
}
That does generate a typesafe accessor, but when I try to use it, it leads to "issues" in the extension model:
Copy code
> Extension of type 'DevelocityTestConfiguration' does not exist. Currently registered extension types: [ExtraPropertiesExtension, DevelocityTestConfiguration, TestDistributionExtension, PredictiveTestSelectionExtension]
d
I'm not sure about applying Develocity in a
.kts
initscript, but we have an extensively tested Groovy init-script that can be used to apply and configure Develocity. Note that this script is complicated by the need to support multiple Gradle & DV versions, but could provide some hints for you to work from.
n
ah, that was exactly enough extra information to figure this out 🙂 thank you Just putting the plugin on the classpath of our build-logic and wrapping the extra configuration inside
Copy code
pluginManager.withPlugin("com.gradle.develocity")
fixed the issue.
d
Excellent! Glad to be of assistance 🙂