From 2f32d37840a9bddcadf89624936cb8364804973a Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Fri, 3 Apr 2020 18:17:44 +0700 Subject: [PATCH] Drop useless :commonDistRuntime Gradle task Reasons: 1. This task does not depend on anything. So, Gradle typically runs it somewhere in the very beginning of the build when the artifacts that this task is supposed to copy are not yet built. 2. This task is always used in conjunction with ":${target}CrossDistRuntime", which has all the necessary dependencies and does everything what :commonDistRuntime is supposed to do plus some additional work. --- backend.native/tests/build.gradle | 14 +++++++------- .../kotlin/org/jetbrains/kotlin/CacheTesting.kt | 1 - .../kotlin/org/jetbrains/kotlin/FrameworkTest.kt | 2 +- build.gradle | 14 +------------- 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index 67dda46e935..7e300e1570a 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -3899,7 +3899,7 @@ if (isAppleTarget(project)) { baseDir dir if (!useCustomDist) { - dependsOn ":${target.name}CrossDistRuntime", ':commonDistRuntime', ':distCompiler' + dependsOn ":${target.name}CrossDistRuntime", ':distCompiler' } extraOpts "-Xembed-bitcode-marker" @@ -3929,7 +3929,7 @@ if (isAppleTarget(project)) { baseDir dir if (!useCustomDist) { - dependsOn ":${target.name}CrossDistRuntime", ':commonDistRuntime', ':distCompiler' + dependsOn ":${target.name}CrossDistRuntime", ':distCompiler' } extraOpts "-Xembed-bitcode-marker" @@ -3955,7 +3955,7 @@ if (isAppleTarget(project)) { baseDir "$testOutputFramework/$testName" if (!useCustomDist) { - dependsOn ":${target}CrossDistRuntime", ':commonDistRuntime', ':distCompiler' + dependsOn ":${target}CrossDistRuntime", ':distCompiler' } extraOpts "-Xembed-bitcode-marker" @@ -3976,7 +3976,7 @@ if (isAppleTarget(project)) { baseDir "$testOutputFramework/$testName" if (!useCustomDist) { - dependsOn ":${target.name}CrossDistRuntime", ':commonDistRuntime', ':distCompiler' + dependsOn ":${target.name}CrossDistRuntime", ':distCompiler' } extraOpts "-Xembed-bitcode" @@ -4003,7 +4003,7 @@ if (isAppleTarget(project)) { baseDir dir if (!useCustomDist) { - dependsOn ":${target.name}CrossDistRuntime", ':commonDistRuntime', ':distCompiler' + dependsOn ":${target.name}CrossDistRuntime", ':distCompiler' } extraOpts "-Xembed-bitcode" @@ -4016,7 +4016,7 @@ if (isAppleTarget(project)) { baseDir dir if (!useCustomDist) { - dependsOn ":${target.name}CrossDistRuntime", ':commonDistRuntime', ':distCompiler' + dependsOn ":${target.name}CrossDistRuntime", ':distCompiler' } extraOpts "-Xembed-bitcode" @@ -4045,7 +4045,7 @@ if (isAppleTarget(project)) { baseDir "$testOutputFramework/$testName" if (!useCustomDist) { - dependsOn ":${target}CrossDistRuntime", ':commonDistRuntime', ':distCompiler' + dependsOn ":${target}CrossDistRuntime", ':distCompiler' } linkerOpts "-L$buildDir" diff --git a/build-tools/src/main/kotlin/org/jetbrains/kotlin/CacheTesting.kt b/build-tools/src/main/kotlin/org/jetbrains/kotlin/CacheTesting.kt index 1fe7487e71e..ecf62e3fe6c 100644 --- a/build-tools/src/main/kotlin/org/jetbrains/kotlin/CacheTesting.kt +++ b/build-tools/src/main/kotlin/org/jetbrains/kotlin/CacheTesting.kt @@ -39,7 +39,6 @@ fun configureCacheTesting(project: Project): CacheTesting? { val tasks = listOf( "${target}CrossDist", "${target}CrossDistRuntime", - "commonDistRuntime", "distCompiler" ).map { task -> project.rootProject.tasks.getByName(task) } diff --git a/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt b/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt index fff23fd5fda..f06a012c1bd 100644 --- a/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt +++ b/build-tools/src/main/kotlin/org/jetbrains/kotlin/FrameworkTest.kt @@ -59,7 +59,7 @@ open class FrameworkTest : DefaultTask(), KonanTestExecutable { // set crossdist build dependency if custom konan.home wasn't set if (!(project.property("useCustomDist") as Boolean)) { - setRootDependency("${target}CrossDist", "${target}CrossDistRuntime", "commonDistRuntime", "distCompiler") + setRootDependency("${target}CrossDist", "${target}CrossDistRuntime", "distCompiler") } check(::testName.isInitialized) { "Test name should be set" } check(::frameworkNames.isInitialized) { "Framework names should be set" } diff --git a/build.gradle b/build.gradle index 737f7d00734..7f2728d36fd 100644 --- a/build.gradle +++ b/build.gradle @@ -412,7 +412,6 @@ task listDist(type: Exec) { task distRuntime(type: Copy) { dependsOn "${hostName}CrossDistRuntime" - dependsOn('commonDistRuntime') } task distEndorsedLibraries { @@ -436,19 +435,8 @@ def stdlibDefaultComponent = "$stdlib/default" def endorsedLibs = 'klib/common/endorsedLibraries' def endorsedLibsBase = 'klib/common' -task commonDistRuntime(type: Copy) { - destinationDir distDir - - // Target independant common part. - from(project(':runtime').file("build/${hostName}Stdlib")) { - include('**') - into(stdlib) - } -} - task crossDistRuntime(type: Copy) { dependsOn.addAll(targetList.collect { "${it}CrossDistRuntime" }) - dependsOn('commonDistRuntime') } task crossDistEndorsedLibraries(type: Copy) { @@ -514,7 +502,7 @@ targetList.each { target -> } task("${target}CrossDist") { - dependsOn "${target}CrossDistRuntime", "distCompiler", "commonDistRuntime", "${target}CrossDistEndorsedLibraries" + dependsOn "${target}CrossDistRuntime", "distCompiler", "${target}CrossDistEndorsedLibraries" if (target in cacheableTargetNames) { dependsOn "${target}StdlibCache", "${target}EndorsedCache" }