Don't hardcode agent-for-testing archive filename so it can be publis… (#2146)

* Don't hardcode agent-for-testing archive filename so it can be published.

* Fix accidental

* afterEvaluate
This commit is contained in:
Anuraag Agrawal 2021-02-01 14:33:27 +09:00 committed by GitHub
parent 23945d97e9
commit 49194ff444
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -104,9 +104,11 @@ shadowJar {
relocate "application.io.opentelemetry", "io.opentelemetry"
}
evaluationDependsOn(":testing:agent-for-testing")
tasks.withType(Test).configureEach {
jvmArgs "-Dotel.javaagent.debug=true"
jvmArgs "-javaagent:${project(":testing:agent-for-testing").buildDir}/libs/javaagent-for-testing.jar"
jvmArgs "-javaagent:${project(":testing:agent-for-testing").tasks.shadowJar.archiveFile.get().asFile.absolutePath}"
jvmArgs "-Dotel.initializer.jar=${shadowJar.archiveFile.get().asFile.absolutePath}"
jvmArgs "-Dinternal.testing.disable.global.library.ignores=true"

View File

@ -46,7 +46,6 @@ configurations {
}
shadowJar {
mergeServiceFiles()
exclude '**/module-info.class'

View File

@ -36,9 +36,12 @@ configurations {
shadowInclude
}
evaluationDependsOn(":testing:agent-exporter")
shadowJar {
configurations = [project.configurations.shadowInclude]
archiveFileName = 'javaagent-for-testing.jar'
archiveClassifier.set("")
dependsOn ':testing:agent-exporter:shadowJar'
with isolateSpec([project(':testing:agent-exporter').tasks.shadowJar])
@ -77,9 +80,11 @@ dependencies {
testImplementation deps.opentelemetryApi
}
tasks.withType(Test).configureEach {
jvmArgs "-Dotel.javaagent.debug=true"
jvmArgs "-javaagent:${shadowJar.archiveFile.get().asFile.absolutePath}"
afterEvaluate {
tasks.withType(Test).configureEach {
jvmArgs "-Dotel.javaagent.debug=true"
jvmArgs "-javaagent:${shadowJar.archiveFile.get().asFile.absolutePath}"
dependsOn shadowJar
dependsOn shadowJar
}
}