Set instrumentation groups to unique values when using auto/library/testing pattern. (#1145)
This commit is contained in:
parent
ecef123305
commit
4c3e99fec8
|
@ -74,3 +74,12 @@ if (testLatestDeps) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (['auto', 'library', 'testing'].contains(projectDir.name)) {
|
||||
// We don't use this group anywhere in our config, but we need to make sure it is unique per
|
||||
// instrumentation so Gradle doesn't merge projects with same name due to a bug in Gradle.
|
||||
// https://github.com/gradle/gradle/issues/847
|
||||
// In publish.gradle, we set the maven group, which is what matters, to the correct
|
||||
// value.
|
||||
group = "io.opentelemetry.${projectDir.parentFile.name}"
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
group = 'io.opentelemetry.instrumentation'
|
||||
|
||||
apply from: "$rootDir/gradle/java.gradle"
|
||||
apply from: "$rootDir/gradle/publish.gradle"
|
||||
apply from: "$rootDir/gradle/instrumentation-common.gradle"
|
||||
|
||||
ext {
|
||||
mavenGroupId = 'io.opentelemetry.instrumentation'
|
||||
}
|
||||
|
||||
archivesBaseName = projectDir.parentFile.name
|
||||
|
||||
dependencies {
|
||||
|
|
|
@ -6,6 +6,7 @@ apply plugin: 'muzzle'
|
|||
|
||||
ext {
|
||||
packageInAgentBundle = true
|
||||
mavenGroupId = 'io.opentelemetry.instrumentation.auto'
|
||||
}
|
||||
|
||||
byteBuddy {
|
||||
|
|
|
@ -10,7 +10,7 @@ apply from: "$rootDir/gradle/codenarc.gradle"
|
|||
apply from: "$rootDir/gradle/spotbugs.gradle"
|
||||
|
||||
afterEvaluate {
|
||||
if (group == 'io.opentelemetry.instrumentation.auto') {
|
||||
if (group == 'io.opentelemetry.instrumentation.auto' || findProperty('mavenGroupId') == 'io.opentelemetry.instrumentation.auto') {
|
||||
archivesBaseName = 'opentelemetry-auto-' + archivesBaseName
|
||||
} else {
|
||||
archivesBaseName = 'opentelemetry-' + archivesBaseName
|
||||
|
|
|
@ -20,6 +20,10 @@ publishing {
|
|||
}
|
||||
|
||||
afterEvaluate {
|
||||
def mavenGroupId = project.findProperty('mavenGroupId')
|
||||
if (mavenGroupId) {
|
||||
groupId = mavenGroupId
|
||||
}
|
||||
artifactId = artifactPrefix(project, archivesBaseName) + archivesBaseName
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue