Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle: Move protoc build-logic into its own build.gradle #6462

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {} }
}
}