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

WIP: Comsume proto files from git submodule and build them in a separate module #504

Merged
merged 9 commits into from
Aug 22, 2019
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
13 changes: 11 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
version: 2

init_task: &init_task
name: Init git submodules
command: make init-git-submodules
build_task: &build_task
name: Build
command: ./gradlew clean assemble check --stacktrace
command: make test
verify_task: &verify_task
name: Verify Google Java Format
command: ./gradlew verGJF
command: make verify-format

jobs:
build:
Expand All @@ -16,6 +19,8 @@ jobs:
- restore_cache:
keys:
- gradle-{{ checksum "build.gradle" }}
- run:
<<: *init_task
- run:
<<: *verify_task
- run:
Expand All @@ -38,6 +43,10 @@ jobs:
- restore_cache:
keys:
- java9-gradle-{{ checksum "build.gradle" }}
# make in missing in openjdk:9-jdk image
- run: sudo apt-get update && sudo apt-get install -y make
bogdandrutu marked this conversation as resolved.
Show resolved Hide resolved
- run:
<<: *init_task
- run:
<<: *verify_task
- run:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "proto/src/main/proto"]
path = proto/src/main/proto
url = https://github.com/pavolloffay/opentelemetry-proto.git
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bogdandrutu I have marked this PR as WIP with depends on open-telemetry/opentelemetry-proto#26.

Since this is merged I will create an issue to change to upsream repo once it's ready

2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ $ git commit -m "Update javadoc for API."
Continuous integration builds the project, runs the tests, and runs multiple
types of static analysis.

Before running the build init repository dependencies by running `make init`.

Run the following commands to build, run tests and most static analysis, and
check formatting:

Expand Down
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.DEFAULT_GOAL := test

.PHONY: test
test:
./gradlew clean assemble check --stacktrace

.PHONY: init-git-submodules
init-git-submodules:
git submodule init
git submodule update

.PHONY: verify-format
verify-format:
./gradlew verGJF
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ subprojects {
grpcVersion = '1.20.0'
autoValueVersion = '1.6.2'
opentracingVersion = '0.33.0'
protobufVersion = '3.7.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1. Not all the artifacts will use protobufVersion (i.e. the API itself), but this way we hopefully don't have to re-declare this version again and again ;)

protocVersion = '3.7.1'
guavaVersion = '26.0-android'

libraries = [
Expand All @@ -119,6 +121,8 @@ subprojects {
grpc_context: "io.grpc:grpc-context:${grpcVersion}",
guava: "com.google.guava:guava:${guavaVersion}",
jsr305: "com.google.code.findbugs:jsr305:${findBugsJsr305Version}",
protobuf: "com.google.protobuf:protobuf-java:${protobufVersion}",
protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}",

// Compatibility layer
opentracing: "io.opentracing:opentracing-api:${opentracingVersion}",
Expand Down
11 changes: 4 additions & 7 deletions exporters/jaeger/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ description = 'OpenTelemetry - Jaeger Exporter'

apply plugin: 'com.google.protobuf'

def protobufVersion = '3.7.1'
def protocVersion = '3.7.1'

buildscript {
repositories {
Expand All @@ -15,14 +13,13 @@ buildscript {
}

dependencies {
api project(':opentelemetry-sdk')
api project(':opentelemetry-sdk'),
libraries.protobuf,
libraries.protobuf_util

implementation "io.grpc:grpc-protobuf:${grpcVersion}"
implementation "io.grpc:grpc-stub:${grpcVersion}"

implementation "com.google.protobuf:protobuf-java:${protobufVersion}",
"com.google.protobuf:protobuf-java-util:${protobufVersion}"

annotationProcessor libraries.auto_value

testImplementation "io.grpc:grpc-testing:${grpcVersion}"
Expand Down Expand Up @@ -59,4 +56,4 @@ idea {
sourceDirs += file("build/generated/source/proto/main/java");
// If you have additional sourceSets and/or codegen plugins, add all of them
}
}
}
2 changes: 1 addition & 1 deletion opentracing_shim/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dependencies {
libraries.opentracing

testImplementation project(':opentelemetry-sdk'),
"com.google.protobuf:protobuf-java:${protobufVersion}",
libraries.protobuf,
libraries.junit,
libraries.assertj,
libraries.slf4jsimple,
Expand Down
43 changes: 43 additions & 0 deletions proto/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
description = 'OpenTelemetry Proto'

apply plugin: 'com.google.protobuf'

buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"
}
}

dependencies {
api project(':opentelemetry-api'),
libraries.protobuf

signature "org.codehaus.mojo.signature:java17:1.0@signature"
signature "net.sf.androidscents.signature:android-api-level-14:4.0_r4@signature"
}

animalsniffer {
// Don't check sourceSets.jmh and sourceSets.test
sourceSets = [
sourceSets.main
]
}

protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
}

// IntelliJ complains that the generated classes are not found, ask IntelliJ to include the
// generated Java directories as source folders.
idea {
module {
sourceDirs += file("build/generated/source/proto/main/java");
// If you have additional sourceSets and/or codegen plugins, add all of them
}
}
1 change: 1 addition & 0 deletions proto/src/main/proto
Submodule proto added at 776111
38 changes: 4 additions & 34 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
description = 'OpenTelemetry SDK'

apply plugin: 'com.google.protobuf'

def protobufVersion = '3.7.1'
def protocVersion = '3.7.1'

buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.8"
}
}

dependencies {
api project(':opentelemetry-api')

implementation "com.google.protobuf:protobuf-java:${protobufVersion}",
"com.google.protobuf:protobuf-java-util:${protobufVersion}"
api project(':opentelemetry-api'),
libraries.protobuf,
libraries.protobuf_util
api project(':opentelemetry-proto')

annotationProcessor libraries.auto_value

Expand All @@ -32,19 +18,3 @@ animalsniffer {
sourceSets.main
]
}

protobuf {
protoc {
// The artifact spec for the Protobuf Compiler
artifact = "com.google.protobuf:protoc:${protocVersion}"
}
}

// IntelliJ complains that the generated classes are not found, ask IntelliJ to include the
// generated Java directories as source folders.
idea {
module {
sourceDirs += file("build/generated/source/proto/main/java");
// If you have additional sourceSets and/or codegen plugins, add all of them
}
}
Loading