[performance] enable project performance
(cherry picked from commit 947c3bd92b2ee8d252619cf987427a7e195191cb)
This commit is contained in:
committed by
Stanislav Erokhin
parent
f2524dbb8d
commit
c9e0928038
@@ -0,0 +1,134 @@
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
import java.util.Properties
|
||||
import java.io.FileReader
|
||||
|
||||
extra["versions.native-platform"] = "0.14"
|
||||
|
||||
|
||||
|
||||
buildscript {
|
||||
java.util.Properties().also {
|
||||
it.load(java.io.FileReader(project.file("../../../gradle.properties")))
|
||||
}.forEach { k, v->
|
||||
println("${project.name}<<<[$k] = $v>>>")
|
||||
extra[k as String] = v
|
||||
}
|
||||
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() ?: false
|
||||
|
||||
extra["defaultSnapshotVersion"] = kotlinBuildProperties.defaultSnapshotVersion
|
||||
kotlinBootstrapFrom(BootstrapOption.SpaceBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
|
||||
|
||||
repositories {
|
||||
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
|
||||
jcenter()
|
||||
project.bootstrapKotlinRepo?.let {
|
||||
maven(url = it)
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.25")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
|
||||
}
|
||||
}
|
||||
|
||||
apply{
|
||||
plugin("kotlin")
|
||||
plugin("kotlin-sam-with-receiver")
|
||||
}
|
||||
plugins {
|
||||
`kotlin-dsl`
|
||||
//kotlin("multiplatform") version "${project.bootstrapKotlinVersion}"
|
||||
}
|
||||
|
||||
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
||||
repositories {
|
||||
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
|
||||
jcenter()
|
||||
maven("https://jetbrains.bintray.com/intellij-third-party-dependencies/")
|
||||
maven("https://kotlin.bintray.com/kotlin-dependencies")
|
||||
maven("https://cache-redirector.jetbrains.com/dl.kotlin.bintray.com/kotlinx")
|
||||
gradlePluginPortal()
|
||||
maven("https://kotlin.bintray.com/kotlin-dev")
|
||||
extra["bootstrapKotlinRepo"]?.let {
|
||||
maven(url = it)
|
||||
}
|
||||
}
|
||||
|
||||
tasks.validatePlugins.configure {
|
||||
enabled = false
|
||||
}
|
||||
|
||||
|
||||
sourceSets["main"].withConvention(org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet::class) {
|
||||
kotlin.srcDir("src/main/kotlin")
|
||||
//kotlin.srcDir("tools/benchmarks/shared/src/main/kotlin")
|
||||
kotlin.srcDir("../../build-tools/src/main/kotlin")
|
||||
//kotlin.srcDir("../../build-tools/src/main/kotlin")
|
||||
kotlin.srcDir("../../shared/src/library/kotlin")
|
||||
kotlin.srcDir("../../shared/src/main/kotlin")
|
||||
kotlin.srcDir("../../tools/benchmarks/shared/src/main/kotlin/report")
|
||||
kotlin.srcDir("../../../native/utils/src")
|
||||
}
|
||||
|
||||
tasks.withType<KotlinCompile>().configureEach {
|
||||
kotlinOptions.freeCompilerArgs +=
|
||||
listOf("-Xopt-in=kotlin.RequiresOptIn",
|
||||
"-Xskip-runtime-version-check",
|
||||
"-Xopt-in=kotlin.ExperimentalStdlibApi")
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.25")
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
|
||||
api("org.jetbrains.kotlin:kotlin-native-utils:${project.bootstrapKotlinVersion}")
|
||||
compileOnly(gradleApi())
|
||||
val kotlinVersion = project.bootstrapKotlinVersion
|
||||
val ktorVersion = "1.2.1"
|
||||
val slackApiVersion = "1.2.0"
|
||||
val shadowVersion = "5.1.0"
|
||||
val metadataVersion = "0.0.1-dev-10"
|
||||
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
|
||||
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
|
||||
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
|
||||
implementation("com.ullink.slack:simpleslackapi:$slackApiVersion")
|
||||
|
||||
implementation("io.ktor:ktor-client-auth:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-core:$ktorVersion")
|
||||
implementation("io.ktor:ktor-client-cio:$ktorVersion")
|
||||
|
||||
api("org.jetbrains.kotlin:kotlin-native-utils:$kotlinVersion")
|
||||
|
||||
// Located in <repo root>/shared and always provided by the composite build.
|
||||
//api("org.jetbrains.kotlin:kotlin-native-shared:$konanVersion")
|
||||
implementation("com.github.jengelman.gradle.plugins:shadow:$shadowVersion")
|
||||
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-metadata-klib:$metadataVersion")
|
||||
}
|
||||
|
||||
gradlePlugin {
|
||||
plugins {
|
||||
create("benchmarkPlugin") {
|
||||
id = "benchmarking"
|
||||
implementationClass = "org.jetbrains.kotlin.benchmark.KotlinNativeBenchmarkingPlugin"
|
||||
}
|
||||
create("compileBenchmarking") {
|
||||
id = "compile-benchmarking"
|
||||
implementationClass = "org.jetbrains.kotlin.benchmark.CompileBenchmarkingPlugin"
|
||||
}
|
||||
create("swiftBenchmarking") {
|
||||
id = "swift-benchmarking"
|
||||
implementationClass = "org.jetbrains.kotlin.benchmark.SwiftBenchmarkingPlugin"
|
||||
}
|
||||
create("compileToBitcode") {
|
||||
id = "compile-to-bitcode"
|
||||
implementationClass = "org.jetbrains.kotlin.bitcode.CompileToBitcodePlugin"
|
||||
}
|
||||
create("runtimeTesting") {
|
||||
id = "runtime-testing"
|
||||
implementationClass = "org.jetbrains.kotlin.testing.native.RuntimeTestingPlugin"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import java.io.File
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
|
||||
jcenter()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies")
|
||||
}
|
||||
dependencies {
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.25")
|
||||
}
|
||||
}
|
||||
|
||||
//include("tools")
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2021 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.
|
||||
*/
|
||||
import org.gradle.api.Project
|
||||
|
||||
fun Project.kotlinInit(cacheRedirectorEnabled: Boolean) {
|
||||
extensions.extraProperties["defaultSnapshotVersion"] = kotlinBuildProperties.defaultSnapshotVersion
|
||||
kotlinBootstrapFrom(BootstrapOption.SpaceBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
|
||||
|
||||
extensions.extraProperties["kotlinVersion"] = findProperty("kotlinVersion")
|
||||
extensions.extraProperties["konanVersion"] = findProperty("konanVersion")
|
||||
}
|
||||
Reference in New Issue
Block a user