[*] Configure delombokked sources jars
This commit is contained in:
@@ -2,7 +2,9 @@ plugins {
|
||||
java
|
||||
`java-library`
|
||||
`maven-publish`
|
||||
alias(libs.plugins.lombok)
|
||||
id("de.siphalor.tweed5.local-runtime-only")
|
||||
id("de.siphalor.tweed5.expanded-sources-jar")
|
||||
}
|
||||
|
||||
group = rootProject.group
|
||||
@@ -23,12 +25,11 @@ val testAgentClasspath = configurations.resolvable("testAgentClasspath") {
|
||||
extendsFrom(testAgent.get())
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.lombok)
|
||||
annotationProcessor(libs.lombok)
|
||||
testCompileOnly(libs.lombok)
|
||||
testAnnotationProcessor(libs.lombok)
|
||||
lombok {
|
||||
version = libs.versions.lombok.get()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly(libs.autoservice.annotations)
|
||||
annotationProcessor(libs.autoservice.processor)
|
||||
testCompileOnly(libs.autoservice.annotations)
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
import io.freefair.gradle.plugins.lombok.tasks.Delombok
|
||||
|
||||
plugins {
|
||||
java
|
||||
`java-library`
|
||||
alias(libs.plugins.lombok)
|
||||
}
|
||||
|
||||
val expandedSourcesElements = configurations.consumable("expandedSourcesElements") {
|
||||
attributes {
|
||||
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
|
||||
}
|
||||
}
|
||||
|
||||
val delombok = tasks.getByName<Delombok>("delombok")
|
||||
|
||||
val sourcesJarTask by tasks.registering(Jar::class) {
|
||||
dependsOn(delombok)
|
||||
from(delombok.target)
|
||||
archiveClassifier.set("sources")
|
||||
}
|
||||
artifacts.add(expandedSourcesElements.name, sourcesJarTask)
|
||||
|
||||
tasks.named("build") { dependsOn(sourcesJarTask) }
|
||||
|
||||
components.named<AdhocComponentWithVariants>("java") {
|
||||
addVariantsFromConfiguration(expandedSourcesElements.get()) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user