-
Notifications
You must be signed in to change notification settings - Fork 848
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
Building animal sniffer signatures directly from android corelib #5973
Changes from 1 commit
54f0d92
c0a1e62
2b73634
865df76
8432844
1729c59
2495a9f
a06a0ac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import ru.vyarus.gradle.plugin.animalsniffer.info.SignatureInfoTask | ||
import ru.vyarus.gradle.plugin.animalsniffer.signature.BuildSignatureTask | ||
|
||
plugins { | ||
id("otel.java-conventions") | ||
id("ru.vyarus.animalsniffer") | ||
} | ||
|
||
val signatureJar = configurations.create("signatureJar") { | ||
isCanBeConsumed = false | ||
isCanBeResolved = false | ||
} | ||
val signatureJarClasspath = configurations.create("signatureJarClasspath") { | ||
isCanBeConsumed = false | ||
isCanBeResolved = true | ||
extendsFrom(signatureJar) | ||
} | ||
val generatedSignature = configurations.create("generatedSignature") { | ||
isCanBeConsumed = true | ||
isCanBeResolved = false | ||
} | ||
configurations.add(signatureJar) | ||
configurations.add(signatureJarClasspath) | ||
configurations.add(generatedSignature) | ||
|
||
repositories { | ||
mavenCentral() | ||
google() | ||
} | ||
|
||
dependencies { | ||
signature("com.toasttab.android:gummy-bears-api-21:0.6.1@signature") | ||
signatureJar("com.android.tools:desugar_jdk_libs:2.0.4") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tested that it works by adding some code that uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it possible to define these in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried with both but it only worked for |
||
} | ||
|
||
val signatureSimpleName = "android.signature" | ||
val signatureBuilderTask = tasks.register("buildSignature", BuildSignatureTask::class.java) { | ||
files(signatureJarClasspath) // All the jar files here will be added to the signature file. | ||
signatures(configurations.signature) // We'll extend from the existing signatures added to this config. | ||
outputName = signatureSimpleName // Name for the generated signature file. | ||
} | ||
|
||
// Exposing the "generatedSignature" consumable config to be used in other subprojects | ||
artifacts { | ||
add("generatedSignature", project.provider { File(signatureBuilderTask.get().outputs.files.singleFile, signatureSimpleName) }) { | ||
builtBy(signatureBuilderTask) | ||
} | ||
} | ||
|
||
// Utility task to show what's in the signature file | ||
tasks.register( "printSignature", SignatureInfoTask::class.java) { | ||
signature = signatureBuilderTask.get().outputFiles | ||
depth = 1 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,7 @@ include(":sdk-extensions:autoconfigure-spi") | |
include(":sdk-extensions:incubator") | ||
include(":sdk-extensions:jaeger-remote-sampler") | ||
include(":testing-internal") | ||
include(":animal-sniffer") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about animal-sniffer-signature? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure no problem, I've made the changes. |
||
|
||
val gradleEnterpriseServer = "https://ge.opentelemetry.io" | ||
val isCI = System.getenv("CI") != null | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move
google()
to the repositories section ofsettings.gradle.kts
, and deletemavenCentral()
since its redundant.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, it's updated now.