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.
This commit is contained in:
Dmitriy Dolovov
2020-04-03 18:17:44 +07:00
committed by Dmitriy Dolovov
parent f8073eaded
commit 2f32d37840
4 changed files with 9 additions and 22 deletions
+7 -7
View File
@@ -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"
@@ -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) }
@@ -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" }
+1 -13
View File
@@ -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"
}