diff --git a/build.gradle.kts b/build.gradle.kts index 4c9400146c3..83224ec8ae3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,9 +12,8 @@ buildscript { "https://plugins.gradle.org/m2", "http://repository.jetbrains.com/utils/").filterNotNull() - extra["kotlin_version"] = bootstrapKotlinVersion - extra["kotlinVersion"] = bootstrapKotlinVersion - extra["kotlin_language_version"] = "1.1" + extra["bootstrapKotlinVersion"] = bootstrapKotlinVersion + extra["repos"] = repos extra["versions.shadow"] = "2.0.1" @@ -47,8 +46,16 @@ val configuredJdks: List = } } -val buildNumber = "1.1-SNAPSHOT" -extra["build.number"] = buildNumber +val defaultSnapshotVersion = "1.1-SNAPSHOT" +val buildNumber by extra(findProperty("build.number")?.toString() ?: defaultSnapshotVersion) +val kotlinVersion by extra(findProperty("deployVersion")?.toString() ?: buildNumber) + +val kotlinLanguageVersion by extra("1.1") + +allprojects { + group = "org.jetbrains.kotlin" + version = kotlinVersion +} extra["kotlin_root"] = rootDir @@ -165,11 +172,6 @@ val gradlePluginProjects = listOf( ":kotlin-sam-with-receiver" ) -allprojects { - group = "org.jetbrains.kotlin" - version = buildNumber -} - apply { from("libraries/commonConfiguration.gradle") from("libraries/gradlePluginsConfiguration.gradle") @@ -230,12 +232,12 @@ allprojects { } configureJvmProject(javaHome!!, jvmTarget!!) - tasks.withType { - kotlinOptions.freeCompilerArgs = listOf("-Xallow-kotlin-package") - } - - tasks.withType { - kotlinOptions.freeCompilerArgs = listOf("-Xallow-kotlin-package") + tasks.withType> { + kotlinOptions { + languageVersion = kotlinLanguageVersion + apiVersion = kotlinLanguageVersion + freeCompilerArgs = listOf("-Xallow-kotlin-package") + } } tasks.withType { diff --git a/buildSrc/src/main/kotlin/CommonUtil.kt b/buildSrc/src/main/kotlin/CommonUtil.kt index 85abe5c0f12..e35678a20a0 100644 --- a/buildSrc/src/main/kotlin/CommonUtil.kt +++ b/buildSrc/src/main/kotlin/CommonUtil.kt @@ -38,7 +38,7 @@ fun Jar.setupRuntimeJar(implementationTitle: String): Unit { put("Built-By", project.rootProject.extra["manifest.impl.vendor"]) put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"]) put("Implementation-Title", implementationTitle) - put("Implementation-Version", project.rootProject.extra["build.number"]) + put("Implementation-Version", project.rootProject.extra["buildNumber"]) } // from(project.configurations.getByName("build-version").files, action = { into("META-INF/") }) } diff --git a/buildSrc/src/main/kotlin/artifacts.kt b/buildSrc/src/main/kotlin/artifacts.kt index 537a956ef3e..2ec8b0961d3 100644 --- a/buildSrc/src/main/kotlin/artifacts.kt +++ b/buildSrc/src/main/kotlin/artifacts.kt @@ -130,15 +130,16 @@ fun Project.publish(body: Upload.() -> Unit = {}): Upload { } fun Project.ideaPlugin(subdir: String = "lib", body: AbstractCopyTask.() -> Unit): Copy { + val thisProject = this val pluginTask = task("ideaPlugin") { body() into(File(rootProject.extra["ideaPluginDir"].toString(), subdir).path) - rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "") + rename("-${java.util.regex.Pattern.quote(thisProject.version.toString())}", "") } task("idea-plugin") { dependsOn(pluginTask) - } +} return pluginTask } @@ -156,6 +157,7 @@ fun Project.dist(targetDir: File? = null, val distJarCfg = configurations.getOrCreate("distJar") val distLibDir: File by rootProject.extra val distJarName = targetName ?: (the().archivesBaseName + ".jar") + val thisProject = this return task("dist") { body() @@ -165,7 +167,7 @@ fun Project.dist(targetDir: File? = null, rename(it.outputs.files.singleFile.name, targetName) } } - rename("-${java.util.regex.Pattern.quote(rootProject.extra["build.number"].toString())}", "") + rename("-${java.util.regex.Pattern.quote(thisProject.version.toString())}", "") into(targetDir ?: distLibDir) project.addArtifact(distJarCfg, this, File(targetDir ?: distLibDir, distJarName)) } @@ -185,7 +187,7 @@ fun Jar.setupPublicJar(classifier: String = "", classifierDescr: String? = null) put("Built-By", project.rootProject.extra["manifest.impl.vendor"]) put("Implementation-Vendor", project.rootProject.extra["manifest.impl.vendor"]) put("Implementation-Title", "${project.description} ${classifierDescr ?: classifier}".trim()) - put("Implementation-Version", project.rootProject.extra["build.number"]) + put("Implementation-Version", project.rootProject.extra["buildNumber"]) } // from(project.configurations.getByName("build-version").files, action = { into("META-INF/") }) } diff --git a/libraries/commonConfiguration.gradle b/libraries/commonConfiguration.gradle index 2bbfed19208..5ebb8b2683f 100644 --- a/libraries/commonConfiguration.gradle +++ b/libraries/commonConfiguration.gradle @@ -77,13 +77,13 @@ ext.manifestAttributes = { Manifest manifest, Project project, String component attributes \ 'Implementation-Vendor': 'JetBrains', 'Implementation-Title': project.archivesBaseName, - 'Implementation-Version': project.version, + 'Implementation-Version': project.buildNumber, 'Build-Jdk': System.getProperty('java.version') if (component != null) { attributes \ 'Kotlin-Runtime-Component': component, - 'Kotlin-Version': project.kotlin_language_version + 'Kotlin-Version': project.kotlinLanguageVersion } } } diff --git a/libraries/configureGradleTools.gradle b/libraries/configureGradleTools.gradle index 36663025076..d846af312be 100644 --- a/libraries/configureGradleTools.gradle +++ b/libraries/configureGradleTools.gradle @@ -20,7 +20,7 @@ configure([project(':kotlin-gradle-plugin'), project(':kotlin-allopen'), project } publishPlugins.doFirst { - assert !kotlin_version.contains('SNAPSHOT') + assert !kotlinVersion.contains('SNAPSHOT') } pluginBundle { diff --git a/libraries/gradlePluginsConfiguration.gradle b/libraries/gradlePluginsConfiguration.gradle index 73ac0e9764e..d9bd03112c9 100644 --- a/libraries/gradlePluginsConfiguration.gradle +++ b/libraries/gradlePluginsConfiguration.gradle @@ -26,7 +26,7 @@ configure([project(':kotlin-gradle-plugin'), project(':kotlin-allopen'), project } publishPlugins.doFirst { - assert !kotlin_version.contains('SNAPSHOT') + assert !kotlinVersion.contains('SNAPSHOT') } pluginBundle { diff --git a/libraries/tools/kotlin-stdlib-gen/build.gradle b/libraries/tools/kotlin-stdlib-gen/build.gradle index e0ca9f660d5..fac8d9aa045 100644 --- a/libraries/tools/kotlin-stdlib-gen/build.gradle +++ b/libraries/tools/kotlin-stdlib-gen/build.gradle @@ -5,7 +5,7 @@ sourceSets { } dependencies { - compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-stdlib:$bootstrapKotlinVersion" } compileKotlin { diff --git a/libraries/tools/kotlin-stdlib-js-merger/build.gradle b/libraries/tools/kotlin-stdlib-js-merger/build.gradle index d74b0f5d13d..05c0760b8ab 100644 --- a/libraries/tools/kotlin-stdlib-js-merger/build.gradle +++ b/libraries/tools/kotlin-stdlib-js-merger/build.gradle @@ -3,7 +3,7 @@ description = 'Merge utility for Kotlin Standard Library for JS' apply plugin: 'kotlin' dependencies { - compile "org.jetbrains.kotlin:kotlin-compiler:$kotlin_version" + compile "org.jetbrains.kotlin:kotlin-compiler:$bootstrapKotlinVersion" } sourceSets { diff --git a/prepare/build.version/build.gradle.kts b/prepare/build.version/build.gradle.kts index b71d5ce25a0..93974729632 100644 --- a/prepare/build.version/build.gradle.kts +++ b/prepare/build.version/build.gradle.kts @@ -6,7 +6,7 @@ val buildVersionFilePath = "${rootProject.extra["distDir"]}/build.txt" val buildVersion by configurations.creating val prepare = task("prepare") { - val versionString = rootProject.extra["build.number"].toString() + val versionString = rootProject.extra["buildNumber"].toString() val versionFile = File(buildVersionFilePath) outputs.file(buildVersionFilePath) outputs.upToDateWhen {