Control plugin version and repo from properties

This commit is contained in:
Ilya Chernikov
2017-09-11 14:24:35 +02:00
parent 96d5e0bb21
commit 24c192135f
8 changed files with 54 additions and 32 deletions
+18 -16
View File
@@ -5,29 +5,32 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile
buildscript {
extra["kotlin_version"] = file("kotlin-bootstrap-version.txt").readText().trim()
extra["kotlinVersion"] = extra["kotlin_version"]
val repos = listOf(
System.getProperty("bootstrap.kotlin.repo"),
"https://repo.gradle.org/gradle/repo",
"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["kotlin_gradle_plugin_version"] = extra["kotlin_version"]
extra["repos"] = listOf("https://dl.bintray.com/kotlin/kotlin-dev",
"https://repo.gradle.org/gradle/repo",
"https://plugins.gradle.org/m2",
"http://repository.jetbrains.com/utils/")
extra["repos"] = repos
repositories {
for (repo in (rootProject.extra["repos"] as List<String>)) {
for (repo in repos) {
maven { setUrl(repo) }
}
}
dependencies {
classpath(kotlinDep("gradle-plugin"))
classpath("com.gradle.publish:plugin-publish-plugin:0.9.7")
classpath(kotlinDep("gradle-plugin"))
}
}
plugins {
java // so we can benefit from the `java()` accessor below
// java // so we can benefit from the `java()` accessor below
// kotlin("jvm")
}
val buildNumber = "1.1-SNAPSHOT"
@@ -76,8 +79,6 @@ extra["JDK_18"] = jdkPath("1.8")
extra["compilerBaseName"] = "kotlin-compiler"
extra["embeddableCompilerBaseName"] = "kotlin-compiler-embeddable"
//extra["compilerJarWithBootstrapRuntime"] = project.file("$distDir/kotlin-compiler-with-bootstrap-runtime.jar")
//extra["bootstrapCompilerFile"] = bootstrapCfg.files.first().canonicalPath
extra["buildLocalRepoPath"] = File(commonBuildDir, "repo")
@@ -204,10 +205,11 @@ task<Copy>("dist-plugin") {
into("$ideaPluginDir/lib")
}
val clean by tasks
clean.apply {
doLast {
delete("${buildDir}/repo")
tasks {
"clean" {
doLast {
delete("$buildDir/repo")
}
}
}
+10 -14
View File
@@ -1,22 +1,18 @@
buildscript {
extra["kotlin_version"] = file("../kotlin-version-for-gradle.txt").readText().trim()
extra["kotlin_gradle_plugin_version"] = extra["kotlin_version"]
extra["repos"] = listOf(
"https://dl.bintray.com/kotlin/kotlin-dev",
"https://repo.gradle.org/gradle/repo",
"https://plugins.gradle.org/m2",
"http://repository.jetbrains.com/utils/")
// TODO: find a way to reuse bootstrap.kotlin.* props from the main project
// java.util.Properties().also { it.load(java.io.FileInputStream("gradle.properties")) }
extra["bootstrap_kotlin_version"] = System.getProperty("bootstrap.kotlin.version") ?: embeddedKotlinVersion
repositories {
for (repo in (rootProject.extra["repos"] as List<String>)) {
maven { setUrl(repo) }
System.getProperty("bootstrap.kotlin.repo")?.let {
maven { setUrl(it) }
}
}
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["kotlin_version"]}")
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:${rootProject.extra["kotlin_version"]}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["bootstrap_kotlin_version"]}")
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:${rootProject.extra["bootstrap_kotlin_version"]}")
}
}
@@ -30,14 +26,14 @@ plugins {
}
repositories {
for (repo in (rootProject.extra["repos"] as List<String>)) {
maven { setUrl(repo) }
System.getProperty("bootstrap.kotlin.repo")?.let {
maven { setUrl(it) }
}
}
dependencies {
// TODO: adding the dep to the plugin breaks the build unexpectedly, resolve and uncomment
// compile("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["kotlin_version"]}")
// compile("org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.extra["bootstrap_kotlin_version"]}")
}
samWithReceiver {
+7
View File
@@ -0,0 +1,7 @@
org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Xmx1200m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
systemProp.bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
systemProp.bootstrap.kotlin.version=1.1.5-dev-640
+3
View File
@@ -2,3 +2,6 @@ org.gradle.daemon=true
org.gradle.parallel=false
org.gradle.configureondemand=false
org.gradle.jvmargs=-Xmx1200m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled
systemProp.bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
systemProp.bootstrap.kotlin.version=1.1.5-dev-640
+4
View File
@@ -1,6 +1,10 @@
apply { plugin("kotlin") }
//plugins {
// kotlin("jvm")
//}
dependencies {
val compile by configurations
val testCompile by configurations
-1
View File
@@ -1 +0,0 @@
1.1.5-dev-393
-1
View File
@@ -1 +0,0 @@
1.1.5-dev-393
+12
View File
@@ -1,3 +1,15 @@
pluginManagement {
repositories {
def pluginRepo = System.getProperty("bootstrap.kotlin.repo")
if (pluginRepo != null) {
maven {
url pluginRepo
}
}
gradlePluginPortal()
}
}
// modules
//include ":buildSrc" // this fixes import into idea, so buildsrc is not longer imported with different gradle version
include ":build-common",