Skip to content

Commit

Permalink
refactor(proto): Extract protobuf dependency management
Browse files Browse the repository at this point in the history
In order to use a managed dependency in the `protoc` configuration settings, dependencyResolutionManagement must be used instead of enforcePlatform.
  • Loading branch information
jvz committed Nov 7, 2024
1 parent dbbc628 commit adced8b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
8 changes: 3 additions & 5 deletions kork-proto/kork-proto.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
plugins {
id "java-library"
id "com.google.protobuf" version "0.8.12"
alias libs.plugins.protobuf
}

dependencies {
api(platform(project(":spinnaker-dependencies")))

implementation "com.google.protobuf:protobuf-java"
implementation libs.protobuf.java
}

protobuf {
protoc {
// TODO: figure out how to reference version in BOM.
artifact = "com.google.protobuf:protoc:3.21.12"
artifact = libs.protoc.get()
}
}

Expand Down
13 changes: 13 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
* limitations under the License.
*/

dependencyResolutionManagement {
versionCatalogs {
libs {
version('protobuf', '3.25.2')

library('protobuf-java', 'com.google.protobuf', 'protobuf-java').versionRef('protobuf')
library('protoc', 'com.google.protobuf', 'protoc').versionRef('protobuf')

plugin('protobuf', 'com.google.protobuf').version('0.9.4')
}
}
}

if (spinnakerGradleVersion.endsWith('-SNAPSHOT')) {
pluginManagement {
repositories {
Expand Down

0 comments on commit adced8b

Please sign in to comment.