[*] Configure delombokked sources jars
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("dev.panuszewski.typesafe-conventions") version "0.4.1"
|
||||
id("dev.panuszewski.typesafe-conventions") version "0.6.0"
|
||||
}
|
||||
|
||||
rootProject.name = "tweed5-conventions"
|
||||
@@ -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()) {}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,9 @@ lombok = "1.18.34"
|
||||
mockito = "5.14.2"
|
||||
slf4j = "2.0.16"
|
||||
|
||||
[plugins]
|
||||
lombok = { id = "io.freefair.lombok", version = "8.13.1" }
|
||||
|
||||
[libraries]
|
||||
assertj = { group = "org.assertj", name = "assertj-core", version.ref = "assertj" }
|
||||
asm-commons = { group = "org.ow2.asm", name = "asm-commons", version.ref = "asm" }
|
||||
@@ -19,7 +22,6 @@ jetbrains-annotations = { group = "org.jetbrains", name = "annotations", version
|
||||
junit-platform = { group = "org.junit", name = "junit-bom", version.ref = "junit" }
|
||||
junit-core = { group = "org.junit.jupiter", name = "junit-jupiter" }
|
||||
junit-launcher = { group = "org.junit.platform", name = "junit-platform-launcher" }
|
||||
lombok = { group = "org.projectlombok", name = "lombok", version.ref = "lombok" }
|
||||
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
|
||||
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
|
||||
slf4j-rt = { group = "org.slf4j", name = "slf4j-simple", version.ref = "slf4j" }
|
||||
|
||||
Reference in New Issue
Block a user