File tree Expand file tree Collapse file tree 1 file changed +25
-9
lines changed
testing/agent-for-testing Expand file tree Collapse file tree 1 file changed +25
-9
lines changed Original file line number Diff line number Diff line change @@ -24,21 +24,37 @@ dependencies {
2424 testImplementation(" io.opentelemetry:opentelemetry-api" )
2525}
2626
27+ abstract class ExtractJar : Copy () {
28+ @get:InputFiles
29+ abstract val jarFile: ConfigurableFileCollection
30+
31+ @get:Inject
32+ abstract val archiveOperations: ArchiveOperations
33+
34+ init {
35+ from(jarFile.elements.map { files -> files.map { archiveOperations.zipTree(it) } })
36+ }
37+ }
38+
2739tasks {
40+ val extractAgent by registering(ExtractJar ::class ) {
41+ jarFile.from(agent)
42+ into(layout.buildDirectory.dir(" extracted-agent" ))
43+ }
44+
2845 jar {
29- dependsOn(agent)
30- from(zipTree(agent.singleFile))
46+ from(extractAgent.map { it.outputs.files })
3147 from(extensionLibs) {
3248 into(" extensions" )
3349 }
3450
35- manifest.from(
36- providers.provider {
37- zipTree(agent.singleFile).matching {
38- include( " META-INF/MANIFEST.MF " )
39- }.singleFile
40- }
41- )
51+ val manifestFileProvider = extractAgent.flatMap { task ->
52+ layout.buildDirectory.file( " extracted-agent/META-INF/MANIFEST.MF " )
53+ }
54+
55+ doFirst {
56+ manifest.from(manifestFileProvider.get().asFile)
57+ }
4258 }
4359
4460 afterEvaluate {
You can’t perform that action at this time.
0 commit comments