Maven: tests support for multiplatform projects
This commit is contained in:
@@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||||
|
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>kotlin-maven-plugin</artifactId>
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
@@ -41,6 +43,17 @@
|
|||||||
<goal>js</goal>
|
<goal>js</goal>
|
||||||
</goals>
|
</goals>
|
||||||
|
|
||||||
|
<configuration>
|
||||||
|
<multiPlatform>true</multiPlatform>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>compile-test</id>
|
||||||
|
<phase>test-compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>test-js</goal>
|
||||||
|
</goals>
|
||||||
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<multiPlatform>true</multiPlatform>
|
<multiPlatform>true</multiPlatform>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
package org.jetbrains
|
||||||
|
|
||||||
|
import org.junit.*
|
||||||
|
import kotlin.test.*
|
||||||
|
|
||||||
|
class JSSpecificTest {
|
||||||
|
@Test
|
||||||
|
fun test1() {
|
||||||
|
assertEquals(1, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
package org.jetbrains
|
||||||
|
|
||||||
|
impl fun assertEquals(a: String, b: String) {
|
||||||
|
kotlin.test.assertEquals(a, b)
|
||||||
|
}
|
||||||
@@ -24,10 +24,18 @@
|
|||||||
<artifactId>test-multimodule-shared</artifactId>
|
<artifactId>test-multimodule-shared</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.12</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||||
|
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>kotlin-maven-plugin</artifactId>
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
@@ -44,6 +52,16 @@
|
|||||||
<multiPlatform>true</multiPlatform>
|
<multiPlatform>true</multiPlatform>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>compile-test</id>
|
||||||
|
<phase>test-compile</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>test-compile</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<multiPlatform>true</multiPlatform>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package org.jetbrains
|
||||||
|
|
||||||
|
import org.junit.*
|
||||||
|
|
||||||
|
class JVMSpecificTest {
|
||||||
|
@Test
|
||||||
|
fun test1() {
|
||||||
|
Assert.assertEquals(1, 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package org.jetbrains
|
||||||
|
|
||||||
|
import org.junit.*
|
||||||
|
|
||||||
|
impl fun assertEquals(a: String, b: String) {
|
||||||
|
Assert.assertEquals(a, b)
|
||||||
|
}
|
||||||
@@ -23,11 +23,14 @@
|
|||||||
|
|
||||||
<build>
|
<build>
|
||||||
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
||||||
|
<testSourceDirectory>${project.basedir}/src/test/kotlin</testSourceDirectory>
|
||||||
|
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<artifactId>kotlin-maven-plugin</artifactId>
|
<artifactId>kotlin-maven-plugin</artifactId>
|
||||||
<groupId>org.jetbrains.kotlin</groupId>
|
<groupId>org.jetbrains.kotlin</groupId>
|
||||||
<version>${kotlin.version}</version>
|
<version>${kotlin.version}</version>
|
||||||
|
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>metadata</id>
|
<id>metadata</id>
|
||||||
@@ -35,6 +38,12 @@
|
|||||||
<goal>metadata</goal>
|
<goal>metadata</goal>
|
||||||
</goals>
|
</goals>
|
||||||
</execution>
|
</execution>
|
||||||
|
<execution>
|
||||||
|
<id>test-metadata</id>
|
||||||
|
<goals>
|
||||||
|
<goal>test-metadata</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
package org.jetbrains
|
||||||
|
|
||||||
|
import org.junit.*
|
||||||
|
|
||||||
|
open class SharedTest {
|
||||||
|
@Test
|
||||||
|
fun test0() {
|
||||||
|
assertEquals("Hello, World!", getGreeting())
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
package org.jetbrains
|
||||||
|
|
||||||
|
header fun assertEquals(a: String, b: String)
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
package org.junit
|
||||||
|
|
||||||
|
@Suppress("HEADER_WITHOUT_IMPLEMENTATION")
|
||||||
|
header annotation class Test
|
||||||
+7
@@ -24,6 +24,7 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
|
|||||||
import org.apache.maven.plugins.annotations.Mojo;
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
import org.apache.maven.plugins.annotations.Parameter;
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments;
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments;
|
||||||
import org.jetbrains.kotlin.cli.js.K2JSCompiler;
|
import org.jetbrains.kotlin.cli.js.K2JSCompiler;
|
||||||
@@ -154,12 +155,18 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
|
|||||||
return new K2JSCompilerArguments();
|
return new K2JSCompilerArguments();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> getRelatedSourceRoots(MavenProject project) {
|
||||||
|
return project.getCompileSourceRoots();
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected K2JSCompiler createCompiler() {
|
protected K2JSCompiler createCompiler() {
|
||||||
return new K2JSCompiler();
|
return new K2JSCompiler();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private Set<String> getOutputDirectoriesCollector() {
|
private Set<String> getOutputDirectoriesCollector() {
|
||||||
lock.lock();
|
lock.lock();
|
||||||
try {
|
try {
|
||||||
|
|||||||
+6
@@ -21,6 +21,7 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
|
|||||||
import org.apache.maven.plugins.annotations.Mojo;
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
import org.apache.maven.plugins.annotations.Parameter;
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments;
|
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments;
|
||||||
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler;
|
import org.jetbrains.kotlin.cli.jvm.K2JVMCompiler;
|
||||||
@@ -65,6 +66,11 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
|
|||||||
@Parameter(property = "kotlin.compiler.scriptTemplates", required = false, readonly = false)
|
@Parameter(property = "kotlin.compiler.scriptTemplates", required = false, readonly = false)
|
||||||
protected List<String> scriptTemplates;
|
protected List<String> scriptTemplates;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> getRelatedSourceRoots(MavenProject project) {
|
||||||
|
return project.getCompileSourceRoots();
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected K2JVMCompiler createCompiler() {
|
protected K2JVMCompiler createCompiler() {
|
||||||
|
|||||||
+17
-6
@@ -34,6 +34,7 @@ import org.apache.maven.repository.RepositorySystem;
|
|||||||
import org.codehaus.plexus.PlexusContainer;
|
import org.codehaus.plexus.PlexusContainer;
|
||||||
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.kotlin.cli.common.CLICompiler;
|
import org.jetbrains.kotlin.cli.common.CLICompiler;
|
||||||
import org.jetbrains.kotlin.cli.common.ExitCode;
|
import org.jetbrains.kotlin.cli.common.ExitCode;
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments;
|
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments;
|
||||||
@@ -86,7 +87,7 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
|||||||
return project.getCompileSourceRoots();
|
return project.getCompileSourceRoots();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<File> getSourceDirs() {
|
private List<File> getSourceDirs() {
|
||||||
List<String> sources = getSourceFilePaths();
|
List<String> sources = getSourceFilePaths();
|
||||||
List<File> result = new ArrayList<File>(sources.size());
|
List<File> result = new ArrayList<File>(sources.size());
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
|||||||
|
|
||||||
Map<String, MavenProject> projectReferences = project.getProjectReferences();
|
Map<String, MavenProject> projectReferences = project.getProjectReferences();
|
||||||
if (projectReferences != null) {
|
if (projectReferences != null) {
|
||||||
|
iterateDependencies:
|
||||||
for (Dependency dependency : project.getDependencies()) {
|
for (Dependency dependency : project.getDependencies()) {
|
||||||
MavenProject sibling = projectReferences.get(dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + dependency.getVersion());
|
MavenProject sibling = projectReferences.get(dependency.getGroupId() + ":" + dependency.getArtifactId() + ":" + dependency.getVersion());
|
||||||
if (sibling != null) {
|
if (sibling != null) {
|
||||||
@@ -103,11 +105,9 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
|||||||
if (plugin != null) {
|
if (plugin != null) {
|
||||||
for (PluginExecution pluginExecution : plugin.getExecutions()) {
|
for (PluginExecution pluginExecution : plugin.getExecutions()) {
|
||||||
if (pluginExecution.getGoals() != null && pluginExecution.getGoals().contains("metadata")) {
|
if (pluginExecution.getGoals() != null && pluginExecution.getGoals().contains("metadata")) {
|
||||||
List<String> sourceRoots = sibling.getCompileSourceRoots();
|
for (String sourceRoot : orEmpty(getRelatedSourceRoots(sibling))) {
|
||||||
if (sourceRoots != null) {
|
addSourceRoots(result, sourceRoot);
|
||||||
for (String sourceRoot : sourceRoots) {
|
continue iterateDependencies;
|
||||||
addSourceRoots(result, sourceRoot);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -119,6 +119,8 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected abstract List<String> getRelatedSourceRoots(MavenProject project);
|
||||||
|
|
||||||
private void addSourceRoots(List<File> result, String source) {
|
private void addSourceRoots(List<File> result, String source) {
|
||||||
File f = new File(source);
|
File f = new File(source);
|
||||||
if (f.isAbsolute()) {
|
if (f.isAbsolute()) {
|
||||||
@@ -449,4 +451,13 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
|||||||
super("Plugin option has an illegal format: " + option);
|
super("Plugin option has an illegal format: " + option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static <T> List<T> orEmpty(@Nullable List<T> in) {
|
||||||
|
if (in == null) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
|
return in;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -22,6 +22,7 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
|
|||||||
import org.apache.maven.plugins.annotations.Mojo;
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
import org.apache.maven.plugins.annotations.Parameter;
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments;
|
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments;
|
||||||
|
|
||||||
@@ -89,4 +90,9 @@ public class KotlinTestCompileMojo extends K2JVMCompileMojo {
|
|||||||
output = testOutput;
|
output = testOutput;
|
||||||
super.configureSpecificCompilerArguments(arguments);
|
super.configureSpecificCompilerArguments(arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> getRelatedSourceRoots(MavenProject project) {
|
||||||
|
return project.getTestCompileSourceRoots();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
@@ -22,6 +22,7 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
|
|||||||
import org.apache.maven.plugins.annotations.Mojo;
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
import org.apache.maven.plugins.annotations.Parameter;
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments;
|
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments;
|
||||||
|
|
||||||
@@ -85,6 +86,11 @@ public class KotlinTestJSCompilerMojo extends K2JSCompilerMojo {
|
|||||||
arguments.metaInfo = metaInfo;
|
arguments.metaInfo = metaInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> getRelatedSourceRoots(MavenProject project) {
|
||||||
|
return project.getTestCompileSourceRoots();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute() throws MojoExecutionException, MojoFailureException {
|
public void execute() throws MojoExecutionException, MojoFailureException {
|
||||||
if (skip) {
|
if (skip) {
|
||||||
|
|||||||
+11
@@ -5,12 +5,14 @@ import org.apache.maven.plugins.annotations.LifecyclePhase;
|
|||||||
import org.apache.maven.plugins.annotations.Mojo;
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
import org.apache.maven.plugins.annotations.Parameter;
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
import org.apache.maven.plugins.annotations.ResolutionScope;
|
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
|
import org.apache.maven.project.MavenProject;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.cli.common.CLICompiler;
|
import org.jetbrains.kotlin.cli.common.CLICompiler;
|
||||||
import org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments;
|
import org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments;
|
||||||
import org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler;
|
import org.jetbrains.kotlin.cli.metadata.K2MetadataCompiler;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.intellij.openapi.util.text.StringUtil.join;
|
import static com.intellij.openapi.util.text.StringUtil.join;
|
||||||
@@ -21,6 +23,14 @@ public class MetadataMojo extends KotlinCompileMojoBase<K2MetadataCompilerArgume
|
|||||||
@Parameter(defaultValue = "${project.compileClasspathElements}", required = true, readonly = true)
|
@Parameter(defaultValue = "${project.compileClasspathElements}", required = true, readonly = true)
|
||||||
public List<String> classpath;
|
public List<String> classpath;
|
||||||
|
|
||||||
|
@Parameter(defaultValue = "${project.testClasspathElements}", required = true, readonly = true)
|
||||||
|
public List<String> testClasspath;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> getRelatedSourceRoots(MavenProject project) {
|
||||||
|
return Collections.emptyList();
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected CLICompiler<K2MetadataCompilerArguments> createCompiler() {
|
protected CLICompiler<K2MetadataCompilerArguments> createCompiler() {
|
||||||
@@ -42,6 +52,7 @@ public class MetadataMojo extends KotlinCompileMojoBase<K2MetadataCompilerArgume
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<String> classpathList = filterClassPath(project.getBasedir(), classpath);
|
List<String> classpathList = filterClassPath(project.getBasedir(), classpath);
|
||||||
|
classpathList.remove(project.getBuild().getOutputDirectory());
|
||||||
|
|
||||||
if (!classpathList.isEmpty()) {
|
if (!classpathList.isEmpty()) {
|
||||||
String classPathString = join(classpathList, File.pathSeparator);
|
String classPathString = join(classpathList, File.pathSeparator);
|
||||||
|
|||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
package org.jetbrains.kotlin.maven;
|
||||||
|
|
||||||
|
import org.apache.maven.plugin.MojoExecutionException;
|
||||||
|
import org.apache.maven.plugin.MojoFailureException;
|
||||||
|
import org.apache.maven.plugins.annotations.LifecyclePhase;
|
||||||
|
import org.apache.maven.plugins.annotations.Mojo;
|
||||||
|
import org.apache.maven.plugins.annotations.Parameter;
|
||||||
|
import org.apache.maven.plugins.annotations.ResolutionScope;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.kotlin.cli.common.arguments.K2MetadataCompilerArguments;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Mojo(name = "test-metadata", defaultPhase = LifecyclePhase.PROCESS_TEST_SOURCES, requiresDependencyResolution = ResolutionScope.TEST)
|
||||||
|
public class TestMetadataMojo extends MetadataMojo {
|
||||||
|
@Parameter(property = "maven.test.skip", defaultValue = "false")
|
||||||
|
private boolean skip;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected List<String> getSourceFilePaths() {
|
||||||
|
return project.getTestCompileSourceRoots();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void configureSpecificCompilerArguments(@NotNull K2MetadataCompilerArguments arguments) throws MojoExecutionException {
|
||||||
|
String productionOutput = output;
|
||||||
|
|
||||||
|
module = testModule;
|
||||||
|
classpath = testClasspath;
|
||||||
|
// arguments.friendPaths = new String[] { productionOutput };
|
||||||
|
output = testOutput;
|
||||||
|
super.configureSpecificCompilerArguments(arguments);
|
||||||
|
|
||||||
|
if (arguments.classpath == null) {
|
||||||
|
arguments.classpath = productionOutput;
|
||||||
|
} else {
|
||||||
|
arguments.classpath = arguments.classpath + File.pathSeparator + productionOutput;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute() throws MojoExecutionException, MojoFailureException {
|
||||||
|
if (skip) {
|
||||||
|
getLog().info("Test compilation is skipped");
|
||||||
|
} else {
|
||||||
|
super.execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user