Skip to content

Commit

Permalink
Merge pull request #6462 from alvasw/gradle_move_protoc_build_logic_i…
Browse files Browse the repository at this point in the history
…nto_own_build_gradle_file

Gradle: Move protoc build-logic into its own build.gradle
  • Loading branch information
alejandrogarcia83 authored Dec 18, 2022
2 parents 51c7e40 + 5d30d44 commit 959ac9a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 41 deletions.
41 changes: 0 additions & 41 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,47 +128,6 @@ configure([project(':cli'),
}
}

configure(project(':proto')) {
apply plugin: 'com.google.protobuf'

dependencies {
annotationProcessor libs.lombok
compileOnly libs.javax.annotation
compileOnly libs.lombok
implementation libs.logback.classic
implementation libs.logback.core
implementation libs.google.guava
implementation libs.protobuf.java
implementation libs.slf4j.api
implementation(libs.grpc.protobuf) {
exclude(module: 'animal-sniffer-annotations')
exclude(module: 'guava')
}
implementation(libs.grpc.stub) {
exclude(module: 'animal-sniffer-annotations')
exclude(module: 'guava')
}
}

sourceSets.main.java.srcDirs += [
'build/generated/source/proto/main/grpc',
'build/generated/source/proto/main/java'
]

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}
}

configure(project(':assets')) {
dependencies {
Expand Down
39 changes: 39 additions & 0 deletions proto/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
apply plugin: 'com.google.protobuf'

dependencies {
annotationProcessor libs.lombok
compileOnly libs.javax.annotation
compileOnly libs.lombok
implementation libs.logback.classic
implementation libs.logback.core
implementation libs.google.guava
implementation libs.protobuf.java
implementation libs.slf4j.api
implementation(libs.grpc.protobuf) {
exclude(module: 'animal-sniffer-annotations')
exclude(module: 'guava')
}
implementation(libs.grpc.stub) {
exclude(module: 'animal-sniffer-annotations')
exclude(module: 'guava')
}
}

sourceSets.main.java.srcDirs += [
'build/generated/source/proto/main/grpc',
'build/generated/source/proto/main/java'
]

protobuf {
protoc {
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins { grpc {} }
}
}

0 comments on commit 959ac9a

Please sign in to comment.