Support ultimate transition
KOTLIN-CR-3025
This commit is contained in:
+2
-3
@@ -185,14 +185,13 @@ if (!project.hasProperty("versions.kotlin-native")) {
|
|||||||
extra["versions.kotlin-native"] = "1.3-dev-9780"
|
extra["versions.kotlin-native"] = "1.3-dev-9780"
|
||||||
}
|
}
|
||||||
|
|
||||||
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
|
val isTeamcityBuild = project.kotlinBuildProperties.isTeamcityBuild
|
||||||
val intellijUltimateEnabled = project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild
|
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
|
||||||
val effectSystemEnabled by extra(project.getBooleanProperty("kotlin.compiler.effectSystemEnabled") ?: false)
|
val effectSystemEnabled by extra(project.getBooleanProperty("kotlin.compiler.effectSystemEnabled") ?: false)
|
||||||
val newInferenceEnabled by extra(project.getBooleanProperty("kotlin.compiler.newInferenceEnabled") ?: false)
|
val newInferenceEnabled by extra(project.getBooleanProperty("kotlin.compiler.newInferenceEnabled") ?: false)
|
||||||
|
|
||||||
val intellijSeparateSdks = project.getBooleanProperty("intellijSeparateSdks") ?: false
|
val intellijSeparateSdks = project.getBooleanProperty("intellijSeparateSdks") ?: false
|
||||||
|
|
||||||
extra["intellijUltimateEnabled"] = intellijUltimateEnabled
|
|
||||||
extra["intellijSeparateSdks"] = intellijSeparateSdks
|
extra["intellijSeparateSdks"] = intellijSeparateSdks
|
||||||
|
|
||||||
extra["IntellijCoreDependencies"] =
|
extra["IntellijCoreDependencies"] =
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import java.util.Properties
|
||||||
|
|
||||||
extra["versions.shadow"] = "4.0.3"
|
extra["versions.shadow"] = "4.0.3"
|
||||||
extra["versions.native-platform"] = "0.14"
|
extra["versions.native-platform"] = "0.14"
|
||||||
|
|
||||||
@@ -64,8 +66,10 @@ rootProject.apply {
|
|||||||
from(rootProject.file("../gradle/versions.gradle.kts"))
|
from(rootProject.file("../gradle/versions.gradle.kts"))
|
||||||
}
|
}
|
||||||
|
|
||||||
val isTeamcityBuild = project.hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
|
val flags = LocalBuildProperties(project)
|
||||||
val intellijUltimateEnabled by extra(project.getBooleanProperty("intellijUltimateEnabled") ?: isTeamcityBuild)
|
|
||||||
|
val isTeamcityBuild = flags.isTeamcityBuild
|
||||||
|
val intellijUltimateEnabled by extra(flags.intellijUltimateEnabled)
|
||||||
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
|
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
|
||||||
val verifyDependencyOutput by extra( getBooleanProperty("kotlin.build.dependency.output.verification") ?: isTeamcityBuild)
|
val verifyDependencyOutput by extra( getBooleanProperty("kotlin.build.dependency.output.verification") ?: isTeamcityBuild)
|
||||||
|
|
||||||
@@ -117,3 +121,30 @@ allprojects {
|
|||||||
apply(from = "$rootDir/../gradle/cacheRedirector.gradle.kts")
|
apply(from = "$rootDir/../gradle/cacheRedirector.gradle.kts")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: These classes should be omitted once Gradle plugin supports local.properties
|
||||||
|
class LocalBuildPropertiesProvider(private val project: Project) {
|
||||||
|
private val localProperties: Properties = Properties()
|
||||||
|
|
||||||
|
val rootProjectDir: File = project.rootProject.rootDir.parentFile
|
||||||
|
|
||||||
|
init {
|
||||||
|
rootProjectDir.resolve("local.properties").takeIf { it.isFile }?.let {
|
||||||
|
it.reader().use(localProperties::load)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun getString(name: String): String? = project.findProperty(name)?.toString() ?: localProperties[name]?.toString()
|
||||||
|
|
||||||
|
fun getBoolean(name: String): Boolean = getString(name)?.toBoolean() == true
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalBuildProperties(project: Project) {
|
||||||
|
val propertiesProvider = LocalBuildPropertiesProvider(project)
|
||||||
|
|
||||||
|
val isTeamcityBuild = propertiesProvider.getString("teamcity") != null || System.getenv("TEAMCITY_VERSION") != null
|
||||||
|
|
||||||
|
val intellijUltimateEnabled =
|
||||||
|
(propertiesProvider.getBoolean("intellijUltimateEnabled") || isTeamcityBuild)
|
||||||
|
&& propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
|
||||||
|
}
|
||||||
|
|||||||
@@ -56,8 +56,13 @@ class KotlinBuildProperties(
|
|||||||
val useBootstrapStdlib: Boolean
|
val useBootstrapStdlib: Boolean
|
||||||
get() = isInJpsBuildIdeaSync
|
get() = isInJpsBuildIdeaSync
|
||||||
|
|
||||||
val includeCidrPlugins: Boolean =
|
val kotlinUltimateExists: Boolean = propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
|
||||||
getBoolean("cidrPluginsEnabled") && propertiesProvider.rootProjectDir.resolve("kotlin-ultimate").exists()
|
|
||||||
|
val includeCidrPlugins: Boolean = kotlinUltimateExists && getBoolean("cidrPluginsEnabled")
|
||||||
|
|
||||||
|
val isTeamcityBuild: Boolean = getBoolean("teamcity") || System.getenv("TEAMCITY_VERSION") != null
|
||||||
|
|
||||||
|
val intellijUltimateEnabled: Boolean = kotlinUltimateExists && (getBoolean("intellijUltimateEnabled") || isTeamcityBuild)
|
||||||
}
|
}
|
||||||
|
|
||||||
private const val extensionName = "kotlinBuildFlags"
|
private const val extensionName = "kotlinBuildFlags"
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ private fun Project.kotlinBuildLocalRepoDir() = File("${project.rootDir.absolute
|
|||||||
private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
|
private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
|
||||||
Ide.Kind.AndroidStudio -> "android-studio-ide"
|
Ide.Kind.AndroidStudio -> "android-studio-ide"
|
||||||
Ide.Kind.IntelliJ -> {
|
Ide.Kind.IntelliJ -> {
|
||||||
if (getBooleanProperty("intellijUltimateEnabled") == true) "ideaIU" else "ideaIC"
|
if (kotlinBuildProperties.intellijUltimateEnabled) "ideaIU" else "ideaIC"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-4
@@ -237,12 +237,14 @@ if (flags.includeCidrPlugins) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def isTeamcityBuild = hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
|
def isTeamcityBuild = hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
|
||||||
def includeUltimate = hasProperty("intellijUltimateEnabled") && intellijUltimateEnabled != 'false'
|
if (flags.kotlinUltimateExists && (isTeamcityBuild || flags.intellijUltimateEnabled)) {
|
||||||
if (isTeamcityBuild || includeUltimate) {
|
|
||||||
include(
|
include(
|
||||||
":ultimate",
|
":kotlin-ultimate:ultimate",
|
||||||
":ultimate:ultimate-runner"
|
":kotlin-ultimate:ultimate:ultimate-runner"
|
||||||
)
|
)
|
||||||
|
logger.info("Including extension for IJ Ultimate in settings.gradle")
|
||||||
|
} else {
|
||||||
|
logger.info("NOT including extension for IJ Ultimate in settings.gradle")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags.inJpsBuildIdeaSync) {
|
if (flags.inJpsBuildIdeaSync) {
|
||||||
|
|||||||
Reference in New Issue
Block a user