Skip to content

Put utbot-instrumentation.jar into the gradle plugin jar #366

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

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions utbot-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ plugins {

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

configurations {
fetchInstrumentationJar
}

dependencies {
shadow gradleApi()
shadow localGroovy()

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

implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlin_logging_version
}
Expand All @@ -30,9 +35,22 @@ jar {
}
}

/**
* Shadow plugin unpacks the nested `utbot-instrumentation-<version>.jar`.
* But we need it to be packed. Workaround: double-nest the jar.
*/
task shadowBugWorkaround(type: Jar) {
destinationDir file('build/shadow-bug-workaround')
from(configurations.fetchInstrumentationJar) {
into "lib"
}
}

// Documentation: https://imperceptiblethoughts.com/shadow/
shadowJar {
archiveClassifier.set('')
minimize()
from shadowBugWorkaround
}

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