Build: Drop ultimate, cidr and kmm from the build (KTI-563)
This commit is contained in:
committed by
teamcityserver
parent
9a4ff6e201
commit
a4005cef19
@@ -69,7 +69,6 @@ rootProject.apply {
|
||||
}
|
||||
|
||||
val isTeamcityBuild = kotlinBuildProperties.isTeamcityBuild
|
||||
val intellijUltimateEnabled by extra(kotlinBuildProperties.intellijUltimateEnabled)
|
||||
val intellijSeparateSdks by extra(project.getBooleanProperty("intellijSeparateSdks") ?: false)
|
||||
|
||||
extra["intellijReleaseType"] = when {
|
||||
|
||||
@@ -15,7 +15,6 @@ plugins {
|
||||
base
|
||||
}
|
||||
|
||||
val intellijUltimateEnabled: Boolean by rootProject.extra
|
||||
val intellijReleaseType: String by rootProject.extra
|
||||
val intellijVersion = rootProject.extra["versions.intellijSdk"] as String
|
||||
val intellijVersionForIde = rootProject.intellijSdkVersionForIde()
|
||||
@@ -23,8 +22,6 @@ val asmVersion = rootProject.findProperty("versions.jar.asm-all") as String?
|
||||
val androidStudioRelease = rootProject.findProperty("versions.androidStudioRelease") as String?
|
||||
val androidStudioBuild = rootProject.findProperty("versions.androidStudioBuild") as String?
|
||||
val intellijSeparateSdks: Boolean by rootProject.extra
|
||||
val installIntellijCommunity = !intellijUltimateEnabled || intellijSeparateSdks
|
||||
val installIntellijUltimate = intellijUltimateEnabled && androidStudioRelease == null
|
||||
|
||||
fun checkIntellijVersion(intellijVersion: String) {
|
||||
val intellijVersionDelimiterIndex = intellijVersion.indexOfAny(charArrayOf('.', '-'))
|
||||
@@ -35,14 +32,11 @@ fun checkIntellijVersion(intellijVersion: String) {
|
||||
checkIntellijVersion(intellijVersion)
|
||||
intellijVersionForIde?.let { checkIntellijVersion(it) }
|
||||
|
||||
logger.info("intellijUltimateEnabled: $intellijUltimateEnabled")
|
||||
logger.info("intellijVersion: $intellijVersion")
|
||||
logger.info("intellijVersionForIde: $intellijVersionForIde")
|
||||
logger.info("androidStudioRelease: $androidStudioRelease")
|
||||
logger.info("androidStudioBuild: $androidStudioBuild")
|
||||
logger.info("intellijSeparateSdks: $intellijSeparateSdks")
|
||||
logger.info("installIntellijCommunity: $installIntellijCommunity")
|
||||
logger.info("installIntellijUltimate: $installIntellijUltimate")
|
||||
|
||||
val androidStudioOs by lazy {
|
||||
when {
|
||||
@@ -78,8 +72,6 @@ repositories {
|
||||
|
||||
val intellij by configurations.creating
|
||||
val intellijForIde by configurations.creating
|
||||
val intellijUltimate by configurations.creating
|
||||
val intellijUltimateForIde by configurations.creating
|
||||
val androidStudio by configurations.creating
|
||||
val sources by configurations.creating
|
||||
val sourcesForIde by configurations.creating
|
||||
@@ -113,14 +105,8 @@ dependencies {
|
||||
|
||||
androidStudio("google:android-studio-ide:$androidStudioBuild@$extension")
|
||||
} else {
|
||||
if (installIntellijCommunity) {
|
||||
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
|
||||
intellijVersionForIde?.let { intellijForIde("com.jetbrains.intellij.idea:ideaIC:$it") }
|
||||
}
|
||||
if (installIntellijUltimate) {
|
||||
intellijUltimate("com.jetbrains.intellij.idea:ideaIU:$intellijVersion")
|
||||
intellijVersionForIde.let { intellijUltimateForIde("com.jetbrains.intellij.idea:ideaIU:$it") }
|
||||
}
|
||||
intellij("com.jetbrains.intellij.idea:ideaIC:$intellijVersion")
|
||||
intellijVersionForIde?.let { intellijForIde("com.jetbrains.intellij.idea:ideaIC:$it") }
|
||||
}
|
||||
|
||||
if (asmVersion != null) {
|
||||
@@ -133,19 +119,14 @@ dependencies {
|
||||
intellijVersionForIde?.let { jpsStandaloneForIde("com.jetbrains.intellij.idea:jps-standalone:$it") }
|
||||
intellijCore("com.jetbrains.intellij.idea:intellij-core:$intellijVersion")
|
||||
intellijVersionForIde?.let { intellijCoreForIde("com.jetbrains.intellij.idea:intellij-core:$it") }
|
||||
if (intellijUltimateEnabled) {
|
||||
nodeJSPlugin("com.jetbrains.plugins:NodeJS:${rootProject.extra["versions.idea.NodeJS"]}@zip")
|
||||
}
|
||||
}
|
||||
|
||||
fun prepareDeps(
|
||||
intellij: Configuration,
|
||||
intellijCore: Configuration,
|
||||
sources: Configuration,
|
||||
intellijUltimate: Configuration,
|
||||
jpsStandalone: Configuration,
|
||||
intellijVersion: String,
|
||||
registerNodeJSPlugin: Boolean = false
|
||||
intellijVersion: String
|
||||
) {
|
||||
val makeIntellijCore = buildIvyRepositoryTask(intellijCore, customDepsOrg, customDepsRepoDir)
|
||||
|
||||
@@ -207,11 +188,7 @@ fun prepareDeps(
|
||||
::skipToplevelDirectory
|
||||
)
|
||||
} else {
|
||||
val task = if (installIntellijUltimate) {
|
||||
buildIvyRepositoryTask(intellijUltimate, customDepsOrg, customDepsRepoDir, null, sourcesFile)
|
||||
} else {
|
||||
buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
|
||||
}
|
||||
val task = buildIvyRepositoryTask(intellij, customDepsOrg, customDepsRepoDir, null, sourcesFile)
|
||||
|
||||
task.configure {
|
||||
dependsOn(mergeSources)
|
||||
@@ -230,17 +207,11 @@ fun prepareDeps(
|
||||
makeIntellijAnnotations
|
||||
)
|
||||
}
|
||||
|
||||
if (registerNodeJSPlugin && installIntellijUltimate) {
|
||||
val buildNodeJsPlugin =
|
||||
buildIvyRepositoryTask(nodeJSPlugin, customDepsOrg, customDepsRepoDir, ::skipToplevelDirectory, sourcesFile)
|
||||
tasks.named("build") { dependsOn(buildNodeJsPlugin) }
|
||||
}
|
||||
}
|
||||
|
||||
prepareDeps(intellij, intellijCore, sources, intellijUltimate, jpsStandalone, intellijVersion, registerNodeJSPlugin = true)
|
||||
prepareDeps(intellij, intellijCore, sources, jpsStandalone, intellijVersion)
|
||||
if (intellijVersionForIde != null) {
|
||||
prepareDeps(intellijForIde, intellijCoreForIde, sourcesForIde, intellijUltimateForIde, jpsStandaloneForIde, intellijVersionForIde)
|
||||
prepareDeps(intellijForIde, intellijCoreForIde, sourcesForIde, jpsStandaloneForIde, intellijVersionForIde)
|
||||
}
|
||||
|
||||
tasks.named<Delete>("clean") {
|
||||
|
||||
@@ -25,49 +25,4 @@ buildscript {
|
||||
}
|
||||
}
|
||||
|
||||
def buildProperties = BuildPropertiesKt.getKotlinBuildPropertiesForSettings(settings)
|
||||
def projectVersions = file("../gradle/versions.properties").text
|
||||
|
||||
include "prepare-deps"
|
||||
|
||||
def target_AppCode_Clion = buildProperties.includeCidrPlugins && !projectVersions.contains("versions.androidStudioRelease")
|
||||
def target_AndroidStudio = buildProperties.includeCidrPlugins && projectVersions.contains("versions.androidStudioRelease")
|
||||
def target_IdeaUltimate = buildProperties.includeUltimate
|
||||
|
||||
if (target_AppCode_Clion) {
|
||||
logger.info("Including modules for AC and CL in buildSrc/settings.gradle")
|
||||
|
||||
include ":prepare-deps:kotlin-native-platform-deps"
|
||||
include ":prepare-deps:native-debug-plugin"
|
||||
|
||||
project(":prepare-deps:kotlin-native-platform-deps").projectDir =
|
||||
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/kotlin-native-platform-deps")
|
||||
project(":prepare-deps:native-debug-plugin").projectDir =
|
||||
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
|
||||
} else if (target_AndroidStudio) {
|
||||
logger.info("Including modules for AS (mobile plugin) in buildSrc/settings.gradle")
|
||||
|
||||
include ":prepare-deps:appcode-binaries"
|
||||
include ":prepare-deps:lldb-framework"
|
||||
include ":prepare-deps:lldb-frontend"
|
||||
|
||||
project(":prepare-deps:appcode-binaries").projectDir =
|
||||
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/appcode-binaries")
|
||||
project(":prepare-deps:lldb-framework").projectDir =
|
||||
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-framework")
|
||||
project(":prepare-deps:lldb-frontend").projectDir =
|
||||
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
|
||||
} else if (target_IdeaUltimate) {
|
||||
logger.info("Including modules for IU in buildSrc/settings.gradle")
|
||||
|
||||
include ":prepare-deps:lldb-frontend"
|
||||
include ":prepare-deps:native-debug-plugin"
|
||||
|
||||
project(":prepare-deps:lldb-frontend").projectDir =
|
||||
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/lldb-frontend")
|
||||
project(":prepare-deps:native-debug-plugin").projectDir =
|
||||
file("${buildProperties.propertiesProvider.rootProjectDir}/kotlin-ultimate/buildSrc/prepare-deps/native-debug-plugin")
|
||||
|
||||
} else {
|
||||
logger.info("Not including extra modules in buildSrc/settings.gradle")
|
||||
}
|
||||
include "prepare-deps"
|
||||
@@ -91,12 +91,6 @@ fun Project.preloadedDeps(
|
||||
return files(*matchingFiles.map { it.canonicalPath }.toTypedArray())
|
||||
}
|
||||
|
||||
fun Project.ideaUltimatePreloadedDeps(vararg artifactBaseNames: String, subdir: String? = null): ConfigurableFileCollection {
|
||||
val ultimateDepsDir = fileFrom(rootDir, "ultimate", "dependencies")
|
||||
return if (ultimateDepsDir.isDirectory) preloadedDeps(*artifactBaseNames, baseDir = ultimateDepsDir, subdir = subdir)
|
||||
else files()
|
||||
}
|
||||
|
||||
fun Project.kotlinDep(artifactBaseName: String, version: String, classifier: String? = null): String =
|
||||
listOfNotNull("org.jetbrains.kotlin:kotlin-$artifactBaseName:$version", classifier).joinToString(":")
|
||||
|
||||
|
||||
@@ -37,9 +37,7 @@ private fun Project.kotlinBuildLocalRepoDir(): File = kotlinBuildLocalDependenci
|
||||
|
||||
fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) {
|
||||
Ide.Kind.AndroidStudio -> "android-studio-ide"
|
||||
Ide.Kind.IntelliJ -> {
|
||||
if (kotlinBuildProperties.intellijUltimateEnabled) "ideaIU" else "ideaIC"
|
||||
}
|
||||
Ide.Kind.IntelliJ -> "ideaIC"
|
||||
}
|
||||
|
||||
private fun Project.ideModuleVersion(forIde: Boolean) = when (IdeVersionConfigurator.currentIde.kind) {
|
||||
@@ -110,10 +108,6 @@ fun Project.intellijRuntimeAnnotations() = "kotlin.build:intellij-runtime-annota
|
||||
|
||||
fun Project.intellijPluginDep(plugin: String, forIde: Boolean = false) = intellijDep(plugin, forIde)
|
||||
|
||||
fun Project.intellijUltimateDep() = intellijDep("ideaIU")
|
||||
|
||||
fun Project.intellijUltimatePluginDep(plugin: String) = intellijDep(plugin)
|
||||
|
||||
fun ModuleDependency.includeJars(vararg names: String, rootProject: Project? = null) {
|
||||
names.forEach {
|
||||
var baseName = it.removeSuffix(".jar")
|
||||
@@ -152,19 +146,8 @@ fun ModuleDependency.includeIntellijCoreJarDependencies(project: Project, jarsFi
|
||||
rootProject = project.rootProject
|
||||
)
|
||||
|
||||
fun Project.isIntellijCommunityAvailable() =
|
||||
!(rootProject.extra["intellijUltimateEnabled"] as Boolean) || rootProject.extra["intellijSeparateSdks"] as Boolean
|
||||
|
||||
fun Project.isIntellijUltimateSdkAvailable() = (rootProject.extra["intellijUltimateEnabled"] as Boolean)
|
||||
|
||||
fun Project.intellijRootDir() = IntellijRootUtils.getIntellijRootDir(project)
|
||||
|
||||
fun Project.intellijUltimateRootDir() =
|
||||
if (isIntellijUltimateSdkAvailable())
|
||||
File(kotlinBuildLocalRepoDir(), "kotlin.build/ideaIU/${rootProject.extra["versions.intellijSdk"]}/artifacts")
|
||||
else
|
||||
throw GradleException("intellij ultimate SDK is not available")
|
||||
|
||||
fun DependencyHandlerScope.excludeInAndroidStudio(rootProject: Project, block: DependencyHandlerScope.() -> Unit) {
|
||||
if (!rootProject.extra.has("versions.androidStudioRelease")) {
|
||||
block()
|
||||
@@ -198,7 +181,7 @@ fun Project.runIdeTask(name: String, ideaPluginDir: File, ideaSandboxDir: File,
|
||||
"-Dplugin.path=${ideaPluginDir.absolutePath}"
|
||||
)
|
||||
|
||||
if (Platform[201].orHigher() && !isIntellijUltimateSdkAvailable()) {
|
||||
if (Platform[201].orHigher()) {
|
||||
jvmArgs("-Didea.platform.prefix=Idea")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user