mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2025-12-06 14:00:55 +03:00
Gradle: use configuration cache
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import org.gradle.kotlin.dsl.support.serviceOf
|
||||
|
||||
plugins {
|
||||
`cpp-library`
|
||||
}
|
||||
@@ -37,9 +39,14 @@ tasks {
|
||||
doFirst {
|
||||
println( "Used Tool Chain:" )
|
||||
println( " - ${toolChain.get()}" )
|
||||
println( "Available Tool Chains:" )
|
||||
toolChains.forEach {
|
||||
println( " - $it" )
|
||||
}
|
||||
|
||||
if( !project.gradle.serviceOf<BuildFeatures>().configurationCache.active.get() ) {
|
||||
doFirst {
|
||||
println( "Available Tool Chains:" )
|
||||
toolChains.forEach {
|
||||
println( " - $it" )
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,10 +45,11 @@ if( !exclude ) {
|
||||
setSrcDirs( listOf( "src/main/module-info", "src/main/java", "src/main/java9" ) )
|
||||
|
||||
// exclude Java 8 source file if an equally named Java 9+ source file exists
|
||||
val projectDir = projectDir // necessary for configuration cache
|
||||
exclude {
|
||||
if( it.isDirectory )
|
||||
return@exclude false
|
||||
val java9file = file( "${projectDir}/src/main/java9/${it.path}" )
|
||||
val java9file = File( "${projectDir}/src/main/java9/${it.path}" )
|
||||
java9file.exists() && java9file != it.file
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,27 +85,6 @@ publishing {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
repositories {
|
||||
maven {
|
||||
name = "MavenCentral"
|
||||
|
||||
val releasesRepoUrl = "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/"
|
||||
val snapshotsRepoUrl = "https://central.sonatype.com/repository/maven-snapshots/"
|
||||
url = uri( if( rootProject.hasProperty( "release" ) ) releasesRepoUrl else snapshotsRepoUrl )
|
||||
|
||||
credentials {
|
||||
// get from gradle.properties
|
||||
val sonatypeUsername: String? by project
|
||||
val sonatypePassword: String? by project
|
||||
|
||||
username = System.getenv( "SONATYPE_USERNAME" ) ?: sonatypeUsername
|
||||
password = System.getenv( "SONATYPE_PASSWORD" ) ?: sonatypePassword
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
signing {
|
||||
@@ -125,10 +104,22 @@ tasks.withType<Sign>().configureEach {
|
||||
onlyIf { rootProject.hasProperty( "release" ) }
|
||||
}
|
||||
|
||||
// check whether parallel build is enabled
|
||||
tasks.withType<AbstractPublishToMaven>().configureEach {
|
||||
doFirst {
|
||||
if( System.getProperty( "org.gradle.parallel" ) == "true" )
|
||||
throw RuntimeException( "Publishing does not work correctly with enabled parallel build. Disable parallel build with VM option '-Dorg.gradle.parallel=false'." )
|
||||
tasks {
|
||||
// check whether parallel build is enabled
|
||||
withType<AbstractPublishToMaven>().configureEach {
|
||||
doFirst {
|
||||
if( System.getProperty( "org.gradle.parallel" ) == "true" )
|
||||
throw RuntimeException( "Publishing does not work correctly with enabled parallel build. Disable parallel build with VM option '-Dorg.gradle.parallel=false'." )
|
||||
}
|
||||
}
|
||||
|
||||
register( "publishToSonatypeAndCloseStagingRepo" ) {
|
||||
group = "publishing"
|
||||
description = "Publish to Sonatype Maven Central and close staging repository"
|
||||
|
||||
dependsOn(
|
||||
"publishToSonatype",
|
||||
":closeSonatypeStagingRepository"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user