Skip to content
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

Fix published dependencies #37

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Changes from 1 commit
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
34 changes: 27 additions & 7 deletions cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ java {
}

configurations {
shadow
shadow.extendsFrom(implementation)
include
include.extendsFrom(implementation)
}

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

shadow project(":parchment")
shadow project(":accesstransformers")
shadow project(':interfaceinjection')
include project(":parchment")
include project(":accesstransformers")
include project(':interfaceinjection')

testImplementation platform("org.junit:junit-bom:$junit_version")
testImplementation 'org.junit.jupiter:junit-jupiter'
Expand All @@ -45,7 +45,7 @@ test {
}

shadowJar {
configurations = [project.configurations.shadow]
configurations = [project.configurations.include]
mergeServiceFiles()
}

Expand All @@ -58,6 +58,26 @@ components.java.withVariantsFromConfiguration(configurations.shadowRuntimeElemen
skip()
}

abstract class ComponentMaker {
@Inject
abstract SoftwareComponentFactory getFactory();
}

def componentFactory = objects.newInstance(ComponentMaker).factory

def shadowComponent = componentFactory.adhoc("shadow")
project.components.add(shadowComponent)

tasks.named('shadowJar', Jar) {
archiveClassifier = ''
archiveBaseName ='jst-cli-bundle'
}

shadowComponent.addVariantsFromConfiguration(configurations.shadowRuntimeElements) {
it.mapToMavenScope("runtime")
}


Matyrobbrt marked this conversation as resolved.
Show resolved Hide resolved
tasks.register('sourcesBundleJar', Jar) {
it.archiveClassifier = 'sources'
it.archiveBaseName = 'jst-cli-bundle'
Expand Down Expand Up @@ -86,7 +106,7 @@ publishing {
create('bundle', MavenPublication) {
artifactId = 'jst-cli-bundle'

project.shadow.component(bundle)
from components.shadow
artifact(tasks.sourcesBundleJar)
artifact(tasks.javadocBundleJar)

Expand Down
Loading