From c91a3f8bf08295e24496f41b0a15fc58de919ea2 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Fri, 14 Apr 2017 10:52:34 +0200 Subject: [PATCH] Add sam-with-receiver and source-sections compiler plugins to maven rename source-sections compiler plugin jar in the dist (add kotlin- prefix), according to the agreed naming scheme for the artefacts. (The renaming of the other plugins should follow.) in addition configure proguard to retain VirtualFile members, since they are used in the source-sections plugin --- build.xml | 2 +- compiler/compiler.pro | 2 +- libraries/pom.xml | 2 + .../pom.xml | 64 +++++++++++++++++++ .../pom.xml | 63 ++++++++++++++++++ .../sourceSections/SourceSectionsTest.kt | 6 +- 6 files changed, 134 insertions(+), 5 deletions(-) create mode 100755 libraries/tools/kotlin-sam-with-receiver-compiler-plugin/pom.xml create mode 100755 libraries/tools/kotlin-source-sections-compiler-plugin/pom.xml diff --git a/build.xml b/build.xml index 8531bb18254..bf02e882b70 100644 --- a/build.xml +++ b/build.xml @@ -727,7 +727,7 @@ - + diff --git a/compiler/compiler.pro b/compiler/compiler.pro index bd2616b7692..2e1a9dc239c 100644 --- a/compiler/compiler.pro +++ b/compiler/compiler.pro @@ -100,7 +100,7 @@ messages/**) } -keepclassmembers class com.intellij.openapi.vfs.VirtualFile { - public InputStream getInputStream(); + public protected *; } -keep class com.intellij.openapi.vfs.StandardFileSystems { diff --git a/libraries/pom.xml b/libraries/pom.xml index c7d10f74ec3..8d11bee4035 100644 --- a/libraries/pom.xml +++ b/libraries/pom.xml @@ -97,6 +97,8 @@ tools/kotlin-maven-allopen tools/kotlin-noarg tools/kotlin-maven-noarg + tools/kotlin-sam-with-receiver-compiler-plugin + tools/kotlin-source-sections-compiler-plugin tools/kotlin-script-util tools/kotlin-gradle-plugin diff --git a/libraries/tools/kotlin-sam-with-receiver-compiler-plugin/pom.xml b/libraries/tools/kotlin-sam-with-receiver-compiler-plugin/pom.xml new file mode 100755 index 00000000000..85961054010 --- /dev/null +++ b/libraries/tools/kotlin-sam-with-receiver-compiler-plugin/pom.xml @@ -0,0 +1,64 @@ + + + + 4.0.0 + + 1.4.1 + 3.0.4 + + + + org.jetbrains.kotlin + kotlin-project + 1.1-SNAPSHOT + ../../pom.xml + + + kotlin-sam-with-receiver-compiler-plugin + jar + + Kotlin compiler plugin adding SamWithReceiver functionality + + + + org.jetbrains.kotlin + kotlin-stdlib + ${project.version} + + + org.jetbrains.kotlin + kotlin-compiler + ${project.version} + + + + + ${project.basedir}/../../../plugins/sam-with-receiver/sam-with-receiver-cli/src + + + ${project.basedir}/../../../plugins/sam-with-receiver/sam-with-receiver-cli/src + + META-INF/** + + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${project.version} + + + + compile + compile + compile + + + + + + diff --git a/libraries/tools/kotlin-source-sections-compiler-plugin/pom.xml b/libraries/tools/kotlin-source-sections-compiler-plugin/pom.xml new file mode 100755 index 00000000000..48a55388691 --- /dev/null +++ b/libraries/tools/kotlin-source-sections-compiler-plugin/pom.xml @@ -0,0 +1,63 @@ + + + + 4.0.0 + + 1.4.1 + 3.0.4 + + + + org.jetbrains.kotlin + kotlin-project + 1.1-SNAPSHOT + ../../pom.xml + + + kotlin-source-sections-compiler-plugin + jar + + Kotlin compiler plugin adding source sections filtering functionality + + + + org.jetbrains.kotlin + kotlin-stdlib + ${project.version} + + + org.jetbrains.kotlin + kotlin-compiler + ${project.version} + + + + + ${project.basedir}/../../../plugins/source-sections/source-sections-compiler/src + + + ${project.basedir}/../../../plugins/source-sections/source-sections-compiler/src + + META-INF/** + + + + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${project.version} + + + + compile + compile + compile + + + + + + diff --git a/plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt b/plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt index ffa662ccbab..f526725ec82 100644 --- a/plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt +++ b/plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt @@ -32,13 +32,13 @@ import org.jetbrains.kotlin.daemon.client.DaemonReportingTargets import org.jetbrains.kotlin.daemon.client.KotlinCompilerClient import org.jetbrains.kotlin.daemon.common.* import org.jetbrains.kotlin.script.StandardScriptDefinition -import org.jetbrains.kotlin.script.tryConstructClassFromStringArgs import org.jetbrains.kotlin.test.ConfigurationKind import org.jetbrains.kotlin.test.KotlinTestUtils import org.jetbrains.kotlin.test.TestCaseWithTmpdir import org.jetbrains.kotlin.test.TestJdkKind import org.jetbrains.kotlin.utils.KotlinPaths import org.jetbrains.kotlin.utils.PathUtil +import org.jetbrains.kotlin.utils.tryConstructClassFromStringArgs import java.io.* import java.lang.management.ManagementFactory import java.net.URLClassLoader @@ -59,8 +59,8 @@ class SourceSectionsTest : TestCaseWithTmpdir() { } val compilerClassPath = listOf(kotlinPaths.compilerPath) - val scriptRuntimeClassPath = listOf( kotlinPaths.stdlibPath, kotlinPaths.scriptRuntimePath) - val sourceSectionsPluginJar = File(kotlinPaths.libPath, "source-sections-compiler-plugin.jar") + val scriptRuntimeClassPath = listOf( kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath) + val sourceSectionsPluginJar = File(kotlinPaths.libPath, "kotlin-source-sections-compiler-plugin.jar") val compilerId by lazy(LazyThreadSafetyMode.NONE) { CompilerId.makeCompilerId(compilerClassPath) } private fun createEnvironment(vararg sources: String, withSourceSectionsPlugin: Boolean = true): KotlinCoreEnvironment {