-
Notifications
You must be signed in to change notification settings - Fork 813
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy in protobuf conventions from SDK repo. (#4643)
* Copy in protobuf conventions from SDK repo. * fix * Spot
- Loading branch information
Showing
3 changed files
with
38 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
conventions/src/main/kotlin/otel.protobuf-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import com.google.protobuf.gradle.* | ||
|
||
plugins { | ||
id("com.google.protobuf") | ||
|
||
id("otel.java-conventions") | ||
} | ||
|
||
protobuf { | ||
val versions: Map<String, String> by project | ||
protoc { | ||
// The artifact spec for the Protobuf Compiler | ||
artifact = "com.google.protobuf:protoc:3.3.0" | ||
} | ||
plugins { | ||
id("grpc") { | ||
artifact = "io.grpc:protoc-gen-grpc-java:1.6.0" | ||
} | ||
} | ||
generateProtoTasks { | ||
all().configureEach { | ||
plugins { | ||
id("grpc") | ||
} | ||
} | ||
} | ||
} | ||
|
||
afterEvaluate { | ||
// Classpath when compiling protos, we add dependency management directly | ||
// since it doesn't follow Gradle conventions of naming / properties. | ||
dependencies { | ||
add("compileProtoPath", platform(project(":dependencyManagement"))) | ||
add("testCompileProtoPath", platform(project(":dependencyManagement"))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters