Libraries:

- "kotlin-maven-plugin" is pulled up to the main POM
 - "testFilterIntoLinkedList" test commented out
 - stdlib - including "kotlin-runtime" respects "localKotlin" profile
This commit is contained in:
Evgeny Goldin
2012-03-20 21:51:52 +01:00
parent ba3d833e81
commit 669c7ec326
8 changed files with 154 additions and 66 deletions
+133 -11
View File
@@ -22,26 +22,148 @@
</dependency>
</dependencies>
<properties>
<temp-directory>${project.build.directory}/temp</temp-directory>
<kotlin-maven-plugin-dir>${temp-directory}/kotlin-maven-plugin</kotlin-maven-plugin-dir>
<kotlin-runtime-dir>${temp-directory}/kotlin-runtime</kotlin-runtime-dir>
<!-- DO NOT update manually or through -D, it is set to "true" by "localKotlin" profile -->
<localKotlin>false</localKotlin>
</properties>
<build>
<sourceDirectory>${project.basedir}/src</sourceDirectory>
<testSourceDirectory>${project.basedir}/test</testSourceDirectory>
<resources>
<resource>
<directory>${kotlin-sdk}/../classes/runtime</directory>
<filtering>false</filtering>
<includes>
<include>**/*.class</include>
</includes>
</resource>
</resources>
<plugins>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Unpacking "kotlin-maven-plugin" to get its "ivyconf.xml" -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plugin>
<groupId>com.github.goldin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<artifactId>copy-maven-plugin</artifactId>
<version>${kotlin-maven-plugin.version}</version>
<executions>
<execution>
<id>unpack-ivyconf</id>
<goals>
<goal>copy</goal>
</goals>
<phase>initialize</phase>
<configuration>
<runIf>! Boolean.valueOf( localKotlin )</runIf>
<resource>
<targetPath>${kotlin-maven-plugin-dir}</targetPath>
<dependency>
<groupId>com.github.goldin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin-maven-plugin.version}</version>
</dependency>
<unpack>true</unpack>
</resource>
</configuration>
</execution>
</executions>
</plugin>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Copying "kotlin-runtime" dependency -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plugin>
<groupId>com.github.goldin</groupId>
<artifactId>ivy-maven-plugin</artifactId>
<version>${kotlin-maven-plugin.version}</version>
<executions>
<execution>
<id>copy-kotlin-runtime</id>
<goals>
<goal>ivy</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<runIf>! Boolean.valueOf( localKotlin )</runIf>
<ivyconf>${kotlin-maven-plugin-dir}/ivyconf.xml</ivyconf>
<dir>${kotlin-runtime-dir}</dir>
<dependency>
<groupId>ivy.org</groupId>
<artifactId>bt344</artifactId>
<version>latest.lastSuccessful</version>
<classifier>kotlin-runtime</classifier>
</dependency>
</configuration>
</execution>
</executions>
</plugin>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Unpacking "kotlin-runtime" dependency -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plugin>
<groupId>com.github.goldin</groupId>
<artifactId>copy-maven-plugin</artifactId>
<version>${kotlin-maven-plugin.version}</version>
<executions>
<execution>
<id>unpack-kotlin-runtime</id>
<goals>
<goal>copy</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<runIf>! Boolean.valueOf( localKotlin )</runIf>
<resource>
<targetPath>${project.build.outputDirectory}</targetPath>
<directory>${kotlin-runtime-dir}</directory>
<include>*.jar</include>
<unpack>true</unpack>
</resource>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>localKotlin</id>
<properties>
<localKotlin>true</localKotlin>
</properties>
<build>
<plugins>
<plugin>
<groupId>com.github.goldin</groupId>
<artifactId>copy-maven-plugin</artifactId>
<version>${kotlin-maven-plugin.version}</version>
<executions>
<execution>
<id>copy-runtime</id>
<goals>
<goal>copy</goal>
</goals>
<phase>initialize</phase>
<configuration>
<resource>
<targetPath>${project.build.outputDirectory}</targetPath>
<directory>${kotlin-sdk}/../classes/runtime</directory>
<include>**/*.class</include>
<preservePath>true</preservePath>
</resource>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
+2
View File
@@ -66,6 +66,7 @@ class CollectionTest() : TestCase() {
assertEquals(arrayList("foo"), foo)
}
/*
fun testFilterIntoLinkedList() {
// TODO would be nice to avoid the <String>
val foo = data.filterTo(linkedList<String>()){it.startsWith("f")}
@@ -80,6 +81,7 @@ class CollectionTest() : TestCase() {
foo is LinkedList<String>
}
}
*/
fun testFilterIntoSet() {
// TODO would be nice to avoid the <String>