Skip to content

Commit

Permalink
Use normal filesystem-based Gradle paths. (open-telemetry#2332)
Browse files Browse the repository at this point in the history
* Use normal filesystem-based Gradle paths.

* Update workflow by making agnostic to jacoco project name

* More merge
  • Loading branch information
Anuraag Agrawal authored Dec 18, 2020
1 parent d2a012a commit 6954d1f
Show file tree
Hide file tree
Showing 45 changed files with 186 additions and 162 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: burrunan/[email protected]
with:
remote-build-cache-proxy-enabled: false
arguments: build --stacktrace ${{ matrix.coverage && ':opentelemetry-all:jacocoTestReport' || '' }}
arguments: build --stacktrace ${{ matrix.coverage && 'jacocoTestReport' || '' }}
properties: |
testAdditionalJavaVersions=${{ matrix.testAdditionalJavaVersions }}
org.gradle.java.installations.paths=${{ steps.setup-java-8.outputs.path }},${{ steps.setup-java-11.outputs.path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: burrunan/[email protected]
with:
remote-build-cache-proxy-enabled: false
arguments: build --stacktrace ${{ matrix.coverage && ':opentelemetry-all:jacocoTestReport' || '' }}
arguments: build --stacktrace ${{ matrix.coverage && 'jacocoTestReport' || '' }}
properties: |
testAdditionalJavaVersions=${{ matrix.testAdditionalJavaVersions }}
org.gradle.java.installations.paths=${{ steps.setup-java-8.outputs.path }},${{ steps.setup-java-11.outputs.path }}
Expand Down
9 changes: 5 additions & 4 deletions api/all/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ plugins {

description = 'OpenTelemetry API'
ext.moduleName = "io.opentelemetry.api"
archivesBaseName = "opentelemetry-api"

dependencies {
api project(':opentelemetry-context'),
project(':opentelemetry-api-baggage'),
project(':opentelemetry-api-common'),
project(':opentelemetry-api-trace')
api project(':api:context'),
project(':api:baggage'),
project(':api:common'),
project(':api:trace')

annotationProcessor libraries.auto_value

Expand Down
4 changes: 2 additions & 2 deletions api/baggage/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description = 'OpenTelemetry API'
ext.moduleName = "io.opentelemetry.api"

dependencies {
api project(':opentelemetry-context'),
project(':opentelemetry-api-common')
api project(':api:context'),
project(':api:common')

annotationProcessor libraries.auto_value

Expand Down
7 changes: 7 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
subprojects {
// Workaround https://github.com/gradle/gradle/issues/847
group = "io.opentelemetry.api"
plugins.withId("java") {
archivesBaseName = "opentelemetry-api-${project.name}"
}
}
1 change: 1 addition & 0 deletions api/context/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {

description = "OpenTelemetry Context (Incubator)"
ext.moduleName = "io.opentelemetry.context"
archivesBaseName = "opentelemetry-context"

testSets {
grpcInOtelTest
Expand Down
4 changes: 2 additions & 2 deletions api/metrics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description = 'OpenTelemetry API'
ext.moduleName = "io.opentelemetry.api.metrics"

dependencies {
api project(':opentelemetry-context'),
project(':opentelemetry-api-common')
api project(':api:context'),
project(':api:common')

annotationProcessor libraries.auto_value

Expand Down
4 changes: 2 additions & 2 deletions api/trace/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ description = 'OpenTelemetry API'
ext.moduleName = "io.opentelemetry.api.trace"

dependencies {
api project(':opentelemetry-context'),
project(':opentelemetry-api-common')
api project(':api:context'),
project(':api:common')

annotationProcessor libraries.auto_value

Expand Down
25 changes: 14 additions & 11 deletions bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,18 @@ plugins {
description = 'OpenTelemetry Bill of Materials'
group = "io.opentelemetry"

dependencies {
constraints {
parent.childProjects.sort { "$it.value" }
.collect { it.value }
.findAll { it.name != project.name }
.findAll { !it.name.endsWith('-metrics') }
.each { project ->
api project
println project
}
afterEvaluate {
dependencies {
constraints {
rootProject.subprojects.sort { "$it.archivesBaseName" }
.collect { it }
.findAll { it.name != project.name }
.findAll { !it.name.endsWith('metrics') }
.each { project ->
project.plugins.withId("maven-publish") {
api project
}
}
}
}
}
}
9 changes: 7 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ subprojects {
plugins.apply('com.diffplug.spotless')
plugins.apply('net.ltgt.errorprone')

archivesBaseName = "opentelemetry-${project.name}"

repositories {
mavenCentral()
jcenter()
Expand Down Expand Up @@ -432,10 +434,13 @@ subprojects {
publishing {
publications {
mavenPublication(MavenPublication) {
version project.name.endsWith('-metrics') ? "${version}".replaceFirst(/^(\d+)\.(\d+).(\d+)/) { _, major, minor, patch ->
version project.name.endsWith('metrics') ? "${version}".replaceFirst(/^(\d+)\.(\d+).(\d+)/) { _, major, minor, patch ->
"${major}.${minor}.${patch}-alpha"
} : version
groupId group
groupId "io.opentelemetry"
afterEvaluate {
artifactId = archivesBaseName
}

plugins.withId("java-platform") {
from(components["javaPlatform"])
Expand Down
7 changes: 7 additions & 0 deletions exporters/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
subprojects {
// https://github.com/gradle/gradle/issues/847
group = "io.opentelemetry.exporters"
plugins.withId("java") {
archivesBaseName = "opentelemetry-exporter-${project.name}"
}
}
6 changes: 3 additions & 3 deletions exporters/jaeger-thrift/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ description = 'OpenTelemetry - Jaeger Thrift Exporter'
ext.moduleName = "io.opentelemetry.exporter.jaeger.thrift"

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

implementation project(':opentelemetry-sdk'),
implementation project(':sdk:all'),
libraries.jaeger_client

testImplementation 'com.fasterxml.jackson.core:jackson-databind',
libraries.testcontainers,
libraries.okhttp

testImplementation project(':opentelemetry-sdk-testing')
testImplementation project(':sdk:testing')

signature libraries.android_signature
}
Expand Down
8 changes: 4 additions & 4 deletions exporters/jaeger/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ description = 'OpenTelemetry - Jaeger Exporter'
ext.moduleName = "io.opentelemetry.exporter.jaeger"

dependencies {
api project(':opentelemetry-sdk'),
api project(':sdk:all'),
libraries.grpc_api

implementation project(':opentelemetry-sdk-extension-otproto'),
project(':opentelemetry-sdk'),
implementation project(':sdk-extensions:otproto'),
project(':sdk:all'),
libraries.grpc_protobuf,
libraries.grpc_stub,
libraries.protobuf,
Expand All @@ -25,7 +25,7 @@ dependencies {
libraries.testcontainers,
libraries.okhttp

testImplementation project(':opentelemetry-sdk-testing')
testImplementation project(':sdk:testing')

// Protobuf plugin seems to erroneously use the non-classpath configurations for resolving
// dependencies.
Expand Down
4 changes: 2 additions & 2 deletions exporters/logging/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ description = 'OpenTelemetry - Logging Exporter'
ext.moduleName = "io.opentelemetry.exporter.logging"

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

testImplementation project(':opentelemetry-sdk-testing')
testImplementation project(':sdk:testing')

signature libraries.android_signature
}
Expand Down
3 changes: 2 additions & 1 deletion exporters/otlp/all/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ plugins {

description = 'OpenTelemetry Protocol Exporters'
ext.moduleName = "io.opentelemetry.exporter.otlp"
archivesBaseName = "opentelemetry-exporter-otlp"

dependencies {
api project(':opentelemetry-exporter-otlp-trace')
api project(':exporters:otlp:trace')
}
5 changes: 5 additions & 0 deletions exporters/otlp/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
subprojects {
plugins.withId("java") {
archivesBaseName = "opentelemetry-exporter-otlp-${project.name}"
}
}
6 changes: 3 additions & 3 deletions exporters/otlp/metrics/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ version = "${version}".replaceFirst(/^(\d+)\.(\d+).(\d+)/) { _, major, minor, pa
}

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

implementation project(':opentelemetry-sdk-extension-otproto'),
implementation project(':sdk-extensions:otproto'),
libraries.grpc_api,
libraries.grpc_protobuf,
libraries.grpc_stub,
libraries.protobuf

testImplementation project(':opentelemetry-sdk-testing')
testImplementation project(':sdk:testing')

testImplementation "io.grpc:grpc-testing:${grpcVersion}"
testRuntime "io.grpc:grpc-netty-shaded:${grpcVersion}"
Expand Down
8 changes: 4 additions & 4 deletions exporters/otlp/trace/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ description = 'OpenTelemetry Protocol Trace Exporter'
ext.moduleName = "io.opentelemetry.exporter.otlp.trace"

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

implementation project(':opentelemetry-sdk-extension-otproto'),
implementation project(':sdk-extensions:otproto'),
libraries.grpc_api,
libraries.grpc_protobuf,
libraries.grpc_stub,
libraries.protobuf

testImplementation project(':opentelemetry-sdk-testing'),
testImplementation project(':sdk:testing'),
'com.linecorp.armeria:armeria-grpc',
'com.linecorp.armeria:armeria-junit5',
"io.grpc:grpc-testing:${grpcVersion}"

testRuntime "io.grpc:grpc-netty-shaded:${grpcVersion}"

jmh project(':opentelemetry-sdk-testing')
jmh project(':sdk:testing')

signature libraries.android_signature
}
2 changes: 1 addition & 1 deletion exporters/prometheus/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ description = 'OpenTelemetry Prometheus Exporter'
ext.moduleName = "io.opentelemetry.exporter.prometheus"

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

implementation libraries.prometheus_client

Expand Down
4 changes: 2 additions & 2 deletions exporters/zipkin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ ext.moduleName = "io.opentelemetry.exporter.zipkin"
dependencies {
compileOnly libraries.auto_value

api project(':opentelemetry-sdk')
api project(':sdk:all')

annotationProcessor libraries.auto_value

implementation libraries.zipkin_reporter,
libraries.zipkin_okhttp

testImplementation project(':opentelemetry-sdk-testing')
testImplementation project(':sdk:testing')
testImplementation libraries.guava,
libraries.zipkin_junit

Expand Down
2 changes: 1 addition & 1 deletion extensions/annotations/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ description = 'OpenTelemetry Extension Annotations'
ext.moduleName = "io.opentelemetry.extension.annotations"

dependencies {
api project(':opentelemetry-api')
api project(':api:all')
}
5 changes: 5 additions & 0 deletions extensions/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
subprojects {
plugins.withId("java") {
archivesBaseName = "opentelemetry-extension-${project.name}"
}
}
4 changes: 2 additions & 2 deletions extensions/kotlin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ ext.moduleName = "io.opentelemetry.extension.kotlin"
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))

api project(':opentelemetry-api')
api project(':api:all')

api("org.jetbrains.kotlin:kotlin-stdlib-common")
api("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1")

testImplementation project(':opentelemetry-sdk-testing')
testImplementation project(':sdk:testing')
testImplementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")

signature libraries.android_signature
Expand Down
2 changes: 1 addition & 1 deletion extensions/trace-propagators/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ description = 'OpenTelemetry Extension : Trace Propagators'
ext.moduleName = "io.opentelemetry.extension.trace.propagation"

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

testImplementation libraries.jaeger_client,
libraries.guava
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ task fatJar(type: Jar) {
}

dependencies {
implementation project(':opentelemetry-sdk'),
project(':opentelemetry-exporter-jaeger'),
implementation project(':sdk:all'),
project(':exporters:jaeger'),
libraries.grpc_protobuf,
libraries.protobuf,
"io.grpc:grpc-netty-shaded:${grpcVersion}"
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/tracecontext/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ task fatJar(type: Jar) {
}

dependencies {
implementation project(':opentelemetry-sdk'),
project(':opentelemetry-extension-trace-propagators'),
implementation project(':sdk:all'),
project(':extensions:trace-propagators'),
libraries.okhttp,
libraries.slf4jsimple,
"com.sparkjava:spark-core:2.9.3",
Expand Down
6 changes: 3 additions & 3 deletions opencensus-shim/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ description = 'OpenTelemetry OpenCensus Shim'
ext.moduleName = "io.opentelemetry.opencensusshim"

dependencies {
api project(':opentelemetry-api'),
project(':opentelemetry-sdk'),
api project(':api:all'),
project(':sdk:all'),
libraries.opencensus_api,
libraries.opencensus_impl_core,
libraries.opencensus_metric_exporter

testImplementation project(':opentelemetry-sdk'),
testImplementation project(':sdk:all'),
libraries.junit,
libraries.assertj,
libraries.slf4jsimple,
Expand Down
4 changes: 2 additions & 2 deletions opentracing-shim/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ description = 'OpenTelemetry OpenTracing Bridge'
ext.moduleName = "io.opentelemetry.opentracingshim"

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

testImplementation project(':opentelemetry-sdk-testing'),
testImplementation project(':sdk:testing'),
libraries.junit,
libraries.assertj,
libraries.slf4jsimple
Expand Down
10 changes: 5 additions & 5 deletions perf-harness/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ description = 'Performance Testing Harness'
ext.moduleName = "io.opentelemetry.perf-harness"

dependencies {
compile project(':opentelemetry-api'),
project(":opentelemetry-sdk"),
project(":opentelemetry-sdk-testing"),
project(":opentelemetry-exporter-otlp-trace"),
project(":opentelemetry-exporter-logging")
compile project(':api:all'),
project(":sdk:all"),
project(":sdk:testing"),
project(":exporters:otlp:trace"),
project(":exporters:logging")

compile("io.grpc:grpc-netty-shaded")
compile("eu.rekawek.toxiproxy:toxiproxy-java:2.1.4")
Expand Down
Loading

0 comments on commit 6954d1f

Please sign in to comment.