Skip to content

Commit b737f40

Browse files
authored
Put utbot-instrumentation.jar into the gradle plugin jar (#366)
1 parent 10457f0 commit b737f40

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

utbot-gradle/build.gradle

+18
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,16 @@ plugins {
66

77
apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle"
88

9+
configurations {
10+
fetchInstrumentationJar
11+
}
12+
913
dependencies {
1014
shadow gradleApi()
1115
shadow localGroovy()
1216

1317
implementation project(":utbot-framework")
18+
fetchInstrumentationJar project(path: ':utbot-instrumentation', configuration: 'instrumentationArchive')
1419

1520
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlin_logging_version
1621
}
@@ -30,9 +35,22 @@ jar {
3035
}
3136
}
3237

38+
/**
39+
* Shadow plugin unpacks the nested `utbot-instrumentation-<version>.jar`.
40+
* But we need it to be packed. Workaround: double-nest the jar.
41+
*/
42+
task shadowBugWorkaround(type: Jar) {
43+
destinationDir file('build/shadow-bug-workaround')
44+
from(configurations.fetchInstrumentationJar) {
45+
into "lib"
46+
}
47+
}
48+
49+
// Documentation: https://imperceptiblethoughts.com/shadow/
3350
shadowJar {
3451
archiveClassifier.set('')
3552
minimize()
53+
from shadowBugWorkaround
3654
}
3755

3856
// no module metadata => no dependency on the `utbot-framework`

0 commit comments

Comments
 (0)