Slackbot
10/15/2023, 8:04 PMAdam
10/15/2023, 11:06 PMframeworkVersion.get() will cause the property to be evaluated too early. Instead, use frameworkVersion.map {} and dependencies.create() to create a Dependency lazily, and use dependencies.addProvider(...) to add it to 'implementation'.Sid B
10/15/2023, 11:29 PMimplementation(platform(...)) dependency instead of just implementation
What do I give here instead of implementation
dependencies.addProvider("implementation", extensionProps.frameworkVersion.map {s -> "com.company:bom:$s })Vampire
10/16/2023, 2:07 AMimplementation is implementation is implementation.
platform(...) is part of the dependency.Sid B
10/16/2023, 2:11 AMplatform() dependency here?Vampire
10/16/2023, 2:13 AMdependencies.platform(...)Sid B
10/16/2023, 2:18 AMVampire
10/16/2023, 2:24 AMSid B
10/16/2023, 3:04 AMdependencies.platform() returns a Dependency. dependencies.addProvider expects a dependencyNotation . Any way to get a dependencyNotation from a DependencySid B
10/16/2023, 4:55 AMconfigurations.implementation.get().dependencies.addAllLater(extensionProps.frameworkVersion.map { listOf(dependencies.platform("com.company:bom:$it))})Thomas Broyer
10/16/2023, 7:12 AMdependencies {
implementation(extensionProps.frameworkVersion.map { dependencies.platform("com.company:bom:$it") })
}
(according to the docs, you can use a provider with the standard add or the equivalent type-safe accessors: https://docs.gradle.org/current/dsl/org.gradle.api.artifacts.dsl.DependencyHandler.html#N17255)Vampire
10/16/2023, 7:32 AMdependencies{ ... } also just platform(...) instead of dependencies.platform(...) should work.Sid B
10/16/2023, 7:21 PM