Skip to content

Commit 660050a

Browse files
Fix published dependencies (#37)
Co-authored-by: Matyrobbrt <65940752+Matyrobbrt@users.noreply.github.com>
1 parent 5c322ce commit 660050a

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

cli/build.gradle

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,18 @@ java {
2222
}
2323

2424
configurations {
25-
shadow
26-
shadow.extendsFrom(implementation)
25+
include
26+
include.extendsFrom(implementation)
2727
}
2828

2929
dependencies {
3030
implementation project(":api")
3131
implementation "info.picocli:picocli:$picocli_version"
3232
implementation 'org.slf4j:slf4j-simple:2.0.13'
3333

34-
shadow project(":parchment")
35-
shadow project(":accesstransformers")
36-
shadow project(':interfaceinjection')
34+
include project(":parchment")
35+
include project(":accesstransformers")
36+
include project(':interfaceinjection')
3737

3838
testImplementation platform("org.junit:junit-bom:$junit_version")
3939
testImplementation 'org.junit.jupiter:junit-jupiter'
@@ -45,7 +45,7 @@ test {
4545
}
4646

4747
shadowJar {
48-
configurations = [project.configurations.shadow]
48+
configurations = [project.configurations.include]
4949
mergeServiceFiles()
5050
}
5151

@@ -58,6 +58,24 @@ components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElemen
5858
skip()
5959
}
6060

61+
abstract class ComponentMaker {
62+
@Inject
63+
abstract SoftwareComponentFactory getFactory()
64+
}
65+
66+
final componentFactory = objects.newInstance(ComponentMaker).factory
67+
68+
final shadowComponent = componentFactory.adhoc("shadow")
69+
project.components.add(shadowComponent)
70+
71+
tasks.named('shadowJar', Jar) {
72+
archiveClassifier = ''
73+
archiveBaseName ='jst-cli-bundle'
74+
}
75+
76+
shadowComponent.addVariantsFromConfiguration(configurations.shadowRuntimeElements) {
77+
it.mapToMavenScope("runtime")
78+
}
6179
tasks.register('sourcesBundleJar', Jar) {
6280
it.archiveClassifier = 'sources'
6381
it.archiveBaseName = 'jst-cli-bundle'
@@ -86,7 +104,7 @@ publishing {
86104
create('bundle', MavenPublication) {
87105
artifactId = 'jst-cli-bundle'
88106

89-
project.shadow.component(bundle)
107+
from components.shadow
90108
artifact(tasks.sourcesBundleJar)
91109
artifact(tasks.javadocBundleJar)
92110

0 commit comments

Comments
 (0)