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
@@ -193,7 +193,7 @@ def getMingwPath() {
|
||||
return directory
|
||||
}
|
||||
|
||||
task assembleWeb(type: Sync) {
|
||||
tasks.register("assembleWeb", Sync) {
|
||||
def runtimeDependencies = kotlin.targets.js.compilations.main.runtimeDependencyFiles
|
||||
from(files {
|
||||
runtimeDependencies.collect { File file ->
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ class PathSpecification extends BaseKonanSpecification {
|
||||
dynamic('dynamic')
|
||||
}
|
||||
|
||||
task checkArtifacts(type: DefaultTask) {
|
||||
tasks.register("checkArtifacts", DefaultTask) {
|
||||
dependsOn(':build')
|
||||
doLast {
|
||||
for(artifact in konanArtifacts) {
|
||||
|
||||
+4
-4
@@ -29,8 +29,8 @@ class TaskSpecification extends BaseKonanSpecification {
|
||||
when:
|
||||
def project = KonanProject.createWithInterop(projectDirectory, ArtifactType.LIBRARY)
|
||||
project.buildFile.append("""
|
||||
task beforeInterop(type: DefaultTask) { doLast { println("Before Interop") } }
|
||||
task beforeCompilation(type: DefaultTask) { doLast { println("Before compilation") } }
|
||||
tasks.register("beforeInterop", DefaultTask) { doLast { println("Before Interop") } }
|
||||
tasks.register("beforeCompilation", DefaultTask) { doLast { println("Before compilation") } }
|
||||
""".stripIndent())
|
||||
project.addSetting(KonanProject.DEFAULT_INTEROP_NAME,"dependsOn", "beforeInterop")
|
||||
project.addSetting("dependsOn", "beforeCompilation")
|
||||
@@ -147,7 +147,7 @@ class TaskSpecification extends BaseKonanSpecification {
|
||||
|
||||
BuildResult failOnPropertyAccess(KonanProject project, String property) {
|
||||
project.buildFile.append("""
|
||||
task testTask(type: DefaultTask) {
|
||||
tasks.register("testTask", DefaultTask) {
|
||||
doLast {
|
||||
println(${project.defaultInteropConfig()}.$property)
|
||||
}
|
||||
@@ -158,7 +158,7 @@ class TaskSpecification extends BaseKonanSpecification {
|
||||
|
||||
BuildResult failOnTaskAccess(KonanProject project, String task) {
|
||||
project.buildFile.append("""
|
||||
task testTask(type: DefaultTask) {
|
||||
tasks.register("testTask", DefaultTask) {
|
||||
dependsOn $task
|
||||
}
|
||||
""".stripIndent())
|
||||
|
||||
Reference in New Issue
Block a user