KT-10028 Support parallel builds in maven
mark all the mojos as not thread safe so Maven should never run them in parallel
This commit is contained in:
+1
-1
@@ -76,7 +76,7 @@ import java.util.List;
|
||||
* mojo.getLog().info("kotlin build script accessing build info of ${mojo.project.artifactId} project")
|
||||
* </code></pre>
|
||||
*/
|
||||
@Mojo(name = "script", requiresDependencyResolution = ResolutionScope.COMPILE)
|
||||
@Mojo(name = "script", requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = false)
|
||||
public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
/**
|
||||
* The Kotlin script file to be executed.
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ import java.util.concurrent.locks.ReentrantLock;
|
||||
*
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
@Mojo(name = "js", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = true)
|
||||
@Mojo(name = "js", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = false)
|
||||
public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArguments> {
|
||||
|
||||
private static final String OUTPUT_DIRECTORIES_COLLECTOR_PROPERTY_NAME = "outputDirectoriesCollector";
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ import static org.jetbrains.kotlin.maven.Util.filterClassPath;
|
||||
*
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
@Mojo(name = "compile", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE)
|
||||
@Mojo(name = "compile", defaultPhase = LifecyclePhase.COMPILE, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = false)
|
||||
public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArguments> {
|
||||
/**
|
||||
* Project classpath.
|
||||
|
||||
+2
-1
@@ -41,7 +41,8 @@ import java.util.List;
|
||||
|
||||
@Mojo(name = "test-compile",
|
||||
defaultPhase = LifecyclePhase.TEST_COMPILE,
|
||||
requiresDependencyResolution = ResolutionScope.TEST
|
||||
requiresDependencyResolution = ResolutionScope.TEST,
|
||||
threadSafe = false
|
||||
)
|
||||
public class KotlinTestCompileMojo extends K2JVMCompileMojo {
|
||||
/**
|
||||
|
||||
+2
-1
@@ -36,7 +36,8 @@ import java.util.List;
|
||||
*/
|
||||
@Mojo(name = "test-js",
|
||||
defaultPhase = LifecyclePhase.TEST_COMPILE,
|
||||
requiresDependencyResolution = ResolutionScope.TEST
|
||||
requiresDependencyResolution = ResolutionScope.TEST,
|
||||
threadSafe = true
|
||||
)
|
||||
public class KotlinTestJSCompilerMojo extends K2JSCompilerMojo {
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ import java.util.List;
|
||||
import static com.intellij.openapi.util.text.StringUtil.join;
|
||||
import static org.jetbrains.kotlin.maven.Util.filterClassPath;
|
||||
|
||||
@Mojo(name = "metadata", defaultPhase = LifecyclePhase.PROCESS_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE)
|
||||
@Mojo(name = "metadata", defaultPhase = LifecyclePhase.PROCESS_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = false)
|
||||
public class MetadataMojo extends KotlinCompileMojoBase<K2MetadataCompilerArguments> {
|
||||
@Parameter(defaultValue = "${project.compileClasspathElements}", required = true, readonly = true)
|
||||
public List<String> classpath;
|
||||
|
||||
+3
-1
@@ -12,7 +12,9 @@ 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)
|
||||
@Mojo(name = "test-metadata", defaultPhase = LifecyclePhase.PROCESS_TEST_SOURCES, requiresDependencyResolution = ResolutionScope.TEST,
|
||||
threadSafe = false
|
||||
)
|
||||
public class TestMetadataMojo extends MetadataMojo {
|
||||
@Parameter(property = "maven.test.skip", defaultValue = "false")
|
||||
private boolean skip;
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ import static org.jetbrains.kotlin.maven.kapt.AnnotationProcessingManager.getGen
|
||||
import static org.jetbrains.kotlin.maven.kapt.AnnotationProcessingManager.getStubsDirectory;
|
||||
|
||||
/** @noinspection UnusedDeclaration */
|
||||
@Mojo(name = "kapt", defaultPhase = LifecyclePhase.PROCESS_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE)
|
||||
@Mojo(name = "kapt", defaultPhase = LifecyclePhase.PROCESS_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = false)
|
||||
public class KaptJVMCompilerMojo extends K2JVMCompileMojo {
|
||||
@Parameter
|
||||
private String[] annotationProcessors;
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ import java.util.List;
|
||||
*
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
@Mojo(name = "test-kapt", defaultPhase = LifecyclePhase.PROCESS_TEST_SOURCES, requiresDependencyResolution = ResolutionScope.TEST)
|
||||
@Mojo(name = "test-kapt", defaultPhase = LifecyclePhase.PROCESS_TEST_SOURCES, requiresDependencyResolution = ResolutionScope.TEST, threadSafe = false)
|
||||
public class KaptTestJvmCompilerMojo extends KaptJVMCompilerMojo {
|
||||
/**
|
||||
* Flag to allow test compilation to be skipped.
|
||||
|
||||
Reference in New Issue
Block a user