[K/N][build] Cleanup obsolete build tasks

* Remove obsolete reporting
* Remove old build tasks: BuildPusher and CollisionDetector
* Gradle build file cleanup
* Remove old wrappers

Merge-request: KT-MR-8788
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
(cherry picked from commit a9cae3fe87)
This commit is contained in:
Pavel Punegov
2023-02-13 14:02:28 +00:00
committed by Space Team
parent 0e767a7020
commit cc258934c4
15 changed files with 24 additions and 598 deletions
@@ -1,17 +1,6 @@
/*
* Copyright 2010-2018 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.gradle.plugin.experimental.internal
@@ -355,7 +355,6 @@ class KonanPlugin @Inject constructor(private val registry: ToolingModelBuilderR
project.plugins.apply("base")
project.plugins.apply("java")
// Create necessary tasks and extensions.
project.tasks.create(KONAN_DOWNLOAD_TASK_NAME, KonanCompilerDownloadTask::class.java)
project.extensions.create(KONAN_EXTENSION_NAME, KonanExtension::class.java)
val container = project.extensions.create(
KonanArtifactContainer::class.java,
@@ -1,77 +0,0 @@
/*
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.gradle.plugin.tasks
import org.gradle.api.DefaultTask
import org.gradle.api.GradleScriptException
import org.gradle.api.tasks.Internal
import org.gradle.api.tasks.TaskAction
import org.jetbrains.kotlin.gradle.plugin.konan.*
import org.jetbrains.kotlin.konan.MetaVersion
import org.jetbrains.kotlin.konan.util.DependencyProcessor
import org.jetbrains.kotlin.konan.util.DependencySource
import java.io.IOException
import org.jetbrains.kotlin.*
open class KonanCompilerDownloadTask : DefaultTask() {
internal companion object {
internal const val BASE_DOWNLOAD_URL = "https://download.jetbrains.com/kotlin/native/builds"
}
/**
* If true the task will also download dependencies for targets specified by the konan.targets project extension.
*/
@Internal
var downloadDependencies: Boolean = false
@TaskAction
fun downloadAndExtract() {
if (!project.hasProperty(KonanPlugin.ProjectProperty.DOWNLOAD_COMPILER)) {
val konanHome = project.kotlinNativeDist
logger.info("Use a user-defined compiler path: $konanHome")
} else {
try {
val downloadUrlDirectory = buildString {
append("$BASE_DOWNLOAD_URL/")
val version = project.konanVersion
if (version.contains("-dev-")) append("dev/") else append("releases/")
append("$version/")
append(project.simpleOsName)
}
val konanCompiler = project.konanCompilerName()
val parentDir = DependencyProcessor.localKonanDir
logger.info("Downloading Kotlin/Native compiler from $downloadUrlDirectory/$konanCompiler into $parentDir")
DependencyProcessor(
parentDir,
downloadUrlDirectory,
mapOf(konanCompiler to listOf(DependencySource.Remote.Public))
).run()
} catch (e: IOException) {
throw GradleScriptException("Cannot download Kotlin/Native compiler", e)
}
}
// Download dependencies if a user said so.
if (downloadDependencies) {
val runner = KonanCliCompilerRunner(project, project.konanExtension.jvmArgs)
project.konanTargets.forEach {
runner.run("-Xcheck_dependencies", "-target", it.visibleName)
}
}
}
}