Javi
04/18/2024, 4:35 PMonlyIf
in the new develocity plugin
WARNING: Error invoking build scan publishingCondition action
Parameter specified as non-null is null: method com.javiersc.hubdle.settings.HubdleSettingsPluginKt.getHubdleSettings, parameter <this>
The relevant code is:
public val publishAlways: Property<Boolean> =
objects.property<Boolean>().convention(System.getenv("CI") == "true")
private fun Settings.configureGradleDevelocity() {
pluginManager.apply("com.gradle.develocity")
configure<DevelocityConfiguration> {
buildScan { scan ->
scan.publishing.onlyIf { hubdleSettings.buildScan.publishAlways.get() }
}
}
}
Mikhail Lopatkin
04/18/2024, 8:41 PMprivate fun Settings.configureGradleDevelocity() {
pluginManager.apply("com.gradle.develocity")
val publishAlways = hubdleSettings.buildScan.publishAlways
configure<DevelocityConfiguration> {
buildScan { scan ->
scan.publishing.onlyIf { publishAlways.get() }
}
}
}
Can you please prepare a minimal reproducer for us to investigate further?Mikhail Lopatkin
04/18/2024, 8:43 PMconvention(System.getenv("CI") == "true")
might work better as convention(providers.environmentVariable("CI").map { it == "true"}.orElse(false))
, by avoiding making the environment variable an input to configuration.Javi
04/18/2024, 8:51 PMJavi
04/19/2024, 11:48 AMconvention(System.getenv("CI") == "true")
might work better as convention(providers.environmentVariable("CI").map { it == "true"}.orElse(false))
, by avoiding making the environment variable an input to configuration.`
There is no con about this?Mikhail Lopatkin
04/19/2024, 11:53 AMThere is no con about this? (edited)Well, CC has to store the whole provider chain to re-evaluate it upon loading, but the overhead is likely tiny, unless you have thousands of these properties laying around.
Javi
04/19/2024, 12:12 PMMikhail Lopatkin
04/19/2024, 12:18 PMproblems=warn
, in which case there's no need for the reproducer. Thank you for cooperation!