Last active
March 24, 2025 01:31
-
-
Save wreulicke/3746ae81569ba06271ab95582b358a64 to your computer and use it in GitHub Desktop.
依存をrelocateするやつ + relocateしたやつでテストするやつ
This file contains hidden or 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
tasks.named('shadowJar').configure { | |
dependsOn tasks.named('classes') | |
from sourceSets.main.runtimeClasspath.find { it.name.startsWith('hogehoge') } | |
archiveBaseName.set("hogehoge") | |
archiveClassifier.set("relocated") | |
relocate 'some.package', 'relocated.some.package' | |
dependencies { | |
exclude({ true }) | |
} | |
} | |
tasks.named('test') { | |
dependsOn tasks.named('shadowJar') | |
def filteredClasspath = sourceSets.test.runtimeClasspath.filter { | |
!it.name.startsWith('hoge') | |
} | |
classpath = filteredClasspath + tasks.named('shadowJar').get().outputs.files | |
// Use JUnit Platform for unit tests. | |
useJUnitPlatform() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment