diff --git a/.bunch b/.bunch
index 9b679f675ed..7f8a276f72d 100644
--- a/.bunch
+++ b/.bunch
@@ -7,3 +7,4 @@ as33
as34_183
183
191_183
+cidr183_183
diff --git a/.gitignore b/.gitignore
index e7b4249ebf3..683e2796354 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,3 +38,4 @@ build/
.idea/compiler.xml
.idea/inspectionProfiles/profiles_settings.xml
.idea/.name
+kotlin-ultimate/
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
index 095c4ec1a4d..7e4b61cdb63 100644
--- a/.idea/vcs.xml
+++ b/.idea/vcs.xml
@@ -24,6 +24,6 @@
+
-
-
+
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index e0e83daf0ed..ec6676beb13 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -76,9 +76,17 @@ allprojects {
extra["kotlin_root"] = rootDir
val cidrKotlinPlugin by configurations.creating
+val appcodeKotlinPlugin by configurations.creating
+val clionKotlinPlugin by configurations.creating
+
+val includeCidr by extra(project.getBooleanProperty("cidrPluginsEnabled") ?: false)
dependencies {
- cidrKotlinPlugin(project(":prepare:cidr-plugin", "runtimeJar"))
+ if (includeCidr) {
+ cidrKotlinPlugin(project(":prepare:cidr-plugin", "runtimeJar"))
+ appcodeKotlinPlugin(project(":prepare:appcode-plugin", "runtimeJar"))
+ clionKotlinPlugin(project(":prepare:clion-plugin", "runtimeJar"))
+ }
}
val commonBuildDir = File(rootDir, "build")
@@ -88,9 +96,13 @@ val distLibDir = "$distKotlinHomeDir/lib"
val commonLocalDataDir = "$rootDir/local"
val ideaSandboxDir = "$commonLocalDataDir/ideaSandbox"
val ideaUltimateSandboxDir = "$commonLocalDataDir/ideaUltimateSandbox"
+val clionSandboxDir = "$commonLocalDataDir/clionSandbox"
+val appcodeSandboxDir = "$commonLocalDataDir/appcodeSandbox"
val ideaPluginDir = "$distDir/artifacts/ideaPlugin/Kotlin"
val ideaUltimatePluginDir = "$distDir/artifacts/ideaUltimatePlugin/Kotlin"
val cidrPluginDir = "$distDir/artifacts/cidrPlugin/Kotlin"
+val appcodePluginDir = "$distDir/artifacts/appcodePlugin/kotlinNative-appcode"
+val clionPluginDir = "$distDir/artifacts/clionPlugin/kotlinNative-clion"
// TODO: use "by extra()" syntax where possible
extra["distLibDir"] = project.file(distLibDir)
@@ -98,9 +110,13 @@ extra["libsDir"] = project.file(distLibDir)
extra["commonLocalDataDir"] = project.file(commonLocalDataDir)
extra["ideaSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaUltimateSandboxDir"] = project.file(ideaUltimateSandboxDir)
+extra["clionSandboxDir"] = project.file(ideaSandboxDir)
+extra["appcodeSandboxDir"] = project.file(ideaSandboxDir)
extra["ideaPluginDir"] = project.file(ideaPluginDir)
extra["ideaUltimatePluginDir"] = project.file(ideaUltimatePluginDir)
extra["cidrPluginDir"] = project.file(cidrPluginDir)
+extra["appcodePluginDir"] = project.file(appcodePluginDir)
+extra["clionPluginDir"] = project.file(clionPluginDir)
extra["isSonatypeRelease"] = false
// Work-around necessary to avoid setting null javaHome. Will be removed after support of lazy task configuration
@@ -431,6 +447,8 @@ tasks {
delete(ideaPluginDir)
delete(ideaUltimatePluginDir)
delete(cidrPluginDir)
+ delete(appcodePluginDir)
+ delete(clionPluginDir)
}
}
@@ -633,9 +651,19 @@ val zipPlugin by task {
}
}
-val cidrPlugin by task {
+fun cidrPlugin(product: String, pluginDir: String) = tasks.creating(Copy::class.java) {
+ if (!includeCidr) {
+ throw GradleException("CIDR plugins require 'cidrPluginsEnabled' property turned on")
+ }
+ val prepareCidrPlugin = getTasksByName("cidrPlugin", true)
+ val prepareCurrentPlugin = (getTasksByName(product.toLowerCase() + "Plugin", true) - this)
+ prepareCurrentPlugin.forEach { it.mustRunAfter(prepareCidrPlugin) }
+
dependsOn(ideaPlugin)
- into(cidrPluginDir)
+ dependsOn(prepareCidrPlugin)
+ dependsOn(prepareCurrentPlugin)
+
+ into(pluginDir)
from(ideaPluginDir) {
exclude("lib/kotlin-plugin.jar")
@@ -651,17 +679,18 @@ val cidrPlugin by task {
exclude("lib/maven-ide.jar")
}
from(cidrKotlinPlugin) { into("lib") }
+ from(configurations[product.toLowerCase() + "KotlinPlugin"]) { into("lib") }
}
-val zipCidrPlugin by task {
+fun zipCidrPlugin(product: String) = tasks.creating(Zip::class.java) {
val destPath = project.findProperty("pluginZipPath") as String?
- ?: "$distDir/artifacts/kotlin-plugin-$kotlinVersion-CIDR.zip"
+ ?: "$distDir/artifacts/kotlinNative-plugin-$kotlinVersion-$product.zip"
val destFile = File(destPath)
destinationDir = destFile.parentFile
archiveName = destFile.name
- from(cidrPlugin)
+ from(tasks[product.toLowerCase() + "Plugin"])
into("Kotlin")
setExecutablePermissions()
@@ -670,6 +699,14 @@ val zipCidrPlugin by task {
}
}
+if (includeCidr) {
+ val appcodePlugin by cidrPlugin("AppCode", appcodePluginDir)
+ val zipAppCodePlugin by zipCidrPlugin("AppCode")
+
+ val clionPlugin by cidrPlugin("CLion", clionPluginDir)
+ val zipCLionPlugin by zipCidrPlugin("CLion")
+}
+
configure {
module {
excludeDirs = files(
diff --git a/gradle.properties.cidr183 b/gradle.properties.cidr183
new file mode 100644
index 00000000000..3b60eea5ccf
--- /dev/null
+++ b/gradle.properties.cidr183
@@ -0,0 +1,15 @@
+org.gradle.daemon=true
+org.gradle.parallel=false
+org.gradle.configureondemand=false
+org.gradle.jvmargs=-Duser.country=US -Dkotlin.daemon.jvm.options=-Xmx1600m
+
+cacheRedirectorEnabled=true
+
+kotlin.compiler.effectSystemEnabled=true
+kotlin.compiler.newInferenceEnabled=true
+#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
+#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
+#bootstrap.kotlin.version=1.1.50-dev-1451
+#signingRequired=true
+
+cidrPluginsEnabled=true
diff --git a/idea-runner/build.gradle.kts b/idea-runner/build.gradle.kts
index be7bfa48925..b0c982db931 100644
--- a/idea-runner/build.gradle.kts
+++ b/idea-runner/build.gradle.kts
@@ -17,6 +17,10 @@ dependencies {
val ideaPluginDir: File by rootProject.extra
val ideaSandboxDir: File by rootProject.extra
+val clionPluginDir: File by rootProject.extra
+val clionSandboxDir: File by rootProject.extra
+val appcodePluginDir: File by rootProject.extra
+val appcodeSandboxDir: File by rootProject.extra
runIdeTask("runIde", ideaPluginDir, ideaSandboxDir) {
dependsOn(":dist", ":ideaPlugin")
diff --git a/prepare/appcode-plugin/build.gradle.kts b/prepare/appcode-plugin/build.gradle.kts
new file mode 100644
index 00000000000..f8a005a4f01
--- /dev/null
+++ b/prepare/appcode-plugin/build.gradle.kts
@@ -0,0 +1,94 @@
+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+import com.github.jk1.tcdeps.KotlinScriptDslAdapter.teamcityServer
+import com.github.jk1.tcdeps.KotlinScriptDslAdapter.tc
+import org.gradle.kotlin.dsl.support.zipTo
+
+apply {
+ plugin("kotlin")
+}
+
+plugins {
+ id("com.github.jk1.tcdeps") version "0.17"
+}
+
+repositories {
+ teamcityServer {
+ setUrl("http://buildserver.labs.intellij.net")
+ credentials {
+ username = "guest"
+ password = "guest"
+ }
+ }
+}
+
+val cidrPluginDir: File by rootProject.extra
+val appcodePluginDir: File by rootProject.extra
+val appcodeVersion = rootProject.extra["versions.appcode"] as String
+val appcodeVersionRepo = rootProject.extra["versions.appcode.repo"] as String
+
+val cidrPlugin by configurations.creating
+val platformDepsZip by configurations.creating
+
+val pluginXmlPath = "META-INF/plugin.xml"
+val platformDepsJarName = "kotlinNative-platformDeps.jar"
+
+// Do not rename, used in JPS importer
+val projectsToShadow by extra(listOf(
+ ":kotlin-ultimate:cidr-native",
+ ":kotlin-ultimate:appcode-native"))
+
+
+dependencies {
+ cidrPlugin(project(":prepare:cidr-plugin"))
+ platformDepsZip(tc("$appcodeVersionRepo:$appcodeVersion:OC-plugins/kotlinNative-platformDeps-$appcodeVersion.zip"))
+}
+
+val kotlinPluginXml by tasks.creating {
+ inputs.files(cidrPlugin)
+ outputs.files(fileFrom(buildDir, name, "META-INF/KotlinPlugin.xml"))
+
+ doFirst {
+ val pluginXmlText = zipTree(inputs.files.singleFile)
+ .matching { include(pluginXmlPath) }
+ .singleFile
+ .readText()
+ outputs.files.singleFile.writeText(pluginXmlText)
+ }
+}
+
+val jar = runtimeJar {
+ archiveName = "kotlin-plugin.jar"
+ dependsOn(cidrPlugin)
+ from(kotlinPluginXml) { into("META-INF") }
+
+ from {
+ zipTree(cidrPlugin.singleFile).matching {
+ exclude(pluginXmlPath)
+ }
+ }
+
+ for (p in projectsToShadow) {
+ dependsOn("$p:classes")
+ from(getSourceSetsFrom(p)["main"].output)
+ }
+}
+
+val platformDepsJar by task {
+ archiveName = platformDepsJarName
+ val platformDepsJar = zipTree(platformDepsZip.singleFile).matching { include("**/$platformDepsJarName") }.singleFile
+ from(zipTree(platformDepsJar)) {
+ exclude(pluginXmlPath)
+ }
+}
+
+task("appcodePlugin") {
+ into(appcodePluginDir)
+ from(cidrPluginDir) { exclude("lib/kotlin-plugin.jar") }
+ from(jar) { into("lib") }
+ from(platformDepsJar) { into("lib") }
+ from(zipTree(platformDepsZip.singleFile).files) {
+ exclude("**/$platformDepsJarName")
+ into("lib")
+ }
+ from(File(project(":kotlin-ultimate:appcode-native").projectDir, "templates")) { into("templates") }
+}
diff --git a/prepare/cidr-plugin/build.gradle.kts b/prepare/cidr-plugin/build.gradle.kts
index 95627a2c0d5..c0e49da42b2 100644
--- a/prepare/cidr-plugin/build.gradle.kts
+++ b/prepare/cidr-plugin/build.gradle.kts
@@ -22,7 +22,7 @@ dependencies {
val pluginXml by tasks.creating {
val kotlinVersion: String by rootProject.extra
val pluginFullVersionNumber = findProperty("pluginVersion") as? String
- ?: "$kotlinVersion-CIDR"
+ ?: "$kotlinVersion-CIDR"
inputs.property("pluginFullVersionNumber", pluginFullVersionNumber)
inputs.files(kotlinPlugin)
@@ -30,8 +30,8 @@ val pluginXml by tasks.creating {
doFirst {
val placeholderRegex = Regex(
- """(.*)""",
- RegexOption.DOT_MATCHES_ALL)
+ """(.*)""",
+ RegexOption.DOT_MATCHES_ALL)
val excludeRegex = Regex(
"""(.*?)""",
@@ -65,6 +65,5 @@ val jar = runtimeJar {
task("cidrPlugin") {
into(cidrPluginDir)
- from(ideaPluginDir) { exclude("lib/kotlin-plugin.jar") }
from(jar) { into("lib") }
-}
\ No newline at end of file
+}
diff --git a/prepare/clion-plugin/build.gradle.kts b/prepare/clion-plugin/build.gradle.kts
new file mode 100644
index 00000000000..2026c8db1f9
--- /dev/null
+++ b/prepare/clion-plugin/build.gradle.kts
@@ -0,0 +1,93 @@
+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+import com.github.jk1.tcdeps.KotlinScriptDslAdapter.teamcityServer
+import com.github.jk1.tcdeps.KotlinScriptDslAdapter.tc
+
+apply {
+ plugin("kotlin")
+}
+
+plugins {
+ id("com.github.jk1.tcdeps") version "0.17"
+}
+
+repositories {
+ teamcityServer {
+ setUrl("http://buildserver.labs.intellij.net")
+ credentials {
+ username = "guest"
+ password = "guest"
+ }
+ }
+}
+
+val cidrPluginDir: File by rootProject.extra
+val clionPluginDir: File by rootProject.extra
+val clionVersion = rootProject.extra["versions.clion"] as String
+val clionVersionRepo = rootProject.extra["versions.clion.repo"] as String
+
+val cidrPlugin by configurations.creating
+val platformDepsZip by configurations.creating
+
+val pluginXmlPath = "META-INF/plugin.xml"
+val platformDepsJarName = "kotlinNative-platformDeps.jar"
+
+// Do not rename, used in JPS importer
+val projectsToShadow by extra(listOf(
+ ":kotlin-ultimate:cidr-native",
+ ":kotlin-ultimate:clion-native"))
+
+
+dependencies {
+ cidrPlugin(project(":prepare:cidr-plugin"))
+ platformDepsZip(tc("$clionVersionRepo:$clionVersion:CL-plugins/kotlinNative-platformDeps-$clionVersion.zip"))
+}
+
+val kotlinPluginXml by tasks.creating {
+ inputs.files(cidrPlugin)
+ outputs.files(fileFrom(buildDir, name, "META-INF/KotlinPlugin.xml"))
+
+ doFirst {
+ val pluginXmlText = zipTree(inputs.files.singleFile)
+ .matching { include(pluginXmlPath) }
+ .singleFile
+ .readText()
+ outputs.files.singleFile.writeText(pluginXmlText)
+ }
+}
+
+val jar = runtimeJar {
+ archiveName = "kotlin-plugin.jar"
+ dependsOn(cidrPlugin)
+ from(kotlinPluginXml) { into("META-INF") }
+
+ from {
+ zipTree(cidrPlugin.singleFile).matching {
+ exclude(pluginXmlPath)
+ }
+ }
+
+ for (p in projectsToShadow) {
+ dependsOn("$p:classes")
+ from(getSourceSetsFrom(p)["main"].output)
+ }
+}
+
+val platformDepsJar by task {
+ archiveName = platformDepsJarName
+ val platformDepsJar = zipTree(platformDepsZip.singleFile).matching { include("**/$platformDepsJarName") }.singleFile
+ from(zipTree(platformDepsJar)) {
+ exclude(pluginXmlPath)
+ }
+}
+
+task("clionPlugin") {
+ into(clionPluginDir)
+ from(cidrPluginDir) { exclude("lib/kotlin-plugin.jar") }
+ from(jar) { into("lib") }
+ from(platformDepsJar) { into("lib") }
+ from(zipTree(platformDepsZip.singleFile).files) {
+ exclude("**/$platformDepsJarName")
+ into("lib")
+ }
+ from(File(project(":kotlin-ultimate:clion-native").projectDir, "templates")) { into("templates") }
+}
diff --git a/settings.gradle b/settings.gradle
index 6cbae0bf19e..2f9b2a41fa0 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -208,6 +208,17 @@ include ":kotlin-build-common",
":kotlin-serialization-unshaded",
":kotlin-idl2k"
+
+def includeCidr = hasProperty("cidrPluginsEnabled") && cidrPluginsEnabled != 'false'
+if (includeCidr) {
+ include ":kotlin-ultimate:cidr-native",
+ ":kotlin-ultimate:appcode-native",
+ ":kotlin-ultimate:clion-native",
+ ":prepare:cidr-plugin",
+ ":prepare:appcode-plugin",
+ ":prepare:clion-plugin"
+}
+
def isTeamcityBuild = hasProperty("teamcity") || System.getenv("TEAMCITY_VERSION") != null
def includeUltimate = hasProperty("intellijUltimateEnabled") && intellijUltimateEnabled != 'false'
if (isTeamcityBuild || includeUltimate) {
diff --git a/versions.properties.cidr183 b/versions.properties.cidr183
new file mode 100644
index 00000000000..ad2f9f77263
--- /dev/null
+++ b/versions.properties.cidr183
@@ -0,0 +1,20 @@
+versions.intellijSdk=183.4284.36
+versions.androidBuildTools=r23.0.1
+versions.idea.NodeJS=181.3494.12
+# TODO: select appropriate 183 base build for AppCode
+versions.appcode=191.1411
+versions.appcode.repo=ijplatform_master_CIDR_AppCode_Installers
+versions.clion=183.4284.140
+versions.clion.repo=ijplatform_IjPlatform183_Cidr_CLion_PublicInstallers
+versions.jar.guava=25.1-jre
+versions.jar.groovy-all=2.4.15
+versions.jar.lombok-ast=0.2.3
+versions.jar.swingx-core=1.6.2-2
+versions.jar.kxml2=2.3.0
+versions.jar.streamex=0.6.7
+versions.jar.gson=2.8.5
+versions.jar.oro=2.0.8
+versions.jar.picocontainer=1.2
+versions.jar.asm-all=7.0
+ignore.jar.snappy-in-java=true
+versions.gradle-api=4.5.1