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:
committed by
Space Team
parent
ad8909113d
commit
46d113605b
+1
-1
@@ -416,7 +416,7 @@ class KotlinGradleIT : KGPBaseTest() {
|
||||
buildGradle.appendText(
|
||||
"""
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
tasks.register("sourcesJar", Jar) {
|
||||
from sourceSets.main.allSource
|
||||
archiveClassifier = 'source'
|
||||
duplicatesStrategy = 'fail' // fail in case of Java source duplication, see KT-17564
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ class MultiplatformGradleIT : BaseGradleIT() {
|
||||
gradleBuildScript("libJvm").appendText(
|
||||
"""
|
||||
${'\n'}
|
||||
task printCompileConfiguration(type: DefaultTask) {
|
||||
tasks.register("printCompileConfiguration", DefaultTask) {
|
||||
doFirst {
|
||||
configurations.getByName("api").dependencies.each {
|
||||
println("Dependency: '" + it.name + "'")
|
||||
|
||||
+2
-1
@@ -21,7 +21,8 @@ configurations {
|
||||
}
|
||||
}
|
||||
|
||||
task obfuscate(type: proguard.gradle.ProGuardTask, dependsOn: jar) {
|
||||
tasks.register("obfuscate", proguard.gradle.ProGuardTask) {
|
||||
dependsOn(jar)
|
||||
injars "${jar.archivePath}"
|
||||
outjars "$buildDir/proguard/out.jar"
|
||||
|
||||
|
||||
+1
-1
@@ -5,6 +5,6 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
+1
-1
@@ -5,6 +5,6 @@ subprojects {
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
+1
-1
@@ -33,7 +33,7 @@ dependencies {
|
||||
implementation "org.mozilla:rhino:1.7.7.1"
|
||||
}
|
||||
|
||||
task runRhino(type: JavaExec) {
|
||||
tasks.register("runRhino", JavaExec) {
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
workingDir = "${buildDir}/kotlin2js/main/"
|
||||
mainClass = 'org.mozilla.javascript.tools.shell.Main'
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ dependencies {
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
|
||||
}
|
||||
|
||||
task jarSources(type: Jar) {
|
||||
tasks.register("jarSources", Jar) {
|
||||
from sourceSets.main.allSource
|
||||
archiveClassifier = 'source'
|
||||
}
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ dependencies {
|
||||
testImplementation"org.jetbrains.kotlin:kotlin-test-js:$kotlin_version"
|
||||
}
|
||||
|
||||
task jarSources(type: Jar) {
|
||||
tasks.register("jarSources", Jar) {
|
||||
from sourceSets.main.allSource
|
||||
archiveClassifier = 'source'
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,6 +26,6 @@ subprojects { project ->
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
+1
-1
@@ -23,6 +23,6 @@ allprojects {
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
tasks.register("clean", Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinJsCompile) {
|
||||
kotlinOptions.freeCompilerArgs += "-Xforce-deprecated-legacy-compiler-usage"
|
||||
}
|
||||
|
||||
task runRhino(type: JavaExec) {
|
||||
tasks.register("runRhino", JavaExec) {
|
||||
dependsOn(tasks.named('processDceBrowserKotlinJs'))
|
||||
classpath = kotlin.targets.browser.compilations.main.runtimeDependencyFiles
|
||||
workingDir = "${buildDir}"
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ kotlin {
|
||||
}
|
||||
}
|
||||
|
||||
task resolveRuntimeDependencies(type: DefaultTask) {
|
||||
tasks.register("resolveRuntimeDependencies", DefaultTask) {
|
||||
doFirst {
|
||||
// KT-26301
|
||||
def configName = kotlin.targets.jvm6.compilations.main.runtimeDependencyConfigurationName
|
||||
|
||||
@@ -15,13 +15,14 @@ final File antHome = new File(buildDir, "ant-home")
|
||||
final File antZip = new File(buildDir, "apache-ant-$antVersion-bin.zip")
|
||||
final File antExe = new File(antHome, "apache-ant-$antVersion/bin/ant$ext")
|
||||
|
||||
task downloadAnt(type: Download) {
|
||||
tasks.register("downloadAnt", Download) {
|
||||
src antURL
|
||||
dest antZip
|
||||
overwrite false
|
||||
}
|
||||
|
||||
task extractAnt(type: Sync, dependsOn: downloadAnt) {
|
||||
tasks.register("extractAnt", Sync) {
|
||||
dependsOn(downloadAnt)
|
||||
from zipTree(antZip)
|
||||
into antHome
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ dependencies {
|
||||
}
|
||||
|
||||
final File dokkaHome = new File(buildDir, "dokka-home")
|
||||
task setupDokka(type: Sync) {
|
||||
tasks.register("setupDokka", Sync) {
|
||||
from configurations.dokka
|
||||
into dokkaHome
|
||||
}
|
||||
@@ -41,7 +41,8 @@ task setupCallDokka() {
|
||||
dependsOn project('kotlin_big').tasks.getByName('extractLibs')
|
||||
}
|
||||
|
||||
task callDokka(type: Exec, dependsOn: setupCallDokka) {
|
||||
tasks.register("callDokka", Exec) {
|
||||
dependsOn(setupCallDokka)
|
||||
workingDir = projectDir
|
||||
// -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
|
||||
environment("ANT_OPTS", "-Xmx3G")
|
||||
|
||||
@@ -18,7 +18,7 @@ compileKotlin {
|
||||
}
|
||||
}
|
||||
|
||||
task copyCopyrightProfile(type: Copy) {
|
||||
tasks.register("copyCopyrightProfile", Copy) {
|
||||
from "$rootDir/.idea/copyright"
|
||||
into "$buildDir/copyright"
|
||||
include 'apache.xml'
|
||||
@@ -28,7 +28,7 @@ processResources {
|
||||
dependsOn(copyCopyrightProfile)
|
||||
}
|
||||
|
||||
task run(type: JavaExec) {
|
||||
tasks.register("run", JavaExec) {
|
||||
group 'application'
|
||||
mainClass = 'generators.GenerateStandardLibKt'
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
@@ -36,7 +36,7 @@ task run(type: JavaExec) {
|
||||
systemProperty 'line.separator', '\n'
|
||||
}
|
||||
|
||||
task generateStdlibTests(type: JavaExec) {
|
||||
tasks.register("generateStdlibTests", JavaExec) {
|
||||
group 'application'
|
||||
mainClass = 'generators.GenerateStandardLibTestsKt'
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
@@ -44,7 +44,7 @@ task generateStdlibTests(type: JavaExec) {
|
||||
systemProperty 'line.separator', '\n'
|
||||
}
|
||||
|
||||
task generateUnicodeData(type: JavaExec) {
|
||||
tasks.register("generateUnicodeData", JavaExec) {
|
||||
group 'application'
|
||||
mainClass = 'generators.unicode.GenerateUnicodeDataKt'
|
||||
classpath sourceSets.main.runtimeClasspath
|
||||
|
||||
Reference in New Issue
Block a user