Reworked joint build (kotlin + kotlin-ultimate)
- Root buildscript classpath no more depends on buildSrc.jar from kotlin-ultimate. This allows to have stable joint builds - w/o occasional "Unresolved reference" errors in buildscripts. - kotlin-ultimate modules are now included into Kotlin project when two conditions are met: 1) Gradle parameter 'cidrPluginsEnabled' is turned on; 2) kotlin-ultimate Git repo is checked out right to the Kotlin project root (assuming there is 'kotlin-ultimate' directory inside the project root).
This commit is contained in:
@@ -34,15 +34,6 @@ buildscript {
|
||||
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
|
||||
classpath("net.sf.proguard:proguard-gradle:6.1.0")
|
||||
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
|
||||
|
||||
// a workaround to add another one buildSrc with Cidr-specific tools to Gradle classpath
|
||||
val kotlinUltimateBuildSrcDep = "org.jetbrains.kotlin.ultimate:buildSrc:1.0"
|
||||
if (findProperty("cidrPluginsEnabled")?.toString()?.toBoolean() == true) {
|
||||
logger.info("Adding buildscript classpath dependency \"$kotlinUltimateBuildSrcDep\" in build.gradle.kts")
|
||||
classpath(kotlinUltimateBuildSrcDep)
|
||||
} else {
|
||||
logger.info("NOT adding buildscript classpath dependency \"$kotlinUltimateBuildSrcDep\" in build.gradle.kts")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,3 +4,5 @@ cacheRedirectorEnabled=true
|
||||
|
||||
#buildSrc.kotlin.repo=https://jcenter.bintray.com
|
||||
#buildSrc.kotlin.version=1.1.50
|
||||
|
||||
#cidrPluginsEnabled=true
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
pluginManagement {
|
||||
repositories {
|
||||
if (cacheRedirectorEnabled == 'true') {
|
||||
@@ -12,3 +11,9 @@ pluginManagement {
|
||||
}
|
||||
|
||||
include "prepare-deps"
|
||||
|
||||
def includeCidrPlugins = hasProperty("cidrPluginsEnabled") && Boolean.parseBoolean(cidrPluginsEnabled) && file("../kotlin-ultimate").exists()
|
||||
if (includeCidrPlugins) {
|
||||
include ":prepare-deps:kotlin-native-platform-deps"
|
||||
project(":prepare-deps:kotlin-native-platform-deps").projectDir = file("../kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
|
||||
}
|
||||
|
||||
+7
-9
@@ -222,19 +222,17 @@ include ":kotlin-build-common",
|
||||
":kotlin-serialization-unshaded",
|
||||
":kotlin-serialization:plugin-marker"
|
||||
|
||||
|
||||
def includeCidr = hasProperty("cidrPluginsEnabled") && Boolean.parseBoolean(cidrPluginsEnabled)
|
||||
if (includeCidr) {
|
||||
logger.info("Including :kotlin-ultimate in settings.gradle")
|
||||
includeBuild "kotlin-ultimate/buildSrc"
|
||||
def includeCidrPlugins = hasProperty("cidrPluginsEnabled") && Boolean.parseBoolean(cidrPluginsEnabled) && file("kotlin-ultimate").exists()
|
||||
if (includeCidrPlugins) {
|
||||
logger.info("Including CIDR plugins in settings.gradle")
|
||||
include ":kotlin-ultimate:ide:cidr-native",
|
||||
":kotlin-ultimate:ide:appcode-native",
|
||||
":kotlin-ultimate:ide:clion-native",
|
||||
":kotlin-ultimate:ide:appcode-native",
|
||||
":kotlin-ultimate:prepare:cidr-plugin",
|
||||
":kotlin-ultimate:prepare:appcode-plugin",
|
||||
":kotlin-ultimate:prepare:clion-plugin"
|
||||
":kotlin-ultimate:prepare:clion-plugin",
|
||||
":kotlin-ultimate:prepare:appcode-plugin"
|
||||
} else {
|
||||
logger.info("NOT including :kotlin-ultimate in settings.gradle")
|
||||
logger.info("NOT including CIDR plugins in settings.gradle")
|
||||
}
|
||||
|
||||
def isTeamcityBuild = hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
|
||||
|
||||
Reference in New Issue
Block a user