Build: Make toolsJarApi() helper for JPS build
This commit is contained in:
@@ -133,6 +133,12 @@ fun Project.firstFromJavaHomeThatExists(vararg paths: String, jdkHome: File = Fi
|
|||||||
logger.warn("Cannot find file by paths: ${paths.toList()} in $jdkHome")
|
logger.warn("Cannot find file by paths: ${paths.toList()} in $jdkHome")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun Project.toolsJarApi(): Any =
|
||||||
|
if (kotlinBuildProperties.isInJpsBuildIdeaSync)
|
||||||
|
files(toolsJarFile() ?: error("tools.jar is not found!"))
|
||||||
|
else
|
||||||
|
dependencies.project(":dependencies:tools-jar-api")
|
||||||
|
|
||||||
fun Project.toolsJar(): FileCollection = files(toolsJarFile() ?: error("tools.jar is not found!"))
|
fun Project.toolsJar(): FileCollection = files(toolsJarFile() ?: error("tools.jar is not found!"))
|
||||||
|
|
||||||
fun Project.toolsJarFile(jdkHome: File = File(this.property("JDK_18") as String)): File? =
|
fun Project.toolsJarFile(jdkHome: File = File(this.property("JDK_18") as String)): File? =
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ dependencies {
|
|||||||
compile(project(":kotlin-util-io"))
|
compile(project(":kotlin-util-io"))
|
||||||
compile(project(":compiler:ir.serialization.common"))
|
compile(project(":compiler:ir.serialization.common"))
|
||||||
|
|
||||||
compileOnly(project(":dependencies:tools-jar-api"))
|
compileOnly(toolsJarApi())
|
||||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
compileOnly(intellijCoreDep()) { includeJars("intellij-core") }
|
||||||
compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) }
|
compileOnly(intellijDep()) { includeIntellijCoreJarDependencies(project) }
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ dependencies {
|
|||||||
compile(kotlinStdlib())
|
compile(kotlinStdlib())
|
||||||
compile(project(":compiler:backend"))
|
compile(project(":compiler:backend"))
|
||||||
|
|
||||||
compileOnly(project(":dependencies:tools-jar-api"))
|
compileOnly(toolsJarApi())
|
||||||
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", rootProject = rootProject) }
|
compileOnly(intellijCoreDep()) { includeJars("intellij-core", "asm-all", rootProject = rootProject) }
|
||||||
|
|
||||||
testCompileOnly(project(":dependencies:tools-jar-api"))
|
testCompileOnly(toolsJarApi())
|
||||||
testCompile(project(":kotlin-test:kotlin-test-junit"))
|
testCompile(project(":kotlin-test:kotlin-test-junit"))
|
||||||
testCompile(commonDep("junit:junit"))
|
testCompile(commonDep("junit:junit"))
|
||||||
testCompile(intellijDep()) { includeJars("asm-all", rootProject = rootProject) }
|
testCompile(intellijDep()) { includeJars("asm-all", rootProject = rootProject) }
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ dependencies {
|
|||||||
compile(project(":idea:ide-common"))
|
compile(project(":idea:ide-common"))
|
||||||
compile(project(":idea:jvm-debugger:jvm-debugger-util"))
|
compile(project(":idea:jvm-debugger:jvm-debugger-util"))
|
||||||
|
|
||||||
compileOnly(project(":dependencies:tools-jar-api"))
|
compileOnly(toolsJarApi())
|
||||||
compileOnly(intellijDep())
|
compileOnly(intellijDep())
|
||||||
|
|
||||||
Platform[192].orHigher {
|
Platform[192].orHigher {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ dependencies {
|
|||||||
compile(project(":idea:idea-j2k"))
|
compile(project(":idea:idea-j2k"))
|
||||||
compile(project(":idea:jvm-debugger:jvm-debugger-util"))
|
compile(project(":idea:jvm-debugger:jvm-debugger-util"))
|
||||||
|
|
||||||
compileOnly(project(":dependencies:tools-jar-api"))
|
compileOnly(toolsJarApi())
|
||||||
Platform[192].orHigher {
|
Platform[192].orHigher {
|
||||||
compileOnly(intellijPluginDep("java"))
|
compileOnly(intellijPluginDep("java"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ dependencies {
|
|||||||
compile(project(":compiler:backend"))
|
compile(project(":compiler:backend"))
|
||||||
compile(project(":idea:ide-common"))
|
compile(project(":idea:ide-common"))
|
||||||
|
|
||||||
compileOnly(project(":dependencies:tools-jar-api"))
|
compileOnly(toolsJarApi())
|
||||||
compileOnly(intellijDep())
|
compileOnly(intellijDep())
|
||||||
Platform[192].orHigher {
|
Platform[192].orHigher {
|
||||||
compileOnly(intellijPluginDep("java"))
|
compileOnly(intellijPluginDep("java"))
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ dependencies {
|
|||||||
// TODO: get rid of this
|
// TODO: get rid of this
|
||||||
compile(project(":idea:jvm-debugger:eval4j"))
|
compile(project(":idea:jvm-debugger:eval4j"))
|
||||||
|
|
||||||
compileOnly(project(":dependencies:tools-jar-api"))
|
compileOnly(toolsJarApi())
|
||||||
|
|
||||||
Platform[192].orHigher {
|
Platform[192].orHigher {
|
||||||
compileOnly(intellijPluginDep("java"))
|
compileOnly(intellijPluginDep("java"))
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ plugins {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile(kotlinStdlib())
|
compile(kotlinStdlib())
|
||||||
compileOnly(project(":dependencies:tools-jar-api"))
|
compileOnly(toolsJarApi())
|
||||||
|
|
||||||
testCompile(commonDep("junit:junit"))
|
testCompile(commonDep("junit:junit"))
|
||||||
testCompileOnly(project(":dependencies:tools-jar-api"))
|
testCompileOnly(toolsJarApi())
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ dependencies {
|
|||||||
compile(project(":compiler:frontend.java"))
|
compile(project(":compiler:frontend.java"))
|
||||||
compile(project(":compiler:plugin-api"))
|
compile(project(":compiler:plugin-api"))
|
||||||
|
|
||||||
compileOnly(project(":dependencies:tools-jar-api"))
|
compileOnly(toolsJarApi())
|
||||||
compileOnly(project(":kotlin-annotation-processing-cli"))
|
compileOnly(project(":kotlin-annotation-processing-cli"))
|
||||||
compileOnly(project(":kotlin-annotation-processing-base"))
|
compileOnly(project(":kotlin-annotation-processing-base"))
|
||||||
compileOnly(project(":kotlin-annotation-processing-runtime"))
|
compileOnly(project(":kotlin-annotation-processing-runtime"))
|
||||||
@@ -40,7 +40,7 @@ dependencies {
|
|||||||
testCompile(commonDep("junit:junit"))
|
testCompile(commonDep("junit:junit"))
|
||||||
testCompile(project(":kotlin-annotation-processing-runtime"))
|
testCompile(project(":kotlin-annotation-processing-runtime"))
|
||||||
|
|
||||||
testCompileOnly(project(":dependencies:tools-jar-api"))
|
testCompileOnly(toolsJarApi())
|
||||||
testRuntimeOnly(toolsJar())
|
testRuntimeOnly(toolsJar())
|
||||||
|
|
||||||
embedded(project(":kotlin-annotation-processing-runtime")) { isTransitive = false }
|
embedded(project(":kotlin-annotation-processing-runtime")) { isTransitive = false }
|
||||||
|
|||||||
Reference in New Issue
Block a user