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
This commit is contained in:
@@ -727,7 +727,7 @@
|
|||||||
</classpath>
|
</classpath>
|
||||||
</javac2>
|
</javac2>
|
||||||
|
|
||||||
<jar destfile="${kotlin-home}/lib/source-sections-compiler-plugin.jar">
|
<jar destfile="${kotlin-home}/lib/kotlin-source-sections-compiler-plugin.jar">
|
||||||
<fileset dir="${output}/classes/source-sections-compiler-plugin"/>
|
<fileset dir="${output}/classes/source-sections-compiler-plugin"/>
|
||||||
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
|
||||||
<fileset dir="${basedir}/plugins/source-sections/source-sections-compiler/src" includes="META-INF/services/**"/>
|
<fileset dir="${basedir}/plugins/source-sections/source-sections-compiler/src" includes="META-INF/services/**"/>
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ messages/**)
|
|||||||
}
|
}
|
||||||
|
|
||||||
-keepclassmembers class com.intellij.openapi.vfs.VirtualFile {
|
-keepclassmembers class com.intellij.openapi.vfs.VirtualFile {
|
||||||
public InputStream getInputStream();
|
public protected *;
|
||||||
}
|
}
|
||||||
|
|
||||||
-keep class com.intellij.openapi.vfs.StandardFileSystems {
|
-keep class com.intellij.openapi.vfs.StandardFileSystems {
|
||||||
|
|||||||
@@ -97,6 +97,8 @@
|
|||||||
<module>tools/kotlin-maven-allopen</module>
|
<module>tools/kotlin-maven-allopen</module>
|
||||||
<module>tools/kotlin-noarg</module>
|
<module>tools/kotlin-noarg</module>
|
||||||
<module>tools/kotlin-maven-noarg</module>
|
<module>tools/kotlin-maven-noarg</module>
|
||||||
|
<module>tools/kotlin-sam-with-receiver-compiler-plugin</module>
|
||||||
|
<module>tools/kotlin-source-sections-compiler-plugin</module>
|
||||||
|
|
||||||
<module>tools/kotlin-script-util</module>
|
<module>tools/kotlin-script-util</module>
|
||||||
<module>tools/kotlin-gradle-plugin</module>
|
<module>tools/kotlin-gradle-plugin</module>
|
||||||
|
|||||||
@@ -0,0 +1,64 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<properties>
|
||||||
|
<maven-plugin-anno.version>1.4.1</maven-plugin-anno.version>
|
||||||
|
<maven.version>3.0.4</maven.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-project</artifactId>
|
||||||
|
<version>1.1-SNAPSHOT</version>
|
||||||
|
<relativePath>../../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>kotlin-sam-with-receiver-compiler-plugin</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<description>Kotlin compiler plugin adding SamWithReceiver functionality</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-compiler</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>${project.basedir}/../../../plugins/sam-with-receiver/sam-with-receiver-cli/src</sourceDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}/../../../plugins/sam-with-receiver/sam-with-receiver-cli/src</directory>
|
||||||
|
<includes>
|
||||||
|
<include>META-INF/**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>compile</id>
|
||||||
|
<phase>compile</phase>
|
||||||
|
<goals> <goal>compile</goal> </goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<properties>
|
||||||
|
<maven-plugin-anno.version>1.4.1</maven-plugin-anno.version>
|
||||||
|
<maven.version>3.0.4</maven.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-project</artifactId>
|
||||||
|
<version>1.1-SNAPSHOT</version>
|
||||||
|
<relativePath>../../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>kotlin-source-sections-compiler-plugin</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<description>Kotlin compiler plugin adding source sections filtering functionality</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-stdlib</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<artifactId>kotlin-compiler</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>${project.basedir}/../../../plugins/source-sections/source-sections-compiler/src</sourceDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${project.basedir}/../../../plugins/source-sections/source-sections-compiler/src</directory>
|
||||||
|
<includes>
|
||||||
|
<include>META-INF/**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>compile</id>
|
||||||
|
<phase>compile</phase>
|
||||||
|
<goals> <goal>compile</goal> </goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
+3
-3
@@ -32,13 +32,13 @@ import org.jetbrains.kotlin.daemon.client.DaemonReportingTargets
|
|||||||
import org.jetbrains.kotlin.daemon.client.KotlinCompilerClient
|
import org.jetbrains.kotlin.daemon.client.KotlinCompilerClient
|
||||||
import org.jetbrains.kotlin.daemon.common.*
|
import org.jetbrains.kotlin.daemon.common.*
|
||||||
import org.jetbrains.kotlin.script.StandardScriptDefinition
|
import org.jetbrains.kotlin.script.StandardScriptDefinition
|
||||||
import org.jetbrains.kotlin.script.tryConstructClassFromStringArgs
|
|
||||||
import org.jetbrains.kotlin.test.ConfigurationKind
|
import org.jetbrains.kotlin.test.ConfigurationKind
|
||||||
import org.jetbrains.kotlin.test.KotlinTestUtils
|
import org.jetbrains.kotlin.test.KotlinTestUtils
|
||||||
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
|
||||||
import org.jetbrains.kotlin.test.TestJdkKind
|
import org.jetbrains.kotlin.test.TestJdkKind
|
||||||
import org.jetbrains.kotlin.utils.KotlinPaths
|
import org.jetbrains.kotlin.utils.KotlinPaths
|
||||||
import org.jetbrains.kotlin.utils.PathUtil
|
import org.jetbrains.kotlin.utils.PathUtil
|
||||||
|
import org.jetbrains.kotlin.utils.tryConstructClassFromStringArgs
|
||||||
import java.io.*
|
import java.io.*
|
||||||
import java.lang.management.ManagementFactory
|
import java.lang.management.ManagementFactory
|
||||||
import java.net.URLClassLoader
|
import java.net.URLClassLoader
|
||||||
@@ -59,8 +59,8 @@ class SourceSectionsTest : TestCaseWithTmpdir() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val compilerClassPath = listOf(kotlinPaths.compilerPath)
|
val compilerClassPath = listOf(kotlinPaths.compilerPath)
|
||||||
val scriptRuntimeClassPath = listOf( kotlinPaths.stdlibPath, kotlinPaths.scriptRuntimePath)
|
val scriptRuntimeClassPath = listOf( kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath)
|
||||||
val sourceSectionsPluginJar = File(kotlinPaths.libPath, "source-sections-compiler-plugin.jar")
|
val sourceSectionsPluginJar = File(kotlinPaths.libPath, "kotlin-source-sections-compiler-plugin.jar")
|
||||||
val compilerId by lazy(LazyThreadSafetyMode.NONE) { CompilerId.makeCompilerId(compilerClassPath) }
|
val compilerId by lazy(LazyThreadSafetyMode.NONE) { CompilerId.makeCompilerId(compilerClassPath) }
|
||||||
|
|
||||||
private fun createEnvironment(vararg sources: String, withSourceSectionsPlugin: Boolean = true): KotlinCoreEnvironment {
|
private fun createEnvironment(vararg sources: String, withSourceSectionsPlugin: Boolean = true): KotlinCoreEnvironment {
|
||||||
|
|||||||
Reference in New Issue
Block a user