Revert "Provide custom ConstantAffectionResolver in JPS"
This reverts commit 772a935de6.
The API in Intellij was changed, now the issue can be fixed only in
182.* branches.
This commit is contained in:
@@ -4,7 +4,6 @@ apply { plugin("jps-compatible") }
|
||||
val compilerModules: Array<String> by rootProject.extra
|
||||
|
||||
dependencies {
|
||||
compileOnly(project(":jps-plugin:jps-services-declarations"))
|
||||
compile(project(":kotlin-build-common"))
|
||||
compile(project(":core:descriptors"))
|
||||
compile(project(":core:descriptors.jvm"))
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
/**
|
||||
* A hacky module to provide Intellij services declarations,
|
||||
* so Kotlin plugin can be compiled even when service API
|
||||
* is not present in all Intellij builds we support.
|
||||
*/
|
||||
|
||||
plugins { java }
|
||||
apply { plugin("jps-compatible") }
|
||||
|
||||
dependencies {
|
||||
compileOnly(intellijDep()) { includeJars("annotations", "util") }
|
||||
compileOnly(intellijDep("jps-standalone")) { includeJars("jps-builders") }
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
"main" { projectDefault() }
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2018 JetBrains s.r.o. 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.builders.java;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jps.builders.java.dependencyView.Callbacks;
|
||||
import org.jetbrains.jps.incremental.CompileContext;
|
||||
|
||||
/**
|
||||
* A "copy" of Intellij service unavailable in current builds,
|
||||
* so our plugin can be compiled against it (API is not yet merged in Intellij,
|
||||
* even then it would be available only in 182.* builds).
|
||||
*
|
||||
* // todo: remove when compatibility layers will be finished
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
public interface ConstantSearchProvider {
|
||||
@NotNull
|
||||
Callbacks.ConstantAffectionResolver getConstantSearch(@NotNull CompileContext context);
|
||||
}
|
||||
-1
@@ -1 +0,0 @@
|
||||
org.jetbrains.kotlin.jps.build.KotlinConstantSearchProvider
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright 2000-2018 JetBrains s.r.o. 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.build
|
||||
|
||||
import com.intellij.util.concurrency.FixedFuture
|
||||
import org.jetbrains.jps.builders.java.ConstantSearchProvider
|
||||
import org.jetbrains.jps.builders.java.dependencyView.Callbacks
|
||||
import org.jetbrains.jps.incremental.CompileContext
|
||||
import org.jetbrains.kotlin.incremental.LookupSymbol
|
||||
import org.jetbrains.kotlin.jps.incremental.withLookupStorage
|
||||
import java.io.File
|
||||
import java.util.concurrent.Future
|
||||
|
||||
class KotlinConstantSearchProvider : ConstantSearchProvider {
|
||||
override fun getConstantSearch(context: CompileContext): Callbacks.ConstantAffectionResolver =
|
||||
KotlinLookupConstantSearch(context)
|
||||
}
|
||||
|
||||
class KotlinLookupConstantSearch(context: CompileContext) : Callbacks.ConstantAffectionResolver {
|
||||
private val dataManager = context.projectDescriptor.dataManager
|
||||
|
||||
override fun request(
|
||||
ownerClassName: String,
|
||||
fieldName: String,
|
||||
accessFlags: Int,
|
||||
fieldRemoved: Boolean,
|
||||
accessChanged: Boolean
|
||||
): Future<Callbacks.ConstantAffection> {
|
||||
val paths = dataManager.withLookupStorage { storage ->
|
||||
storage.get(LookupSymbol(name = fieldName, scope = ownerClassName))
|
||||
}
|
||||
return FixedFuture(Callbacks.ConstantAffection(paths.map(::File)))
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,6 @@ include ":kotlin-build-common",
|
||||
":js:js.dce",
|
||||
":js:js.tests",
|
||||
":jps-plugin",
|
||||
":jps-plugin:jps-services-declarations",
|
||||
":kotlin-jps-plugin",
|
||||
":core:descriptors",
|
||||
":core:descriptors.jvm",
|
||||
|
||||
Reference in New Issue
Block a user