Convert ultimate runner to intellij plugin
This commit is contained in:
committed by
Vyacheslav Gerasimov
parent
5d3579c079
commit
10732a1bdd
@@ -1,8 +1,14 @@
|
|||||||
|
import org.jetbrains.intellij.IntelliJPluginExtension
|
||||||
|
import org.jetbrains.intellij.tasks.PrepareSandboxTask
|
||||||
|
import org.jetbrains.intellij.tasks.RunIdeTask
|
||||||
|
|
||||||
apply { plugin("kotlin") }
|
apply { plugin("kotlin") }
|
||||||
|
|
||||||
dependencies {
|
configureIntellijPlugin {
|
||||||
|
version = (rootProject.extra["versions.intellij"] as String).replaceFirst("IC-", "IU-")
|
||||||
|
}
|
||||||
|
|
||||||
compile(ideaUltimateSdkDeps("*.jar"))
|
dependencies {
|
||||||
compileOnly(project(":idea"))
|
compileOnly(project(":idea"))
|
||||||
compileOnly(project(":idea:idea-maven"))
|
compileOnly(project(":idea:idea-maven"))
|
||||||
compileOnly(project(":idea:idea-gradle"))
|
compileOnly(project(":idea:idea-gradle"))
|
||||||
@@ -11,38 +17,51 @@ dependencies {
|
|||||||
runtimeOnly(files(toolsJar()))
|
runtimeOnly(files(toolsJar()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
dependencies {
|
||||||
|
compileOnly(intellij())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val runUltimate by task<JavaExec> {
|
afterEvaluate {
|
||||||
dependsOn(":dist", ":prepare:idea-plugin:idea-plugin", ":ideaPlugin", ":ultimate:idea-ultimate-plugin")
|
|
||||||
|
|
||||||
classpath = the<JavaPluginConvention>().sourceSets["main"].runtimeClasspath
|
|
||||||
|
|
||||||
main = "com.intellij.idea.Main"
|
|
||||||
|
|
||||||
workingDir = File(projectDir.parentFile, "ideaSDK", "bin")
|
|
||||||
|
|
||||||
val ideaUltimatePluginDir: File by rootProject.extra
|
val ideaUltimatePluginDir: File by rootProject.extra
|
||||||
|
val ideaUltimateSandboxDir: File by rootProject.extra
|
||||||
|
|
||||||
jvmArgs(
|
tasks.findByName("runIde")?.let { tasks.remove(it) }
|
||||||
"-Xmx1250m",
|
tasks.findByName("prepareSandbox")?.let { tasks.remove(it) }
|
||||||
"-XX:ReservedCodeCacheSize=240m",
|
|
||||||
"-XX:+HeapDumpOnOutOfMemoryError",
|
|
||||||
"-ea",
|
|
||||||
"-Didea.is.internal=true",
|
|
||||||
"-Didea.debug.mode=true",
|
|
||||||
"-Didea.system.path=../system-idea",
|
|
||||||
"-Didea.config.path=../config-idea",
|
|
||||||
"-Dapple.laf.useScreenMenuBar=true",
|
|
||||||
"-Dapple.awt.graphics.UseQuartz=true",
|
|
||||||
"-Dsun.io.useCanonCaches=false",
|
|
||||||
"-Dplugin.path=${ideaUltimatePluginDir.absolutePath}",
|
|
||||||
"-Dkotlin.internal.mode.enabled=true",
|
|
||||||
"-Didea.additional.classpath=../idea-kotlin-runtime/kotlin-runtime.jar,../idea-kotlin-runtime/kotlin-reflect.jar"
|
|
||||||
)
|
|
||||||
|
|
||||||
if (project.hasProperty("noPCE")) {
|
val prepareSandbox by task<PrepareSandboxTask> {
|
||||||
jvmArgs("-Didea.ProcessCanceledException=disabled")
|
configDirectory = File(ideaUltimateSandboxDir, "config")
|
||||||
|
// the rest are just some "fake" values, to keeping PrepareSandboxTask happy
|
||||||
|
setPluginName("Kotlin")
|
||||||
|
dependsOn(":dist", ":prepare:idea-plugin:idea-plugin", ":ideaPlugin", ":ultimate:idea-ultimate-plugin")
|
||||||
|
setPluginJar(File(ideaUltimatePluginDir, "lib/kotlin-script-runtime.jar")) // any small jar will do
|
||||||
|
destinationDir = File(buildDir, "sandbox-fake")
|
||||||
}
|
}
|
||||||
|
|
||||||
args()
|
task<RunIdeTask>("runUltimate") {
|
||||||
}
|
dependsOn(":dist", ":prepare:idea-plugin:idea-plugin", ":ideaPlugin", ":ultimate:idea-ultimate-plugin")
|
||||||
|
dependsOn(prepareSandbox)
|
||||||
|
group = "intellij"
|
||||||
|
description = "Runs Intellij IDEA Ultimate with installed plugin."
|
||||||
|
setIdeaDirectory(the<IntelliJPluginExtension>().ideaDependency.classes)
|
||||||
|
setConfigDirectory(File(ideaUltimateSandboxDir, "config"))
|
||||||
|
setSystemDirectory(ideaUltimateSandboxDir)
|
||||||
|
setPluginsDirectory(ideaUltimatePluginDir.parent)
|
||||||
|
jvmArgs(
|
||||||
|
"-Xmx1250m",
|
||||||
|
"-XX:ReservedCodeCacheSize=240m",
|
||||||
|
"-XX:+HeapDumpOnOutOfMemoryError",
|
||||||
|
"-ea",
|
||||||
|
"-Didea.is.internal=true",
|
||||||
|
"-Didea.debug.mode=true",
|
||||||
|
"-Dapple.laf.useScreenMenuBar=true",
|
||||||
|
"-Dapple.awt.graphics.UseQuartz=true",
|
||||||
|
"-Dsun.io.useCanonCaches=false",
|
||||||
|
"-Dkotlin.internal.mode.enabled=true"
|
||||||
|
)
|
||||||
|
if (project.hasProperty("noPCE")) {
|
||||||
|
jvmArgs("-Didea.ProcessCanceledException=disabled")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user