-
Notifications
You must be signed in to change notification settings - Fork 850
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Building animal sniffer signatures directly from android corelib (#5973)
- Loading branch information
1 parent
c87852c
commit f58a209
Showing
4 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
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") | ||
} | ||
|
||
description = "Build tool to generate the Animal Sniffer Android signature" | ||
otelJava.moduleName.set("io.opentelemetry.internal.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) | ||
|
||
dependencies { | ||
signature("com.toasttab.android:gummy-bears-api-21:0.6.1@signature") | ||
signatureJar("com.android.tools:desugar_jdk_libs") | ||
} | ||
|
||
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters