Extract kotlin-maven-plugin tests into a separate subproject

Because they need kotlin-runtime to run, which is built by kotlin-maven-plugin
This commit is contained in:
Alexander Udalov
2014-06-06 23:07:09 +04:00
parent a9b2fd964b
commit 059538ce1b
20 changed files with 144 additions and 123 deletions
+3 -54
View File
@@ -20,12 +20,12 @@
<packaging>maven-plugin</packaging>
<dependencies>
<dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${maven.version}</version>
</dependency>
<dependency>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>${maven.version}</version>
@@ -60,55 +60,4 @@
</plugins>
</build>
<profiles>
<!--
moved the integration test into a profile so we can disable this
for example this integration test doesn't work if offline
-->
<profile>
<id>integrationTest</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.5</version>
<configuration>
<projectsDirectory>src/it</projectsDirectory>
<cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
<pomIncludes>
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
<!--This could speed up test by providing local repo as remote repo for test but might be tricky on different OS-->
<!--<settingsFile>src/it/settings.xml</settingsFile>-->
<localRepositoryPath>local-repo</localRepositoryPath>
<postBuildHookScript>verify.bsh</postBuildHookScript>
<streamLogs>true</streamLogs>
</configuration>
<executions>
<execution>
<id>integration-test</id>
<!--<phase>package</phase>-->
<goals>
<goal>install</goal>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- allows the integration test to be disabled (for example if you are offline) -->
<profile>
<id>noTest</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
</profile>
</profiles>
</project>
@@ -1,35 +0,0 @@
<?xml version="1.0"?>
<settings>
<profiles>
<profile>
<id>it-repo</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>local.central</id>
<url>@localRepositoryUrl@</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
@@ -1,76 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jetbrains.kotlin.it</groupId>
<artifactId>test-classpath</artifactId>
<version>1.0</version>
<name>Test Hello World project</name>
<description>
Test the kotlin-maven-plugin:compile goal on test-classpath project.
</description>
<properties>
<kotlin.version>0.1-SNAPSHOT</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
</plugin>
</plugins>
</pluginManagement>
<!--suppress MavenModelInspection -->
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -1,16 +0,0 @@
package org.jetbrains
import sun.nio.cs.SingleByte
import sun.net.spi.nameservice.dns.DNSNameService
import javax.crypto.Cipher
import com.sun.java.browser.plugin2.DOM
import com.sun.crypto.provider.AESCipher
fun box(): String {
val a = SingleByte() // charsets.jar
val c = DNSNameService() // dnsns.ajr
val e : Cipher? = null // jce.jar
val f : AESCipher? = null // sunjce_provider.jar
val j : DOM? = null // plugin.jar
return "OK"
}
@@ -1,13 +0,0 @@
package org.jetbrains;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
public class HelloWorldJavaTest {
@Test
public void testClasspath() {
assertEquals("OK", org.jetbrains.JetbrainsPackage.box());
}
}
@@ -1,7 +0,0 @@
import java.io.*;
File file = new File( basedir, "target/test-classpath-1.0.jar" );
if (!file.exists() || !file.isFile())
{
throw new FileNotFoundException( "Could not find generated JAR: " + file );
}
@@ -1,77 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jetbrains.kotlin.it</groupId>
<artifactId>test-helloworld</artifactId>
<version>1.0</version>
<name>Test Hello World project</name>
<description>
Test the kotlin-maven-plugin:compile goal on HelloWorld project.
</description>
<properties>
<kotlin.version>0.1-SNAPSHOT</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
</plugin>
</plugins>
</pluginManagement>
<!--suppress MavenModelInspection -->
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<!--suppress MavenModelInspection -->
<!--testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory-->
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -1,9 +0,0 @@
package org.jetbrains
fun main(args : Array<String>) {
System.out?.println(getGreeting())
}
fun getGreeting() : String {
return "Hello, World!"
}
@@ -1,13 +0,0 @@
package org.jetbrains;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
public class HelloWorldJavaTest {
@Test
public void greeting() {
assertEquals("Hello, World!", org.jetbrains.JetbrainsPackage.getGreeting());
}
}
@@ -1,7 +0,0 @@
import java.io.*;
File file = new File( basedir, "target/test-helloworld-1.0.jar" );
if (!file.exists() || !file.isFile())
{
throw new FileNotFoundException( "Could not find generated JAR: " + file );
}
@@ -1,80 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.jetbrains.kotlin.it</groupId>
<artifactId>test-inlineDisabled</artifactId>
<version>1.0</version>
<name>Test Hello World project</name>
<description>
Test the kotlin-maven-plugin:compile goal on HelloWorld project.
</description>
<properties>
<kotlin.version>0.1-SNAPSHOT</kotlin.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.9</version>
</dependency>
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
</plugin>
</plugins>
</pluginManagement>
<!--suppress MavenModelInspection -->
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
<!--suppress MavenModelInspection -->
<!--testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory-->
<plugins>
<plugin>
<artifactId>kotlin-maven-plugin</artifactId>
<groupId>org.jetbrains.kotlin</groupId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
<configuration>
<inline>false</inline>
</configuration>
</plugin>
</plugins>
</build>
</project>
@@ -1,9 +0,0 @@
package org.jetbrains
fun main(args : Array<String>) {
System.out?.println(getGreeting())
}
fun getGreeting() : String {
return "Hello, World!"
}
@@ -1,13 +0,0 @@
package org.jetbrains;
import org.junit.Test;
import static junit.framework.Assert.assertEquals;
public class HelloWorldJavaTest {
@Test
public void greeting() {
assertEquals("Hello, World!", org.jetbrains.JetbrainsPackage.getGreeting());
}
}
@@ -1,7 +0,0 @@
import java.io.*;
File file = new File( basedir, "target/test-inlineDisabled-1.0.jar" );
if (!file.exists() || !file.isFile())
{
throw new FileNotFoundException( "Could not find generated JAR: " + file );
}