Make kotlin build version for buildSrc the same as for kotlin project
This commit is contained in:
+3
-1
@@ -8,12 +8,13 @@ buildscript {
|
|||||||
extra["defaultSnapshotVersion"] = "1.4-SNAPSHOT"
|
extra["defaultSnapshotVersion"] = "1.4-SNAPSHOT"
|
||||||
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
||||||
|
|
||||||
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap("1.4.0-dev-1075", cacheRedirectorEnabled))
|
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
bootstrapKotlinRepo?.let(::maven)
|
bootstrapKotlinRepo?.let(::maven)
|
||||||
|
|
||||||
if (cacheRedirectorEnabled) {
|
if (cacheRedirectorEnabled) {
|
||||||
|
maven("https://cache-redirector.jetbrains.com/jcenter.bintray.com")
|
||||||
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
|
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
|
||||||
} else {
|
} else {
|
||||||
maven("https://plugins.gradle.org/m2")
|
maven("https://plugins.gradle.org/m2")
|
||||||
@@ -28,6 +29,7 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
|
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
|
||||||
|
|
||||||
|
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.10")
|
||||||
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
|
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
|
||||||
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
|
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
|
||||||
classpath("net.sf.proguard:proguard-gradle:6.1.0")
|
classpath("net.sf.proguard:proguard-gradle:6.1.0")
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
extra["versions.native-platform"] = "0.14"
|
extra["versions.native-platform"] = "0.14"
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|
||||||
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
||||||
|
|
||||||
val buildSrcKotlinVersion: String by extra(findProperty("buildSrc.kotlin.version")?.toString() ?: embeddedKotlinVersion)
|
kotlinBootstrapFrom(BootstrapOption.BintrayBootstrap(kotlinBuildProperties.kotlinBootstrapVersion!!, cacheRedirectorEnabled))
|
||||||
val buildSrcKotlinRepo: String? by extra(findProperty("buildSrc.kotlin.repo") as String?)
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
if (cacheRedirectorEnabled) {
|
if (cacheRedirectorEnabled) {
|
||||||
@@ -15,21 +15,21 @@ buildscript {
|
|||||||
maven("https://kotlin.bintray.com/kotlin-dependencies")
|
maven("https://kotlin.bintray.com/kotlin-dependencies")
|
||||||
}
|
}
|
||||||
|
|
||||||
buildSrcKotlinRepo?.let {
|
project.bootstrapKotlinRepo?.let {
|
||||||
maven(url = it)
|
maven(url = it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.8")
|
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.10")
|
||||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$buildSrcKotlinVersion")
|
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
|
||||||
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:$buildSrcKotlinVersion")
|
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:${project.bootstrapKotlinVersion}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
||||||
|
|
||||||
logger.info("buildSrcKotlinVersion: " + extra["buildSrcKotlinVersion"])
|
logger.info("buildSrcKotlinVersion: " + extra["bootstrapKotlinVersion"])
|
||||||
logger.info("buildSrc kotlin compiler version: " + org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
|
logger.info("buildSrc kotlin compiler version: " + org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION)
|
||||||
logger.info("buildSrc stdlib version: " + KotlinVersion.CURRENT)
|
logger.info("buildSrc stdlib version: " + KotlinVersion.CURRENT)
|
||||||
|
|
||||||
@@ -83,14 +83,14 @@ repositories {
|
|||||||
maven("https://kotlin.bintray.com/kotlin-dependencies")
|
maven("https://kotlin.bintray.com/kotlin-dependencies")
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
|
|
||||||
extra["buildSrcKotlinRepo"]?.let {
|
extra["bootstrapKotlinRepo"]?.let {
|
||||||
maven(url = it)
|
maven(url = it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(kotlin("stdlib", embeddedKotlinVersion))
|
implementation(kotlin("stdlib", embeddedKotlinVersion))
|
||||||
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.8")
|
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.10")
|
||||||
|
|
||||||
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
|
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
|
||||||
implementation("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
|
implementation("net.rubygrapefruit:native-platform-windows-amd64:${property("versions.native-platform")}")
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.8")
|
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.10")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,12 @@
|
|||||||
|
|
||||||
// usages in build scripts are not tracked properly
|
// usages in build scripts are not tracked properly
|
||||||
|
|
||||||
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
|
|
||||||
import org.gradle.api.GradleException
|
import org.gradle.api.GradleException
|
||||||
import org.gradle.api.Project
|
import org.gradle.api.Project
|
||||||
import org.gradle.api.artifacts.ProjectDependency
|
import org.gradle.api.artifacts.ProjectDependency
|
||||||
import org.gradle.api.artifacts.dsl.DependencyHandler
|
import org.gradle.api.artifacts.dsl.DependencyHandler
|
||||||
import org.gradle.api.file.ConfigurableFileCollection
|
import org.gradle.api.file.ConfigurableFileCollection
|
||||||
import org.gradle.api.file.FileCollection
|
import org.gradle.api.file.FileCollection
|
||||||
import org.gradle.api.tasks.AbstractCopyTask
|
|
||||||
import org.gradle.kotlin.dsl.extra
|
import org.gradle.kotlin.dsl.extra
|
||||||
import org.gradle.kotlin.dsl.project
|
import org.gradle.kotlin.dsl.project
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = "org.jetbrains.kotlin"
|
group = "org.jetbrains.kotlin"
|
||||||
version = "0.0.8"
|
version = "0.0.10"
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
Vendored
+18
-18
@@ -1,20 +1,20 @@
|
|||||||
@file:Suppress("unused") // usages in build scripts are not tracked properly
|
/*
|
||||||
|
* Copyright 2010-2020 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
|
import org.gradle.api.Project
|
||||||
import org.gradle.kotlin.dsl.*
|
|
||||||
import java.net.URI
|
import java.net.URI
|
||||||
|
|
||||||
|
|
||||||
var Project.bootstrapKotlinVersion: String
|
var Project.bootstrapKotlinVersion: String
|
||||||
get() = this.property("bootstrapKotlinVersion") as String
|
get() = property("bootstrapKotlinVersion") as String
|
||||||
private set(value) {
|
private set(value) {
|
||||||
this.extra["bootstrapKotlinVersion"] = value
|
extensions.extraProperties.set("bootstrapKotlinVersion", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
var Project.bootstrapKotlinRepo: String?
|
var Project.bootstrapKotlinRepo: String?
|
||||||
get() = this.property("bootstrapKotlinRepo") as String?
|
get() = property("bootstrapKotlinRepo") as String?
|
||||||
private set(value) {
|
private set(value) {
|
||||||
this.extra["bootstrapKotlinRepo"] = value
|
extensions.extraProperties.set("bootstrapKotlinRepo", value)
|
||||||
}
|
}
|
||||||
|
|
||||||
val Project.internalKotlinRepo: String?
|
val Project.internalKotlinRepo: String?
|
||||||
@@ -22,16 +22,16 @@ val Project.internalKotlinRepo: String?
|
|||||||
"branch:default:any/artifacts/content/internal/repo"
|
"branch:default:any/artifacts/content/internal/repo"
|
||||||
|
|
||||||
fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
|
fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
|
||||||
val customVersion = project.findProperty("bootstrap.kotlin.version") as String?
|
val customVersion = findProperty("bootstrap.kotlin.version") as String?
|
||||||
val customRepo = project.findProperty("bootstrap.kotlin.repo") as String?
|
val customRepo = findProperty("bootstrap.kotlin.repo") as String?
|
||||||
val teamCityVersion = project.findProperty("bootstrap.teamcity.kotlin.version") as String?
|
val teamCityVersion = findProperty("bootstrap.teamcity.kotlin.version") as String?
|
||||||
val teamCityBuild = project.findProperty("bootstrap.teamcity.build.number") as String?
|
val teamCityBuild = findProperty("bootstrap.teamcity.build.number") as String?
|
||||||
val teamCityProject = project.findProperty("bootstrap.teamcity.project") as String?
|
val teamCityProject = findProperty("bootstrap.teamcity.project") as String?
|
||||||
|
|
||||||
val bootstrapSource = when {
|
val bootstrapSource = when {
|
||||||
project.hasProperty("bootstrap.local") -> BootstrapOption.Local(
|
hasProperty("bootstrap.local") -> BootstrapOption.Local(
|
||||||
project.findProperty("bootstrap.local.version") as String?,
|
findProperty("bootstrap.local.version") as String?,
|
||||||
project.findProperty("bootstrap.local.path") as String?
|
findProperty("bootstrap.local.path") as String?
|
||||||
)
|
)
|
||||||
teamCityVersion != null -> BootstrapOption.TeamCity(
|
teamCityVersion != null -> BootstrapOption.TeamCity(
|
||||||
teamCityVersion,
|
teamCityVersion,
|
||||||
@@ -43,8 +43,8 @@ fun Project.kotlinBootstrapFrom(defaultSource: BootstrapOption) {
|
|||||||
else -> defaultSource
|
else -> defaultSource
|
||||||
}
|
}
|
||||||
|
|
||||||
bootstrapSource.applyToProject(project)
|
bootstrapSource.applyToProject(this)
|
||||||
project.logger.lifecycle("Using kotlin bootstrap version $bootstrapKotlinVersion from repo $bootstrapKotlinRepo")
|
logger.lifecycle("Using kotlin bootstrap version $bootstrapKotlinVersion from repo $bootstrapKotlinRepo")
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class BootstrapOption {
|
sealed class BootstrapOption {
|
||||||
@@ -19,16 +19,24 @@ class KotlinBuildProperties(
|
|||||||
private val propertiesProvider: PropertiesProvider
|
private val propertiesProvider: PropertiesProvider
|
||||||
) {
|
) {
|
||||||
private val localProperties: Properties = Properties()
|
private val localProperties: Properties = Properties()
|
||||||
|
private val rootProperties: Properties = Properties()
|
||||||
|
|
||||||
init {
|
init {
|
||||||
val localPropertiesFile = propertiesProvider.rootProjectDir.resolve("local.properties")
|
loadPropertyFile("local.properties", localProperties)
|
||||||
if (localPropertiesFile.isFile) {
|
loadPropertyFile("gradle.properties", rootProperties)
|
||||||
localPropertiesFile.reader().use(localProperties::load)
|
}
|
||||||
|
|
||||||
|
private fun loadPropertyFile(fileName: String, propertiesDestination: Properties) {
|
||||||
|
val propertiesFile = propertiesProvider.rootProjectDir.resolve(fileName)
|
||||||
|
if (propertiesFile.isFile) {
|
||||||
|
propertiesFile.reader().use(propertiesDestination::load)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private operator fun get(key: String): Any? = localProperties.getProperty(key) ?: propertiesProvider.getProperty(key)
|
private operator fun get(key: String): Any? = localProperties.getProperty(key) ?: propertiesProvider.getProperty(key)
|
||||||
|
|
||||||
|
private fun getLocalOrRoot(key: String): Any? = get(key) ?: rootProperties.getProperty(key)
|
||||||
|
|
||||||
private fun getBoolean(key: String, default: Boolean = false): Boolean =
|
private fun getBoolean(key: String, default: Boolean = false): Boolean =
|
||||||
this[key]?.toString()?.trim()?.toBoolean() ?: default
|
this[key]?.toString()?.trim()?.toBoolean() ?: default
|
||||||
|
|
||||||
@@ -94,6 +102,10 @@ class KotlinBuildProperties(
|
|||||||
val buildCacheUser: String? = get("kotlin.build.cache.user") as String?
|
val buildCacheUser: String? = get("kotlin.build.cache.user") as String?
|
||||||
|
|
||||||
val buildCachePassword: String? = get("kotlin.build.cache.password") as String?
|
val buildCachePassword: String? = get("kotlin.build.cache.password") as String?
|
||||||
|
|
||||||
|
val kotlinBootstrapVersion: String? = getLocalOrRoot("kotlin.build.version") as String?
|
||||||
|
|
||||||
|
val kotlinBootstrapLocalRepo: String? = get("kotlin.build.local.repo") as String?
|
||||||
}
|
}
|
||||||
|
|
||||||
private const val extensionName = "kotlinBuildProperties"
|
private const val extensionName = "kotlinBuildProperties"
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ kotlin.compiler.newInferenceEnabled=true
|
|||||||
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
||||||
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
||||||
#bootstrap.kotlin.version=1.1.50-dev-1451
|
#bootstrap.kotlin.version=1.1.50-dev-1451
|
||||||
|
kotlin.build.version=1.4.0-dev-1075
|
||||||
|
|
||||||
#signingRequired=true
|
#signingRequired=true
|
||||||
|
#org.gradle.debug=true
|
||||||
|
|
||||||
## The following properties can be added to your local.properties file to customize the build:
|
## The following properties can be added to your local.properties file to customize the build:
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ kotlin.compiler.newInferenceEnabled=true
|
|||||||
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
||||||
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
||||||
#bootstrap.kotlin.version=1.1.50-dev-1451
|
#bootstrap.kotlin.version=1.1.50-dev-1451
|
||||||
|
kotlin.build.version=1.4.0-dev-1075
|
||||||
#signingRequired=true
|
#signingRequired=true
|
||||||
|
|
||||||
intellijUltimateEnabled=false
|
intellijUltimateEnabled=false
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ kotlin.compiler.newInferenceEnabled=true
|
|||||||
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
||||||
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
||||||
#bootstrap.kotlin.version=1.1.50-dev-1451
|
#bootstrap.kotlin.version=1.1.50-dev-1451
|
||||||
|
kotlin.build.version=1.4.0-dev-1075
|
||||||
#signingRequired=true
|
#signingRequired=true
|
||||||
|
|
||||||
intellijUltimateEnabled=false
|
intellijUltimateEnabled=false
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ kotlin.compiler.newInferenceEnabled=true
|
|||||||
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
|
||||||
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
|
||||||
#bootstrap.kotlin.version=1.1.50-dev-1451
|
#bootstrap.kotlin.version=1.1.50-dev-1451
|
||||||
|
kotlin.build.version=1.4.0-dev-1075
|
||||||
#signingRequired=true
|
#signingRequired=true
|
||||||
|
|
||||||
intellijUltimateEnabled=false
|
intellijUltimateEnabled=false
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ buildscript {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.8")
|
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.10")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user