Kotlin JPS: Inject KOTLIN_BUNDLED macro into JPS
KTIJ-21292
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
This module contains fake/stub IJ JPS API platform signatures from newer IJ platforms
|
||||
(newer compared to the IJ platform Kotlin repository currently depends on).
|
||||
|
||||
We need this module to copy-paste necessary IJ JPS API signature definitions into the Kotlin repository.
|
||||
Copy-pasting signature definitions gives us an ability to use new JPS API which is not yet available
|
||||
in the platform the Kotlin repository currently depends on.
|
||||
|
||||
This module output SHOULD NOT be packed into Kotlin JPS plugin artifact.
|
||||
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
kotlin("jvm")
|
||||
id("jps-compatible")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(kotlinStdlib())
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.jps.model.serialization;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* This API exists starting from 221 IDEA
|
||||
*
|
||||
* Copy-pasted from https://github.com/JetBrains/intellij-community/blob/master/jps/model-serialization/src/org/jetbrains/jps/model/serialization/JpsPathMacroContributor.java
|
||||
*/
|
||||
public interface JpsPathMacroContributor {
|
||||
@NotNull
|
||||
Map<String, String> getPathMacros();
|
||||
}
|
||||
@@ -24,6 +24,7 @@ dependencies {
|
||||
api(project(":daemon-common-new"))
|
||||
api(project(":kotlin-daemon-client"))
|
||||
api(project(":kotlin-daemon"))
|
||||
compileOnly(project(":jps:jps-platform-api-signatures"))
|
||||
testImplementation(projectTests(":generators:test-generator"))
|
||||
api(project(":compiler:frontend.java"))
|
||||
api(project(":js:js.frontend"))
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.jps.KotlinJpsPathMacrosContributor
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.jps
|
||||
|
||||
import org.jetbrains.jps.model.serialization.JpsPathMacroContributor
|
||||
|
||||
class KotlinJpsPathMacrosContributor : JpsPathMacroContributor {
|
||||
override fun getPathMacros(): Map<String, String> =
|
||||
System.getProperty("jps.kotlin.home")
|
||||
?.let { mapOf("KOTLIN_BUNDLED" to it) }
|
||||
?: emptyMap()
|
||||
}
|
||||
+2
-1
@@ -526,7 +526,8 @@ if (attachedIntellijVersion == "master") {
|
||||
}
|
||||
|
||||
include ":jps:jps-common",
|
||||
":jps:jps-plugin"
|
||||
":jps:jps-plugin",
|
||||
":jps:jps-platform-api-signatures"
|
||||
|
||||
include ":generators:analysis-api-generator",
|
||||
":analysis",
|
||||
|
||||
Reference in New Issue
Block a user