Adopt configuration-avoidance where possible

Before this change `./gradlew help` (with native enabled)
Created immediately: 1322
Created during configuration: 1541

after this change:
Created immediately: 596
Created during configuration: 1509

To know more about configuration avoidance: https://docs.gradle.org/current/userguide/task_configuration_avoidance.html
This commit is contained in:
cristiangarcia
2023-06-06 14:27:42 +00:00
committed by Space Team
parent ad8909113d
commit 46d113605b
33 changed files with 623 additions and 609 deletions
+6 -3
View File
@@ -44,14 +44,16 @@ jar {
enabled false
}
task libraryJarWithoutIr(type: Jar, dependsOn: compileKotlin2Js) {
tasks.register("libraryJarWithoutIr", Jar) {
dependsOn(compileKotlin2Js)
archiveClassifier.set(null)
destinationDirectory = file("$buildDir/lib/dist")
from("$buildDir/classes/main")
manifestAttributes(manifest, project, 'Test')
}
task libraryJarWithIr(type: Zip, dependsOn: libraryJarWithoutIr) {
tasks.register("libraryJarWithIr", Zip) {
dependsOn(libraryJarWithoutIr)
archiveExtension = "jar"
destinationDirectory = file("$buildDir/libs")
@@ -69,7 +71,8 @@ task libraryJarWithIr(type: Zip, dependsOn: libraryJarWithoutIr) {
jar.dependsOn(libraryJarWithIr)
task sourcesJar(type: Jar, dependsOn: classes) {
tasks.register("sourcesJar", Jar) {
dependsOn(classes)
archiveClassifier.set('sources')
from (sourceSets.main.allSource)
}