refreshVersions
refreshVersions copied to clipboard
Update refreshVersionsMigrate to work only within the dependencies blocks (and test with KMP projects, including with Kotlin DSL)
Error happens when try to use on scope of protobuf too, as example:
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:$google_protobuf_version" << // libs.protoc
}
...
}
Caused by: org.gradle.api.InvalidUserDataException: Name must not be null!
@joaoeudes7 Use versionFor("com.google.protobuf:protoc:_").
@joaoeudes7 Use
versionFor("com.google.protobuf:protoc:_").
Not works here, i got this error:
Caused by: org.gradle.internal.metaobject.AbstractDynamicObject$CustomMessageMissingMethodException: Could not find method versionFor() for arguments [com.google.protobuf:protoc:_] on object of type com.google.protobuf.gradle.ExecutableLocator.
The following worked for me to have refreshVersions handle the protobuf compiler:
protobuf {
protoc {
val version = versionFor("com.google.protobuf:protoc:_")
artifact = "com.google.protobuf:protoc:$version"
}
}