172: Restore compilation against Idea 172
Revert "Fix proguard settings for 173" 4dadae2e9c8419bfda9d77f56797e68edbd8ecd7. Revert "Fix compilation in 173" 0633aa925c8e862519ae699e5e3fe81a2bd227c2. Revert "Fix compilation (MockParameterInfoUIContext.java)" 01a7fbfb60d786c56c54f4fd77d9f1233f599ede. Revert "Fix compilation" 043a5dac796f6bf92bbe6c9573c1af07fadcfe4e. Revert "Fix compatibility with BuildScriptDataBuilder API changes" c7df054d0e90a86fbe67f23802e9be49b2117ded.
This commit is contained in:
@@ -0,0 +1,214 @@
|
||||
-injars '<kotlin-compiler-jar-before-shrink>'(
|
||||
!org/apache/log4j/jmx/Agent*,
|
||||
!org/apache/log4j/net/JMS*,
|
||||
!org/apache/log4j/net/SMTP*,
|
||||
!org/apache/log4j/or/jms/MessageRenderer*,
|
||||
!org/jdom/xpath/Jaxen*,
|
||||
!org/jline/builtins/ssh/**,
|
||||
!org/mozilla/javascript/xml/impl/xmlbeans/**,
|
||||
!net/sf/cglib/**,
|
||||
!META-INF/maven**,
|
||||
**.class,**.properties,**.kt,**.kotlin_*,**.jnilib,**.so,**.dll,**.txt,**.caps,
|
||||
META-INF/services/**,META-INF/native/**,META-INF/extensions/**,META-INF/MANIFEST.MF,
|
||||
messages/**)
|
||||
|
||||
-outjars '<kotlin-compiler-jar>'
|
||||
|
||||
-dontnote **
|
||||
-dontwarn com.intellij.util.ui.IsRetina*
|
||||
-dontwarn com.intellij.util.RetinaImage*
|
||||
-dontwarn apple.awt.*
|
||||
-dontwarn dk.brics.automaton.*
|
||||
-dontwarn org.fusesource.**
|
||||
-dontwarn org.imgscalr.Scalr**
|
||||
-dontwarn org.xerial.snappy.SnappyBundleActivator
|
||||
-dontwarn com.intellij.util.CompressionUtil
|
||||
-dontwarn com.intellij.util.SnappyInitializer
|
||||
-dontwarn com.intellij.util.SVGLoader
|
||||
-dontwarn com.intellij.util.SVGLoader$MyTranscoder
|
||||
-dontwarn net.sf.cglib.**
|
||||
-dontwarn org.objectweb.asm.** # this is ASM3, the old version that we do not use
|
||||
-dontwarn com.sun.jna.NativeString
|
||||
-dontwarn com.sun.jna.WString
|
||||
-dontwarn com.intellij.psi.util.PsiClassUtil
|
||||
-dontwarn org.apache.hadoop.io.compress.*
|
||||
-dontwarn com.google.j2objc.annotations.Weak
|
||||
-dontwarn org.iq80.snappy.HadoopSnappyCodec$SnappyCompressionInputStream
|
||||
-dontwarn org.iq80.snappy.HadoopSnappyCodec$SnappyCompressionOutputStream
|
||||
-dontwarn com.google.common.util.concurrent.*
|
||||
-dontwarn org.apache.xerces.dom.**
|
||||
-dontwarn org.apache.xerces.util.**
|
||||
-dontwarn org.w3c.dom.ElementTraversal
|
||||
-dontwarn javaslang.match.annotation.Unapply
|
||||
-dontwarn javaslang.match.annotation.Patterns
|
||||
-dontwarn javaslang.*
|
||||
-dontwarn com.google.errorprone.**
|
||||
-dontwarn com.google.j2objc.**
|
||||
-dontwarn javax.crypto.**
|
||||
-dontwarn java.lang.invoke.MethodHandle
|
||||
-dontwarn org.jline.builtins.Nano$Buffer
|
||||
-dontwarn net.jpountz.lz4.LZ4Factory
|
||||
-dontwarn org.jetbrains.annotations.ReadOnly
|
||||
-dontwarn org.jetbrains.annotations.Mutable
|
||||
|
||||
#-libraryjars '<rtjar>'
|
||||
#-libraryjars '<jssejar>'
|
||||
#-libraryjars '<bootstrap.runtime>'
|
||||
#-libraryjars '<bootstrap.reflect>'
|
||||
#-libraryjars '<bootstrap.script.runtime>'
|
||||
#-libraryjars '<tools.jar>'
|
||||
|
||||
-dontoptimize
|
||||
-dontobfuscate
|
||||
|
||||
-keep class org.fusesource.** { *; }
|
||||
-keep class com.sun.jna.** { *; }
|
||||
|
||||
-keep class org.jetbrains.annotations.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keep class javax.inject.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keep class org.jetbrains.kotlin.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keep class org.jetbrains.kotlin.compiler.plugin.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keep class org.jetbrains.kotlin.extensions.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keep class org.jetbrains.kotlin.protobuf.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keep class org.jetbrains.kotlin.container.** { *; }
|
||||
|
||||
-keep class org.jetbrains.kotlin.codegen.intrinsics.IntrinsicArrayConstructorsKt { *; }
|
||||
|
||||
-keep class org.jetbrains.org.objectweb.asm.Opcodes { *; }
|
||||
|
||||
-keep class org.jetbrains.kotlin.codegen.extensions.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keepclassmembers class com.intellij.openapi.vfs.VirtualFile {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keep class com.intellij.openapi.vfs.StandardFileSystems {
|
||||
public static *;
|
||||
}
|
||||
|
||||
# needed for jar cache cleanup in the gradle plugin and compile daemon
|
||||
-keepclassmembers class com.intellij.openapi.vfs.impl.ZipHandler {
|
||||
public static void clearFileAccessorCache();
|
||||
}
|
||||
|
||||
-keep class jet.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keep class com.intellij.psi.** {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
# This is needed so that the platform code which parses XML wouldn't fail, see KT-16968
|
||||
# This API is used from org.jdom.input.SAXBuilder via reflection.
|
||||
-keep class org.jdom.input.JAXPParserFactory { public ** createParser(...); }
|
||||
|
||||
# for kdoc & dokka
|
||||
-keep class com.intellij.openapi.util.TextRange { *; }
|
||||
-keep class com.intellij.lang.impl.PsiBuilderImpl* {
|
||||
public protected *;
|
||||
}
|
||||
-keep class com.intellij.openapi.util.text.StringHash { *; }
|
||||
|
||||
# for j2k
|
||||
-keep class com.intellij.codeInsight.NullableNotNullManager { public protected *; }
|
||||
|
||||
# for gradle (see KT-12549)
|
||||
-keep class com.intellij.lang.properties.charset.Native2AsciiCharsetProvider { *; }
|
||||
|
||||
# for kotlin-build-common (consider repacking compiler together with kotlin-build-common and remove this part afterwards)
|
||||
-keep class com.intellij.util.io.IOUtil { public *; }
|
||||
-keep class com.intellij.openapi.util.io.FileUtil { public *; }
|
||||
-keep class com.intellij.util.SystemProperties { public *; }
|
||||
-keep class com.intellij.util.containers.hash.LinkedHashMap { *; }
|
||||
-keep class com.intellij.util.containers.ConcurrentIntObjectMap { *; }
|
||||
-keep class com.intellij.util.containers.ComparatorUtil { *; }
|
||||
-keep class com.intellij.util.io.PersistentHashMapValueStorage { *; }
|
||||
-keep class com.intellij.util.io.PersistentHashMap { *; }
|
||||
-keep class com.intellij.util.io.BooleanDataDescriptor { *; }
|
||||
-keep class com.intellij.util.io.EnumeratorStringDescriptor { *; }
|
||||
-keep class com.intellij.util.io.ExternalIntegerKeyDescriptor { *; }
|
||||
-keep class com.intellij.util.containers.hash.EqualityPolicy { *; }
|
||||
-keep class com.intellij.util.containers.hash.EqualityPolicy.* { *; }
|
||||
-keep class com.intellij.util.containers.Interner { *; }
|
||||
-keep class gnu.trove.TIntHashSet { *; }
|
||||
-keep class gnu.trove.TIntIterator { *; }
|
||||
-keep class org.iq80.snappy.SlowMemory { *; }
|
||||
-keep class javaslang.match.PatternsProcessor { *; }
|
||||
|
||||
-keepclassmembers enum * {
|
||||
public static **[] values();
|
||||
public static ** valueOf(java.lang.String);
|
||||
}
|
||||
|
||||
-keepclassmembers class * {
|
||||
** toString();
|
||||
** hashCode();
|
||||
void start();
|
||||
void stop();
|
||||
void dispose();
|
||||
}
|
||||
|
||||
-keepclassmembers class org.jetbrains.org.objectweb.asm.Opcodes {
|
||||
*** ASM5;
|
||||
}
|
||||
|
||||
-keep class org.jetbrains.org.objectweb.asm.tree.AnnotationNode { *; }
|
||||
-keep class org.jetbrains.org.objectweb.asm.tree.ClassNode { *; }
|
||||
-keep class org.jetbrains.org.objectweb.asm.tree.LocalVariableNode { *; }
|
||||
-keep class org.jetbrains.org.objectweb.asm.tree.MethodNode { *; }
|
||||
-keep class org.jetbrains.org.objectweb.asm.tree.FieldNode { *; }
|
||||
-keep class org.jetbrains.org.objectweb.asm.tree.ParameterNode { *; }
|
||||
-keep class org.jetbrains.org.objectweb.asm.tree.TypeAnnotationNode { *; }
|
||||
|
||||
-keep class org.jetbrains.org.objectweb.asm.signature.SignatureReader { *; }
|
||||
-keep class org.jetbrains.org.objectweb.asm.signature.SignatureVisitor { *; }
|
||||
|
||||
-keep class org.jetbrains.org.objectweb.asm.Type {
|
||||
public protected *;
|
||||
}
|
||||
|
||||
-keepclassmembers class org.jetbrains.org.objectweb.asm.ClassReader {
|
||||
*** SKIP_CODE;
|
||||
*** SKIP_DEBUG;
|
||||
*** SKIP_FRAMES;
|
||||
}
|
||||
|
||||
# for kotlin-android-extensions in maven
|
||||
-keep class com.intellij.openapi.module.ModuleServiceManager { public *; }
|
||||
|
||||
# for building kotlin-build-common-test
|
||||
-keep class org.jetbrains.kotlin.build.SerializationUtilsKt { *; }
|
||||
|
||||
# for tools.jar
|
||||
-keep class com.sun.tools.javac.** { *; }
|
||||
-keep class com.sun.source.** { *; }
|
||||
|
||||
# for coroutines
|
||||
-keep class kotlinx.coroutines.** { *; }
|
||||
|
||||
# for webdemo
|
||||
-keep class com.intellij.openapi.progress.ProgressManager { *; }
|
||||
|
||||
# for kapt
|
||||
-keep class com.intellij.openapi.project.Project { *; }
|
||||
@@ -133,7 +133,7 @@ public class GradleModuleBuilder extends AbstractExternalModuleBuilder<GradlePro
|
||||
moduleName = getName();
|
||||
}
|
||||
else {
|
||||
moduleName = ModuleGrouperKt.isQualifiedModuleNamesEnabled(myWizardContext.getProject()) && StringUtil.isNotEmpty(myProjectId.getGroupId())
|
||||
moduleName = ModuleGrouperKt.isQualifiedModuleNamesEnabled() && StringUtil.isNotEmpty(myProjectId.getGroupId())
|
||||
? (myProjectId.getGroupId() + '.' + myProjectId.getArtifactId())
|
||||
: myProjectId.getArtifactId();
|
||||
}
|
||||
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.configuration
|
||||
|
||||
import com.intellij.ide.util.projectWizard.ModuleWizardStep
|
||||
import com.intellij.ide.util.projectWizard.WizardContext
|
||||
import com.intellij.openapi.externalSystem.service.project.wizard.ExternalModuleSettingsStep
|
||||
import com.intellij.openapi.fileEditor.FileDocumentManager
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.projectRoots.Sdk
|
||||
import com.intellij.openapi.roots.ModifiableRootModel
|
||||
import com.intellij.openapi.roots.ui.configuration.ModulesProvider
|
||||
import com.intellij.openapi.vfs.VfsUtil
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import org.jetbrains.kotlin.idea.KotlinIcons
|
||||
import org.jetbrains.kotlin.idea.util.application.executeCommand
|
||||
import org.jetbrains.kotlin.idea.util.rootManager
|
||||
import org.jetbrains.plugins.gradle.frameworkSupport.BuildScriptDataBuilder
|
||||
import org.jetbrains.plugins.gradle.service.project.wizard.GradleModuleBuilder
|
||||
import org.jetbrains.plugins.gradle.service.settings.GradleProjectSettingsControl
|
||||
import javax.swing.Icon
|
||||
|
||||
class KotlinGradleMultiplatformModuleBuilder : GradleModuleBuilder() {
|
||||
var commonModuleName: String? = null
|
||||
var jvmModuleName: String? = null
|
||||
var jdk: Sdk? = null
|
||||
var jsModuleName: String? = null
|
||||
|
||||
override fun getBuilderId() = "kotlin.gradle.multiplatform"
|
||||
|
||||
override fun getNodeIcon(): Icon = KotlinIcons.MPP
|
||||
|
||||
override fun getPresentableName() = "Kotlin (Multiplatform - Experimental)"
|
||||
|
||||
override fun getDescription() =
|
||||
"Multiplatform projects allow reusing the same code between multiple platforms supported by Kotlin. Such projects are built with Gradle."
|
||||
|
||||
override fun createWizardSteps(wizardContext: WizardContext, modulesProvider: ModulesProvider): Array<ModuleWizardStep> {
|
||||
super.createWizardSteps(wizardContext, modulesProvider) // initializes GradleModuleBuilder.myWizardContext
|
||||
return arrayOf(
|
||||
KotlinGradleMultiplatformWizardStep(this, wizardContext),
|
||||
ExternalModuleSettingsStep(
|
||||
wizardContext, this, GradleProjectSettingsControl(externalProjectSettings)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun setupRootModel(modifiableRootModel: ModifiableRootModel) {
|
||||
super.setupRootModel(modifiableRootModel)
|
||||
if (commonModuleName.isNullOrEmpty()) {
|
||||
val module = modifiableRootModel.module
|
||||
val buildScriptData = getBuildScriptData(module) ?: return
|
||||
val sdk = modifiableRootModel.sdk
|
||||
GradleKotlinMPPCommonFrameworkSupportProvider().addSupport(buildScriptData, sdk)
|
||||
}
|
||||
}
|
||||
|
||||
override fun setupModule(module: Module) {
|
||||
super.setupModule(module)
|
||||
|
||||
val contentRoot = module.rootManager.contentRoots.firstOrNull() ?: return
|
||||
setupCommonModule(module, contentRoot)
|
||||
setupPlatformModule(module, contentRoot, jvmModuleName, GradleKotlinMPPJavaFrameworkSupportProvider(), jdk)
|
||||
setupPlatformModule(module, contentRoot, jsModuleName, GradleKotlinMPPJSFrameworkSupportProvider())
|
||||
|
||||
val settingsGradle = contentRoot.findChild("settings.gradle")
|
||||
settingsGradle?.let {
|
||||
module.project.executeCommand("Update settings.gradle") {
|
||||
val doc = FileDocumentManager.getInstance().getDocument(it) ?: return@executeCommand
|
||||
val includedModules = listOfNotNull(commonModuleName, jvmModuleName, jsModuleName).filter { it.isNotEmpty() }
|
||||
if (includedModules.isNotEmpty()) {
|
||||
doc.insertString(doc.textLength, includedModules.joinToString(prefix = "include ") { "'$it'" })
|
||||
}
|
||||
FileDocumentManager.getInstance().saveDocument(doc)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun setupChildModule(
|
||||
rootModule: Module,
|
||||
contentRoot: VirtualFile,
|
||||
childModuleName: String?,
|
||||
sdk: Sdk? = null,
|
||||
extendScript: (BuildScriptDataBuilder, Sdk?) -> Unit = { _, _ -> }
|
||||
) {
|
||||
if (childModuleName.isNullOrEmpty()) return
|
||||
|
||||
val moduleDir = contentRoot.createChildDirectory(this, childModuleName!!)
|
||||
val buildGradle = moduleDir.createChildData(null, "build.gradle")
|
||||
val buildScriptData = BuildScriptDataBuilder(buildGradle)
|
||||
extendScript(buildScriptData, sdk ?: rootModule.rootManager.sdk)
|
||||
VfsUtil.saveText(buildGradle, buildScriptData.build())
|
||||
}
|
||||
|
||||
private fun setupCommonModule(
|
||||
rootModule: Module,
|
||||
contentRoot: VirtualFile
|
||||
) = setupChildModule(rootModule, contentRoot, commonModuleName) { builder, sdk ->
|
||||
GradleKotlinMPPCommonFrameworkSupportProvider().addSupport(builder, sdk)
|
||||
}
|
||||
|
||||
private fun setupPlatformModule(
|
||||
rootModule: Module,
|
||||
contentRoot: VirtualFile,
|
||||
platformModuleName: String?,
|
||||
supportProvider: GradleKotlinFrameworkSupportProvider,
|
||||
sdk: Sdk? = null
|
||||
) = setupChildModule(rootModule, contentRoot, platformModuleName, sdk) { builder, finalSdk ->
|
||||
supportProvider.addSupport(builder, finalSdk)
|
||||
val dependency = commonModuleName ?: ""
|
||||
builder.addDependencyNotation("expectedBy project(\":$dependency\")")
|
||||
}
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
/*
|
||||
* 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.idea.parameterInfo;
|
||||
|
||||
import com.intellij.lang.parameterInfo.ParameterInfoUIContext;
|
||||
import com.intellij.psi.PsiElement;
|
||||
|
||||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
public class MockParameterInfoUIContext implements ParameterInfoUIContext {
|
||||
private final PsiElement myParameterOwner;
|
||||
private final int myCurrentParameterIndex;
|
||||
|
||||
private final ArrayList<String> result = new ArrayList<String>();
|
||||
|
||||
MockParameterInfoUIContext(PsiElement parameterOwner, int currentParameterIndex) {
|
||||
myParameterOwner = parameterOwner;
|
||||
myCurrentParameterIndex = currentParameterIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String setupUIComponentPresentation(String text, int highlightStartOffset, int highlightEndOffset,
|
||||
boolean isDisabled, boolean strikeout,
|
||||
boolean isDisabledBeforeHighlight, Color background) {
|
||||
String highlightedText;
|
||||
if (highlightStartOffset != -1 && highlightEndOffset != -1) {
|
||||
highlightedText = text.substring(0, highlightStartOffset)
|
||||
+ "<highlight>"
|
||||
+ text.substring(highlightStartOffset, highlightEndOffset)
|
||||
+ "</highlight>"
|
||||
+ text.substring(highlightEndOffset);
|
||||
}
|
||||
else {
|
||||
highlightedText = text;
|
||||
}
|
||||
|
||||
String resultText = "Text: (" + highlightedText + "), " +
|
||||
"Disabled: " + isDisabled + ", " +
|
||||
"Strikeout: " + strikeout + ", " +
|
||||
"Green: " + KotlinParameterInfoWithCallHandlerBase.GREEN_BACKGROUND.equals(background);
|
||||
result.add(resultText);
|
||||
|
||||
// return value not used, just return something
|
||||
return resultText;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUIComponentEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUIComponentEnabled(boolean enabled) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurrentParameterIndex() {
|
||||
return myCurrentParameterIndex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PsiElement getParameterOwner() {
|
||||
return myParameterOwner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSingleParameterInfo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color getDefaultParameterColor() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getResultText() {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
Collections.sort(result);
|
||||
for (String s : result) {
|
||||
stringBuilder.append(s).append("\n");
|
||||
}
|
||||
return stringBuilder.toString().trim();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user