Skip to content

Commit c91a3f8

Browse files
committed
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
1 parent ea71d57 commit c91a3f8

File tree

6 files changed

+134
-5
lines changed

6 files changed

+134
-5
lines changed

build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@
727727
</classpath>
728728
</javac2>
729729

730-
<jar destfile="${kotlin-home}/lib/source-sections-compiler-plugin.jar">
730+
<jar destfile="${kotlin-home}/lib/kotlin-source-sections-compiler-plugin.jar">
731731
<fileset dir="${output}/classes/source-sections-compiler-plugin"/>
732732
<zipfileset file="${kotlin-home}/build.txt" prefix="META-INF"/>
733733
<fileset dir="${basedir}/plugins/source-sections/source-sections-compiler/src" includes="META-INF/services/**"/>

compiler/compiler.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ messages/**)
100100
}
101101

102102
-keepclassmembers class com.intellij.openapi.vfs.VirtualFile {
103-
public InputStream getInputStream();
103+
public protected *;
104104
}
105105

106106
-keep class com.intellij.openapi.vfs.StandardFileSystems {

libraries/pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@
9797
<module>tools/kotlin-maven-allopen</module>
9898
<module>tools/kotlin-noarg</module>
9999
<module>tools/kotlin-maven-noarg</module>
100+
<module>tools/kotlin-sam-with-receiver-compiler-plugin</module>
101+
<module>tools/kotlin-source-sections-compiler-plugin</module>
100102

101103
<module>tools/kotlin-script-util</module>
102104
<module>tools/kotlin-gradle-plugin</module>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
6+
<modelVersion>4.0.0</modelVersion>
7+
<properties>
8+
<maven-plugin-anno.version>1.4.1</maven-plugin-anno.version>
9+
<maven.version>3.0.4</maven.version>
10+
</properties>
11+
12+
<parent>
13+
<groupId>org.jetbrains.kotlin</groupId>
14+
<artifactId>kotlin-project</artifactId>
15+
<version>1.1-SNAPSHOT</version>
16+
<relativePath>../../pom.xml</relativePath>
17+
</parent>
18+
19+
<artifactId>kotlin-sam-with-receiver-compiler-plugin</artifactId>
20+
<packaging>jar</packaging>
21+
22+
<description>Kotlin compiler plugin adding SamWithReceiver functionality</description>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>org.jetbrains.kotlin</groupId>
27+
<artifactId>kotlin-stdlib</artifactId>
28+
<version>${project.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.jetbrains.kotlin</groupId>
32+
<artifactId>kotlin-compiler</artifactId>
33+
<version>${project.version}</version>
34+
</dependency>
35+
</dependencies>
36+
37+
<build>
38+
<sourceDirectory>${project.basedir}/../../../plugins/sam-with-receiver/sam-with-receiver-cli/src</sourceDirectory>
39+
<resources>
40+
<resource>
41+
<directory>${project.basedir}/../../../plugins/sam-with-receiver/sam-with-receiver-cli/src</directory>
42+
<includes>
43+
<include>META-INF/**</include>
44+
</includes>
45+
</resource>
46+
</resources>
47+
48+
<plugins>
49+
<plugin>
50+
<artifactId>kotlin-maven-plugin</artifactId>
51+
<groupId>org.jetbrains.kotlin</groupId>
52+
<version>${project.version}</version>
53+
54+
<executions>
55+
<execution>
56+
<id>compile</id>
57+
<phase>compile</phase>
58+
<goals> <goal>compile</goal> </goals>
59+
</execution>
60+
</executions>
61+
</plugin>
62+
</plugins>
63+
</build>
64+
</project>
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4+
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
5+
6+
<modelVersion>4.0.0</modelVersion>
7+
<properties>
8+
<maven-plugin-anno.version>1.4.1</maven-plugin-anno.version>
9+
<maven.version>3.0.4</maven.version>
10+
</properties>
11+
12+
<parent>
13+
<groupId>org.jetbrains.kotlin</groupId>
14+
<artifactId>kotlin-project</artifactId>
15+
<version>1.1-SNAPSHOT</version>
16+
<relativePath>../../pom.xml</relativePath>
17+
</parent>
18+
19+
<artifactId>kotlin-source-sections-compiler-plugin</artifactId>
20+
<packaging>jar</packaging>
21+
22+
<description>Kotlin compiler plugin adding source sections filtering functionality</description>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>org.jetbrains.kotlin</groupId>
27+
<artifactId>kotlin-stdlib</artifactId>
28+
<version>${project.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.jetbrains.kotlin</groupId>
32+
<artifactId>kotlin-compiler</artifactId>
33+
<version>${project.version}</version>
34+
</dependency>
35+
</dependencies>
36+
37+
<build>
38+
<sourceDirectory>${project.basedir}/../../../plugins/source-sections/source-sections-compiler/src</sourceDirectory>
39+
<resources>
40+
<resource>
41+
<directory>${project.basedir}/../../../plugins/source-sections/source-sections-compiler/src</directory>
42+
<includes>
43+
<include>META-INF/**</include>
44+
</includes>
45+
</resource>
46+
</resources>
47+
<plugins>
48+
<plugin>
49+
<artifactId>kotlin-maven-plugin</artifactId>
50+
<groupId>org.jetbrains.kotlin</groupId>
51+
<version>${project.version}</version>
52+
53+
<executions>
54+
<execution>
55+
<id>compile</id>
56+
<phase>compile</phase>
57+
<goals> <goal>compile</goal> </goals>
58+
</execution>
59+
</executions>
60+
</plugin>
61+
</plugins>
62+
</build>
63+
</project>

plugins/source-sections/source-sections-compiler/tests/org/jetbrains/kotlin/sourceSections/SourceSectionsTest.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ import org.jetbrains.kotlin.daemon.client.DaemonReportingTargets
3232
import org.jetbrains.kotlin.daemon.client.KotlinCompilerClient
3333
import org.jetbrains.kotlin.daemon.common.*
3434
import org.jetbrains.kotlin.script.StandardScriptDefinition
35-
import org.jetbrains.kotlin.script.tryConstructClassFromStringArgs
3635
import org.jetbrains.kotlin.test.ConfigurationKind
3736
import org.jetbrains.kotlin.test.KotlinTestUtils
3837
import org.jetbrains.kotlin.test.TestCaseWithTmpdir
3938
import org.jetbrains.kotlin.test.TestJdkKind
4039
import org.jetbrains.kotlin.utils.KotlinPaths
4140
import org.jetbrains.kotlin.utils.PathUtil
41+
import org.jetbrains.kotlin.utils.tryConstructClassFromStringArgs
4242
import java.io.*
4343
import java.lang.management.ManagementFactory
4444
import java.net.URLClassLoader
@@ -59,8 +59,8 @@ class SourceSectionsTest : TestCaseWithTmpdir() {
5959
}
6060

6161
val compilerClassPath = listOf(kotlinPaths.compilerPath)
62-
val scriptRuntimeClassPath = listOf( kotlinPaths.stdlibPath, kotlinPaths.scriptRuntimePath)
63-
val sourceSectionsPluginJar = File(kotlinPaths.libPath, "source-sections-compiler-plugin.jar")
62+
val scriptRuntimeClassPath = listOf( kotlinPaths.runtimePath, kotlinPaths.scriptRuntimePath)
63+
val sourceSectionsPluginJar = File(kotlinPaths.libPath, "kotlin-source-sections-compiler-plugin.jar")
6464
val compilerId by lazy(LazyThreadSafetyMode.NONE) { CompilerId.makeCompilerId(compilerClassPath) }
6565

6666
private fun createEnvironment(vararg sources: String, withSourceSectionsPlugin: Boolean = true): KotlinCoreEnvironment {

0 commit comments

Comments
 (0)