build.gradle.kts: use withSourcesJar() and withJavadocJar()

this adds resources to sources.jar
This commit is contained in:
Karl Tauber
2020-05-09 01:28:05 +02:00
parent 9efab8b892
commit d79a31cc79
5 changed files with 27 additions and 106 deletions

View File

@@ -38,14 +38,12 @@ if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
} }
} }
tasks { java {
assemble { withSourcesJar()
dependsOn( withJavadocJar()
"sourcesJar", }
"javadocJar"
)
}
tasks {
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) { if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
named<JavaCompile>( "compileModuleInfoJava" ) { named<JavaCompile>( "compileModuleInfoJava" ) {
sourceCompatibility = "9" sourceCompatibility = "9"
@@ -82,18 +80,12 @@ tasks {
isFailOnError = false isFailOnError = false
} }
register( "sourcesJar", Jar::class ) { named<Jar>("sourcesJar" ) {
archiveBaseName.set( "flatlaf" ) archiveBaseName.set( "flatlaf" )
archiveClassifier.set( "sources" )
from( sourceSets.main.get().allJava )
} }
register( "javadocJar", Jar::class ) { named<Jar>("javadocJar" ) {
archiveBaseName.set( "flatlaf" ) archiveBaseName.set( "flatlaf" )
archiveClassifier.set( "javadoc" )
from( javadoc )
} }
} }
@@ -105,9 +97,6 @@ publishing {
from( components["java"] ) from( components["java"] )
artifact( tasks["sourcesJar"] )
artifact( tasks["javadocJar"] )
pom { pom {
name.set( "FlatLaf" ) name.set( "FlatLaf" )
description.set( "Flat Look and Feel" ) description.set( "Flat Look and Feel" )

View File

@@ -26,14 +26,12 @@ dependencies {
implementation( "com.formdev:svgSalamander:1.1.2.1" ) implementation( "com.formdev:svgSalamander:1.1.2.1" )
} }
tasks { java {
assemble { withSourcesJar()
dependsOn( withJavadocJar()
"sourcesJar", }
"javadocJar"
)
}
tasks {
javadoc { javadoc {
options { options {
this as StandardJavadocDocletOptions this as StandardJavadocDocletOptions
@@ -41,18 +39,6 @@ tasks {
} }
isFailOnError = false isFailOnError = false
} }
register( "sourcesJar", Jar::class ) {
archiveClassifier.set( "sources" )
from( sourceSets.main.get().allJava )
}
register( "javadocJar", Jar::class ) {
archiveClassifier.set( "javadoc" )
from( javadoc )
}
} }
publishing { publishing {
@@ -63,9 +49,6 @@ publishing {
from( components["java"] ) from( components["java"] )
artifact( tasks["sourcesJar"] )
artifact( tasks["javadocJar"] )
pom { pom {
name.set( "FlatLaf Extras" ) name.set( "FlatLaf Extras" )
description.set( "Flat Look and Feel Extras" ) description.set( "Flat Look and Feel Extras" )

View File

@@ -37,14 +37,12 @@ if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
} }
} }
tasks { java {
assemble { withSourcesJar()
dependsOn( withJavadocJar()
"sourcesJar", }
"javadocJar"
)
}
tasks {
if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) { if( JavaVersion.current() >= JavaVersion.VERSION_1_9 ) {
named<JavaCompile>( "compileModuleInfoJava" ) { named<JavaCompile>( "compileModuleInfoJava" ) {
sourceCompatibility = "9" sourceCompatibility = "9"
@@ -72,18 +70,6 @@ tasks {
} }
isFailOnError = false isFailOnError = false
} }
register( "sourcesJar", Jar::class ) {
archiveClassifier.set( "sources" )
from( sourceSets.main.get().allJava )
}
register( "javadocJar", Jar::class ) {
archiveClassifier.set( "javadoc" )
from( javadoc )
}
} }
publishing { publishing {
@@ -94,9 +80,6 @@ publishing {
from( components["java"] ) from( components["java"] )
artifact( tasks["sourcesJar"] )
artifact( tasks["javadocJar"] )
pom { pom {
name.set( "FlatLaf IntelliJ Themes Pack" ) name.set( "FlatLaf IntelliJ Themes Pack" )
description.set( "Flat Look and Feel IntelliJ Themes Pack" ) description.set( "Flat Look and Feel IntelliJ Themes Pack" )

View File

@@ -26,14 +26,12 @@ dependencies {
implementation( "com.jidesoft:jide-oss:3.6.18" ) implementation( "com.jidesoft:jide-oss:3.6.18" )
} }
tasks { java {
assemble { withSourcesJar()
dependsOn( withJavadocJar()
"sourcesJar", }
"javadocJar"
)
}
tasks {
javadoc { javadoc {
options { options {
this as StandardJavadocDocletOptions this as StandardJavadocDocletOptions
@@ -41,18 +39,6 @@ tasks {
} }
isFailOnError = false isFailOnError = false
} }
register( "sourcesJar", Jar::class ) {
archiveClassifier.set( "sources" )
from( sourceSets.main.get().allJava )
}
register( "javadocJar", Jar::class ) {
archiveClassifier.set( "javadoc" )
from( javadoc )
}
} }
publishing { publishing {
@@ -63,9 +49,6 @@ publishing {
from( components["java"] ) from( components["java"] )
artifact( tasks["sourcesJar"] )
artifact( tasks["javadocJar"] )
pom { pom {
name.set( "FlatLaf addon for JIDE Common Layer" ) name.set( "FlatLaf addon for JIDE Common Layer" )
description.set( "Flat Look and Feel addon for JIDE Common Layer" ) description.set( "Flat Look and Feel addon for JIDE Common Layer" )

View File

@@ -26,14 +26,12 @@ dependencies {
implementation( "org.swinglabs.swingx:swingx-all:1.6.5-1" ) implementation( "org.swinglabs.swingx:swingx-all:1.6.5-1" )
} }
tasks { java {
assemble { withSourcesJar()
dependsOn( withJavadocJar()
"sourcesJar", }
"javadocJar"
)
}
tasks {
javadoc { javadoc {
options { options {
this as StandardJavadocDocletOptions this as StandardJavadocDocletOptions
@@ -41,18 +39,6 @@ tasks {
} }
isFailOnError = false isFailOnError = false
} }
register( "sourcesJar", Jar::class ) {
archiveClassifier.set( "sources" )
from( sourceSets.main.get().allJava )
}
register( "javadocJar", Jar::class ) {
archiveClassifier.set( "javadoc" )
from( javadoc )
}
} }
publishing { publishing {
@@ -63,9 +49,6 @@ publishing {
from( components["java"] ) from( components["java"] )
artifact( tasks["sourcesJar"] )
artifact( tasks["javadocJar"] )
pom { pom {
name.set( "FlatLaf addon for SwingX" ) name.set( "FlatLaf addon for SwingX" )
description.set( "Flat Look and Feel addon for SwingX" ) description.set( "Flat Look and Feel addon for SwingX" )