Remove explicit registration of classFileDecompiler EP and core.xml
This commit is contained in:
committed by
TeamCityServer
parent
1b3046a61b
commit
ec99585eb9
@@ -48,51 +48,11 @@ compilerDummyJar(compilerDummyForDependenciesRewriting("compilerDummy") {
|
||||
archiveClassifier.set("dummy")
|
||||
})
|
||||
|
||||
class CoreXmlShadingTransformer : Transformer {
|
||||
companion object {
|
||||
private const val XML_NAME = "META-INF/extensions/core.xml"
|
||||
}
|
||||
|
||||
@kotlin.jvm.Transient
|
||||
private var content: StringBuilder? = StringBuilder()
|
||||
|
||||
private fun ensureStringBuilderExist() {
|
||||
if (content == null) {
|
||||
content = StringBuilder()
|
||||
}
|
||||
}
|
||||
|
||||
override fun canTransformResource(element: FileTreeElement): Boolean {
|
||||
return (element.name == XML_NAME)
|
||||
}
|
||||
|
||||
override fun transform(context: TransformerContext) {
|
||||
ensureStringBuilderExist()
|
||||
val text = context.`is`.bufferedReader().lines()
|
||||
.map { it.replace("com.intellij.psi", "org.jetbrains.kotlin.com.intellij.psi") }
|
||||
.collect(Collectors.joining("\n"))
|
||||
content!!.appendln(text)
|
||||
context.`is`.close()
|
||||
}
|
||||
|
||||
override fun hasTransformedResource(): Boolean {
|
||||
return content?.isNotEmpty() ?: false
|
||||
}
|
||||
|
||||
override fun modifyOutputStream(outputStream: ZipOutputStream, preserveFileTimestamps: Boolean) {
|
||||
if (content == null) return
|
||||
val entry = ZipEntry(XML_NAME)
|
||||
outputStream.putNextEntry(entry)
|
||||
outputStream.write(content.toString().toByteArray())
|
||||
}
|
||||
}
|
||||
|
||||
val runtimeJar = runtimeJar(embeddableCompiler()) {
|
||||
exclude("com/sun/jna/**")
|
||||
exclude("org/jetbrains/annotations/**")
|
||||
mergeServiceFiles()
|
||||
|
||||
transform(CoreXmlShadingTransformer::class.java)
|
||||
}
|
||||
|
||||
sourcesJar()
|
||||
|
||||
Reference in New Issue
Block a user