Maven plugin: fix warnings, update copyrights
This commit is contained in:
+13
-22
@@ -23,7 +23,6 @@ import org.apache.maven.artifact.DefaultArtifact;
|
||||
import org.apache.maven.artifact.handler.ArtifactHandler;
|
||||
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
|
||||
import org.apache.maven.artifact.repository.ArtifactRepository;
|
||||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
@@ -58,6 +57,7 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Allows to execute kotlin script files during the build process.
|
||||
@@ -106,13 +106,13 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
@Parameter(defaultValue = "${localRepository}", required = true, readonly = true)
|
||||
private ArtifactRepository localRepository;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.scriptTemplates", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.scriptTemplates")
|
||||
protected List<String> scriptTemplates;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.scriptArguments", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.scriptArguments")
|
||||
protected List<String> scriptArguments;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.scriptClasspath", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.scriptClasspath")
|
||||
protected List<String> scriptClasspath;
|
||||
|
||||
@Component
|
||||
@@ -167,7 +167,7 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
|
||||
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageCollector);
|
||||
|
||||
List<File> deps = new ArrayList<File>();
|
||||
List<File> deps = new ArrayList<>();
|
||||
|
||||
deps.addAll(PathUtil.getJdkClassesRootsFromCurrentJre());
|
||||
deps.addAll(getDependenciesForScript());
|
||||
@@ -184,7 +184,10 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
configuration.add(JVMConfigurationKeys.CONTENT_ROOTS, new KotlinSourceRoot(scriptFile.getAbsolutePath()));
|
||||
configuration.put(CommonConfigurationKeys.MODULE_NAME, JvmAbi.DEFAULT_MODULE_NAME);
|
||||
|
||||
K2JVMCompiler.Companion.configureScriptDefinitions(scriptTemplates.toArray(new String[scriptTemplates.size()]), configuration, messageCollector, new HashMap<String, Object>());
|
||||
K2JVMCompiler.Companion.configureScriptDefinitions(
|
||||
scriptTemplates.toArray(new String[scriptTemplates.size()]),
|
||||
configuration, messageCollector, new HashMap<>()
|
||||
);
|
||||
|
||||
KotlinCoreEnvironment environment = KotlinCoreEnvironment.createForProduction(rootDisposable, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES);
|
||||
|
||||
@@ -214,7 +217,7 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
}
|
||||
|
||||
private List<File> getDependenciesForScript() throws MojoExecutionException {
|
||||
List<File> deps = new ArrayList<File>();
|
||||
List<File> deps = new ArrayList<>();
|
||||
|
||||
deps.addAll(getKotlinRuntimeDependencies());
|
||||
deps.add(getThisPluginAsDependency());
|
||||
@@ -234,25 +237,13 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
return getArtifactFile(artifact);
|
||||
}
|
||||
|
||||
private File getDependencyFile(Dependency dep) {
|
||||
ArtifactHandler artifactHandler = artifactHandlerManager.getArtifactHandler(dep.getType());
|
||||
Artifact artifact = new DefaultArtifact(dep.getGroupId(), dep.getArtifactId(), dep.getVersion(), null, dep.getType(), null, artifactHandler);
|
||||
return getArtifactFile(artifact);
|
||||
}
|
||||
|
||||
private File getArtifactFile(Artifact artifact) {
|
||||
localRepository.find(artifact);
|
||||
return artifact.getFile();
|
||||
}
|
||||
|
||||
private List<File> getThisPluginDependencies() {
|
||||
List<File> files = new ArrayList<File>();
|
||||
|
||||
for (ComponentDependency dep: plugin.getDependencies()) {
|
||||
files.add(getDependencyFile(dep));
|
||||
}
|
||||
|
||||
return files;
|
||||
return plugin.getDependencies().stream().map(this::getDependencyFile).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private File getThisPluginAsDependency() {
|
||||
@@ -269,7 +260,7 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
Artifact stdlibDep = null;
|
||||
Artifact runtimeDep = null;
|
||||
|
||||
ArrayList<File> files = new ArrayList<File>(2);
|
||||
ArrayList<File> files = new ArrayList<>(2);
|
||||
|
||||
for (Artifact dep: project.getArtifacts()) {
|
||||
if (dep.getArtifactId().equals("kotlin-stdlib")) {
|
||||
@@ -297,4 +288,4 @@ public class ExecuteKotlinScriptMojo extends AbstractMojo {
|
||||
// at com.intellij.openapi.application.PathManager.getHomePath(PathManager.java:96)
|
||||
new K2JVMCompiler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -102,7 +102,7 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
|
||||
arguments.moduleKind = moduleKind;
|
||||
arguments.main = main;
|
||||
|
||||
List<String> libraries = null;
|
||||
List<String> libraries;
|
||||
try {
|
||||
libraries = getKotlinJavascriptLibraryFiles();
|
||||
} catch (DependencyResolutionRequiredException e) {
|
||||
@@ -118,7 +118,7 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
|
||||
if (outputFile != null) {
|
||||
ConcurrentMap<String, List<String>> collector = getOutputDirectoriesCollector();
|
||||
String key = project.getArtifactId();
|
||||
List<String> paths = collector.computeIfAbsent(key, k -> Collections.synchronizedList(new ArrayList<String>()));
|
||||
List<String> paths = collector.computeIfAbsent(key, k -> Collections.synchronizedList(new ArrayList<>()));
|
||||
paths.add(new File(outputFile).getParent());
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
|
||||
*/
|
||||
@NotNull
|
||||
private List<String> getKotlinJavascriptLibraryFiles() throws DependencyResolutionRequiredException {
|
||||
List<String> libraries = new ArrayList<String>();
|
||||
List<String> libraries = new ArrayList<>();
|
||||
|
||||
for (String path : getClassPathElements()) {
|
||||
File file = new File(path);
|
||||
@@ -197,7 +197,7 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
|
||||
try {
|
||||
ConcurrentMap<String, List<String>> collector = (ConcurrentMap<String, List<String>>) getPluginContext().get(OUTPUT_DIRECTORIES_COLLECTOR_PROPERTY_NAME);
|
||||
if (collector == null) {
|
||||
collector = new ConcurrentSkipListMap<String, List<String>>();
|
||||
collector = new ConcurrentSkipListMap<>();
|
||||
getPluginContext().put(OUTPUT_DIRECTORIES_COLLECTOR_PROPERTY_NAME, collector);
|
||||
}
|
||||
|
||||
|
||||
+16
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,10 @@ package org.jetbrains.kotlin.maven;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
import org.apache.maven.plugins.annotations.*;
|
||||
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.apache.maven.project.MavenProject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -34,7 +37,8 @@ import org.jetbrains.kotlin.maven.kapt.AnnotationProcessingManager;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URL;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.intellij.openapi.util.text.StringUtil.join;
|
||||
import static org.jetbrains.kotlin.maven.Util.filterClassPath;
|
||||
@@ -64,22 +68,22 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
|
||||
@Parameter(defaultValue = "${project.artifactId}-test", required = true, readonly = true)
|
||||
protected String testModuleName;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.jvmTarget", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.jvmTarget")
|
||||
protected String jvmTarget;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.jdkHome", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.jdkHome")
|
||||
protected String jdkHome;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.scriptTemplates", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.scriptTemplates")
|
||||
protected List<String> scriptTemplates;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.incremental", defaultValue = "false", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.incremental", defaultValue = "false")
|
||||
private boolean myIncremental;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.incremental.cache.root", defaultValue = "${project.build.directory}/kotlin-ic", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.incremental.cache.root", defaultValue = "${project.build.directory}/kotlin-ic")
|
||||
public String incrementalCachesRoot;
|
||||
|
||||
@Parameter(property = "kotlin.compiler.javaParameters", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.javaParameters")
|
||||
protected boolean javaParameters;
|
||||
|
||||
@NotNull
|
||||
@@ -119,7 +123,7 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
|
||||
|
||||
File sourcesDir = AnnotationProcessingManager.getGeneratedSourcesDirectory(project, getSourceSetName());
|
||||
if (sourcesDir.isDirectory()) {
|
||||
paths = new ArrayList<String>(paths);
|
||||
paths = new ArrayList<>(paths);
|
||||
paths.add(sourcesDir.getAbsolutePath());
|
||||
}
|
||||
|
||||
@@ -184,13 +188,14 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
|
||||
if (toolsJar != null) {
|
||||
project.getClassRealm().addURL(toolsJar);
|
||||
}
|
||||
} catch (IOException ex) {}
|
||||
} catch (IOException ignored) {}
|
||||
}
|
||||
|
||||
super.execute();
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
protected ExitCode execCompiler(
|
||||
CLICompiler<K2JVMCompilerArguments> compiler,
|
||||
MessageCollector messageCollector,
|
||||
|
||||
+16
-9
@@ -1,22 +1,29 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import org.apache.maven.plugin.compiler.CompilationFailureException;
|
||||
import org.codehaus.plexus.compiler.CompilerMessage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class KotlinCompilationFailureException extends CompilationFailureException {
|
||||
private List<CompilerMessage> compilerMessages;
|
||||
|
||||
public KotlinCompilationFailureException(@NotNull List<CompilerMessage> compilerMessages) {
|
||||
super(compilerMessages);
|
||||
this.compilerMessages = Collections.unmodifiableList(compilerMessages);
|
||||
}
|
||||
|
||||
public List<CompilerMessage> getCompilerMessages() {
|
||||
return compilerMessages;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+25
-41
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -20,14 +20,16 @@ import com.google.common.base.Joiner;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import com.intellij.util.Processor;
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolutionRequest;
|
||||
import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
|
||||
import org.apache.maven.model.Dependency;
|
||||
import org.apache.maven.model.Plugin;
|
||||
import org.apache.maven.model.PluginExecution;
|
||||
import org.apache.maven.plugin.*;
|
||||
import org.apache.maven.plugin.AbstractMojo;
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
import org.apache.maven.plugin.MojoFailureException;
|
||||
import org.apache.maven.plugins.annotations.Component;
|
||||
import org.apache.maven.plugins.annotations.Parameter;
|
||||
import org.apache.maven.project.MavenProject;
|
||||
@@ -80,18 +82,15 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
@Parameter
|
||||
private boolean multiPlatform = false;
|
||||
|
||||
private List<String> getAppliedCompilerPlugins() {
|
||||
return (compilerPlugins == null) ? Collections.<String>emptyList() : compilerPlugins;
|
||||
}
|
||||
|
||||
protected List<String> getSourceFilePaths() {
|
||||
if (sourceDirs != null && !sourceDirs.isEmpty()) return sourceDirs;
|
||||
return project.getCompileSourceRoots();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private List<File> getSourceDirs() {
|
||||
List<String> sources = getSourceFilePaths();
|
||||
List<File> result = new ArrayList<File>(sources.size());
|
||||
List<File> result = new ArrayList<>(sources.size());
|
||||
|
||||
for (String source : sources) {
|
||||
addSourceRoots(result, source);
|
||||
@@ -168,17 +167,17 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
public String testModule;
|
||||
|
||||
|
||||
@Parameter(property = "kotlin.compiler.languageVersion", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.languageVersion")
|
||||
protected String languageVersion;
|
||||
|
||||
|
||||
@Parameter(property = "kotlin.compiler.apiVersion", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.apiVersion")
|
||||
protected String apiVersion;
|
||||
|
||||
/**
|
||||
* possible values are: enable, error, warn
|
||||
*/
|
||||
@Parameter(property = "kotlin.compiler.experimental.coroutines", required = false, readonly = false)
|
||||
@Parameter(property = "kotlin.compiler.experimental.coroutines")
|
||||
@Nullable
|
||||
protected String experimentalCoroutines;
|
||||
|
||||
@@ -237,17 +236,9 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
}
|
||||
|
||||
private boolean hasKotlinFilesInSources() throws MojoExecutionException {
|
||||
List<File> sources = getSourceDirs();
|
||||
if (sources == null || sources.isEmpty()) return false;
|
||||
|
||||
for (File root : sources) {
|
||||
for (File root : getSourceDirs()) {
|
||||
if (root.exists()) {
|
||||
boolean sourcesExists = !FileUtil.processFilesRecursively(root, new Processor<File>() {
|
||||
@Override
|
||||
public boolean process(File file) {
|
||||
return !file.getName().endsWith(".kt");
|
||||
}
|
||||
});
|
||||
boolean sourcesExists = !FileUtil.processFilesRecursively(root, file -> !file.getName().endsWith(".kt"));
|
||||
if (sourcesExists) return true;
|
||||
}
|
||||
}
|
||||
@@ -293,9 +284,9 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
protected abstract void configureSpecificCompilerArguments(@NotNull A arguments, @NotNull List<File> sourceRoots) throws MojoExecutionException;
|
||||
|
||||
private List<String> getCompilerPluginClassPaths() {
|
||||
ArrayList<String> result = new ArrayList<String>();
|
||||
ArrayList<String> result = new ArrayList<>();
|
||||
|
||||
List<File> files = new ArrayList<File>();
|
||||
List<File> files = new ArrayList<>();
|
||||
|
||||
for (Dependency dependency : mojoExecution.getPlugin().getDependencies()) {
|
||||
Artifact artifact = system.createDependencyArtifact(dependency);
|
||||
@@ -319,14 +310,15 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
|
||||
@NotNull
|
||||
private Map<String, KotlinMavenPluginExtension> loadCompilerPlugins() throws PluginNotFoundException {
|
||||
Map<String, KotlinMavenPluginExtension> loadedPlugins = new HashMap<String, KotlinMavenPluginExtension>();
|
||||
for (String pluginName : getAppliedCompilerPlugins()) {
|
||||
if (compilerPlugins == null) return Collections.emptyMap();
|
||||
|
||||
Map<String, KotlinMavenPluginExtension> loadedPlugins = new HashMap<>();
|
||||
for (String pluginName : compilerPlugins) {
|
||||
getLog().debug("Looking for plugin " + pluginName);
|
||||
try {
|
||||
KotlinMavenPluginExtension extension = container.lookup(KotlinMavenPluginExtension.class, pluginName);
|
||||
loadedPlugins.put(pluginName, extension);
|
||||
getLog().debug("Got plugin instance" + pluginName + " of type " + extension.getClass().getName());
|
||||
|
||||
} catch (ComponentLookupException e) {
|
||||
getLog().debug("Unable to get plugin instance" + pluginName);
|
||||
throw new PluginNotFoundException(pluginName, e);
|
||||
@@ -337,7 +329,7 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
|
||||
@NotNull
|
||||
private List<String> renderCompilerPluginOptions(@NotNull List<PluginOption> options) {
|
||||
List<String> renderedOptions = new ArrayList<String>(options.size());
|
||||
List<String> renderedOptions = new ArrayList<>(options.size());
|
||||
for (PluginOption option : options) {
|
||||
renderedOptions.add(option.toString());
|
||||
}
|
||||
@@ -350,7 +342,7 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
throw new IllegalStateException("No mojoExecution injected");
|
||||
}
|
||||
|
||||
List<PluginOption> pluginOptions = new ArrayList<PluginOption>();
|
||||
List<PluginOption> pluginOptions = new ArrayList<>();
|
||||
|
||||
Map<String, KotlinMavenPluginExtension> plugins = loadCompilerPlugins();
|
||||
|
||||
@@ -374,15 +366,9 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
pluginOptions.addAll(parseUserProvidedPluginOptions(this.pluginOptions, plugins));
|
||||
}
|
||||
|
||||
Map<String, List<PluginOption>> optionsByPluginName = new LinkedHashMap<String, List<PluginOption>>();
|
||||
Map<String, List<PluginOption>> optionsByPluginName = new LinkedHashMap<>();
|
||||
for (PluginOption option : pluginOptions) {
|
||||
List<PluginOption> optionsForPlugin = optionsByPluginName.get(option.pluginName);
|
||||
if (optionsForPlugin == null) {
|
||||
optionsForPlugin = new ArrayList<PluginOption>();
|
||||
optionsByPluginName.put(option.pluginName, optionsForPlugin);
|
||||
}
|
||||
|
||||
optionsForPlugin.add(option);
|
||||
optionsByPluginName.computeIfAbsent(option.pluginName, key -> new ArrayList<>()).add(option);
|
||||
}
|
||||
|
||||
for (Map.Entry<String, List<PluginOption>> entry : optionsByPluginName.entrySet()) {
|
||||
@@ -410,7 +396,7 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
@NotNull List<String> rawOptions,
|
||||
@NotNull Map<String, KotlinMavenPluginExtension> plugins
|
||||
) throws PluginOptionIllegalFormatException, PluginNotFoundException {
|
||||
List<PluginOption> pluginOptions = new ArrayList<PluginOption>(rawOptions.size());
|
||||
List<PluginOption> pluginOptions = new ArrayList<>(rawOptions.size());
|
||||
|
||||
for (String rawOption : rawOptions) {
|
||||
Matcher matcher = OPTION_PATTERN.matcher(rawOption);
|
||||
@@ -434,7 +420,7 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
|
||||
@NotNull
|
||||
private List<File> getSourceRoots() throws MojoExecutionException {
|
||||
List<File> sourceRoots = new ArrayList<File>();
|
||||
List<File> sourceRoots = new ArrayList<>();
|
||||
for (File sourceDir : getSourceDirs()) {
|
||||
if (sourceDir.exists()) {
|
||||
sourceRoots.add(sourceDir);
|
||||
@@ -489,9 +475,7 @@ public abstract class KotlinCompileMojoBase<A extends CommonCompilerArguments> e
|
||||
List<String> pluginArguments;
|
||||
try {
|
||||
pluginArguments = renderCompilerPluginOptions(getCompilerPluginOptions());
|
||||
} catch (PluginNotFoundException e) {
|
||||
throw new MojoExecutionException(e.getMessage(), e);
|
||||
} catch (PluginOptionIllegalFormatException e) {
|
||||
} catch (PluginNotFoundException | PluginOptionIllegalFormatException e) {
|
||||
throw new MojoExecutionException(e.getMessage(), e);
|
||||
}
|
||||
|
||||
|
||||
+16
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecution;
|
||||
|
||||
+3
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -26,20 +26,15 @@ import org.apache.maven.project.MavenProject;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments;
|
||||
import org.jetbrains.kotlin.maven.kapt.AnnotationProcessingManager;
|
||||
import org.jetbrains.kotlin.maven.kapt.KaptTestJvmCompilerMojo;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
// Note!
|
||||
// Please change {@link KaptTestJvmCompilerMojo} because it was mostly copied from this file.
|
||||
/**
|
||||
* Compiles Kotlin test sources
|
||||
*
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
|
||||
/** Note!
|
||||
* Please change {@link KaptTestJvmCompilerMojo} as well as it was majorly copied from this file. */
|
||||
|
||||
@Mojo(name = "test-compile",
|
||||
defaultPhase = LifecyclePhase.TEST_COMPILE,
|
||||
requiresDependencyResolution = ResolutionScope.TEST,
|
||||
|
||||
+4
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2013 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,12 +29,11 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Converts Kotlin to JavaScript code
|
||||
*
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
@Mojo(name = "test-js",
|
||||
defaultPhase = LifecyclePhase.TEST_COMPILE,
|
||||
@@ -74,7 +73,7 @@ public class KotlinTestJSCompilerMojo extends K2JSCompilerMojo {
|
||||
private String outputFile;
|
||||
|
||||
/**
|
||||
* Flag enables or disables metafile generation
|
||||
* Flag enables or disables .meta.js file generation
|
||||
*/
|
||||
@Parameter(defaultValue = "true")
|
||||
private boolean metaInfo;
|
||||
|
||||
+22
-28
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,8 +17,6 @@
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import com.intellij.openapi.util.Pair;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import org.apache.maven.plugin.logging.Log;
|
||||
import org.codehaus.plexus.compiler.CompilerMessage;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -30,12 +28,13 @@ import org.jetbrains.kotlin.cli.common.messages.MessageCollector;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.google.common.base.Preconditions.checkNotNull;
|
||||
|
||||
public class MavenPluginLogMessageCollector implements MessageCollector {
|
||||
private final Log log;
|
||||
private final ArrayList<Pair<CompilerMessageLocation, String>> collectedErrors = new ArrayList<Pair<CompilerMessageLocation, String>>();
|
||||
private final ArrayList<Pair<CompilerMessageLocation, String>> collectedErrors = new ArrayList<>();
|
||||
|
||||
public MavenPluginLogMessageCollector(Log log) {
|
||||
this.log = checkNotNull(log, "log shouldn't be null");
|
||||
@@ -65,7 +64,7 @@ public class MavenPluginLogMessageCollector implements MessageCollector {
|
||||
switch (severity) {
|
||||
case EXCEPTION:
|
||||
case ERROR: {
|
||||
collectedErrors.add(new Pair<CompilerMessageLocation, String>(location, message));
|
||||
collectedErrors.add(new Pair<>(location, message));
|
||||
log.error(text);
|
||||
break;
|
||||
}
|
||||
@@ -90,31 +89,26 @@ public class MavenPluginLogMessageCollector implements MessageCollector {
|
||||
}
|
||||
|
||||
public void throwKotlinCompilerException() throws KotlinCompilationFailureException {
|
||||
throw new KotlinCompilationFailureException(
|
||||
CollectionsKt.map(getCollectedErrors(), new Function1<Pair<CompilerMessageLocation, String>, CompilerMessage>() {
|
||||
@Override
|
||||
public CompilerMessage invoke(Pair<CompilerMessageLocation, String> pair) {
|
||||
CompilerMessageLocation location = pair.getFirst();
|
||||
String message = pair.getSecond();
|
||||
if (location == null) {
|
||||
return new CompilerMessage(null, CompilerMessage.Kind.ERROR, 0, 0, 0, 0, message);
|
||||
}
|
||||
throw new KotlinCompilationFailureException(getCollectedErrors().stream().map(pair -> {
|
||||
CompilerMessageLocation location = pair.getFirst();
|
||||
String message = pair.getSecond();
|
||||
if (location == null) {
|
||||
return new CompilerMessage(null, CompilerMessage.Kind.ERROR, 0, 0, 0, 0, message);
|
||||
}
|
||||
|
||||
String lineContent = location.getLineContent();
|
||||
int lineContentLength = lineContent == null ? 0 : lineContent.length();
|
||||
String lineContent = location.getLineContent();
|
||||
int lineContentLength = lineContent == null ? 0 : lineContent.length();
|
||||
|
||||
return new CompilerMessage(
|
||||
location.getPath(),
|
||||
CompilerMessage.Kind.ERROR,
|
||||
fixLocation(location.getLine()),
|
||||
fixLocation(location.getColumn()),
|
||||
fixLocation(location.getLine()),
|
||||
Math.min(fixLocation(location.getColumn()), lineContentLength),
|
||||
message
|
||||
);
|
||||
}
|
||||
})
|
||||
);
|
||||
return new CompilerMessage(
|
||||
location.getPath(),
|
||||
CompilerMessage.Kind.ERROR,
|
||||
fixLocation(location.getLine()),
|
||||
fixLocation(location.getColumn()),
|
||||
fixLocation(location.getLine()),
|
||||
Math.min(fixLocation(location.getColumn()), lineContentLength),
|
||||
message
|
||||
);
|
||||
}).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
private static int fixLocation(int n) {
|
||||
|
||||
+16
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
+17
-1
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
public class PluginOption {
|
||||
@@ -21,4 +37,4 @@ public class PluginOption {
|
||||
public String toString() {
|
||||
return "plugin:" + pluginId + ":" + key + "=" + value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
+16
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
|
||||
+5
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,19 +16,14 @@
|
||||
|
||||
package org.jetbrains.kotlin.maven;
|
||||
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class Util {
|
||||
static List<String> filterClassPath(final File basedir, List<String> classpath) {
|
||||
return CollectionsKt.filter(classpath, new Function1<String, Boolean>() {
|
||||
@Override
|
||||
public Boolean invoke(String s) {
|
||||
return new File(s).exists() || new File(basedir, s).exists();
|
||||
}
|
||||
});
|
||||
return classpath.stream().filter(s ->
|
||||
new File(s).exists() || new File(basedir, s).exists()
|
||||
).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
|
||||
+17
-1
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven.incremental;
|
||||
|
||||
import kotlin.jvm.functions.Function0;
|
||||
@@ -77,7 +93,7 @@ public class MavenICReporter implements ICReporter {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private final Set<File> compiledKotlinFiles = new HashSet<File>();
|
||||
private final Set<File> compiledKotlinFiles = new HashSet<>();
|
||||
|
||||
protected boolean isLogEnabled() {
|
||||
return false;
|
||||
|
||||
+26
-11
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven.kapt;
|
||||
|
||||
import org.apache.maven.artifact.Artifact;
|
||||
@@ -68,15 +84,14 @@ public class AnnotationProcessingManager {
|
||||
|
||||
@NotNull
|
||||
static File getGeneratedClassesDirectory(@NotNull MavenProject project, @NotNull String sourceSetName) {
|
||||
if (sourceSetName.equals(COMPILE_SOURCE_SET_NAME)) {
|
||||
return new File(project.getModel().getBuild().getOutputDirectory());
|
||||
}
|
||||
else if (sourceSetName.equals(TEST_SOURCE_SET_NAME)) {
|
||||
return new File(project.getModel().getBuild().getTestOutputDirectory());
|
||||
}
|
||||
else {
|
||||
throw new IllegalArgumentException("'" + COMPILE_SOURCE_SET_NAME + "' or '" +
|
||||
TEST_SOURCE_SET_NAME + "' expected");
|
||||
switch (sourceSetName) {
|
||||
case COMPILE_SOURCE_SET_NAME:
|
||||
return new File(project.getModel().getBuild().getOutputDirectory());
|
||||
case TEST_SOURCE_SET_NAME:
|
||||
return new File(project.getModel().getBuild().getTestOutputDirectory());
|
||||
default:
|
||||
throw new IllegalArgumentException("'" + COMPILE_SOURCE_SET_NAME + "' or '" +
|
||||
TEST_SOURCE_SET_NAME + "' expected");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +106,7 @@ public class AnnotationProcessingManager {
|
||||
aptDependencies = Collections.emptyList();
|
||||
}
|
||||
|
||||
Set<Artifact> requiredArtifacts = new LinkedHashSet<Artifact>();
|
||||
Set<Artifact> requiredArtifacts = new LinkedHashSet<>();
|
||||
|
||||
requiredArtifacts.add(getArtifact(artifactHandlerManager, KAPT_DEPENDENCY));
|
||||
|
||||
@@ -114,7 +129,7 @@ public class AnnotationProcessingManager {
|
||||
throw new IllegalStateException("Annotation processing artifacts were not resolved.");
|
||||
}
|
||||
|
||||
List<String> apClasspath = new ArrayList<String>(resolutionResult.getArtifacts().size());
|
||||
List<String> apClasspath = new ArrayList<>(resolutionResult.getArtifacts().size());
|
||||
String kaptCompilerPluginArtifact = null;
|
||||
|
||||
for (Artifact artifact : resolutionResult.getArtifacts()) {
|
||||
|
||||
+19
-5
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven.kapt;
|
||||
|
||||
import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
|
||||
@@ -15,12 +31,10 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jetbrains.kotlin.maven.kapt.AnnotationProcessingManager.getGeneratedClassesDirectory;
|
||||
import static org.jetbrains.kotlin.maven.kapt.AnnotationProcessingManager.getGeneratedSourcesDirectory;
|
||||
import static org.jetbrains.kotlin.maven.kapt.AnnotationProcessingManager.getStubsDirectory;
|
||||
import static org.jetbrains.kotlin.maven.kapt.AnnotationProcessingManager.*;
|
||||
|
||||
/** @noinspection UnusedDeclaration */
|
||||
@Mojo(name = "kapt", defaultPhase = LifecyclePhase.PROCESS_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE, threadSafe = false)
|
||||
@Mojo(name = "kapt", defaultPhase = LifecyclePhase.PROCESS_SOURCES, requiresDependencyResolution = ResolutionScope.COMPILE)
|
||||
public class KaptJVMCompilerMojo extends K2JVMCompileMojo {
|
||||
@Parameter
|
||||
private String[] annotationProcessors;
|
||||
@@ -62,7 +76,7 @@ public class KaptJVMCompilerMojo extends K2JVMCompileMojo {
|
||||
@NotNull K2JVMCompilerArguments arguments,
|
||||
@NotNull AnnotationProcessingManager.ResolvedArtifacts resolvedArtifacts
|
||||
) {
|
||||
List<KaptOption> options = new ArrayList<KaptOption>();
|
||||
List<KaptOption> options = new ArrayList<>();
|
||||
|
||||
options.add(new KaptOption("aptOnly", true));
|
||||
options.add(new KaptOption("useLightAnalysis", useLightAnalysis));
|
||||
|
||||
+16
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven.kapt;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
+17
-1
@@ -1,3 +1,19 @@
|
||||
/*
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.maven.kapt;
|
||||
|
||||
import org.apache.maven.plugin.MojoExecutionException;
|
||||
@@ -18,7 +34,7 @@ import java.util.List;
|
||||
*
|
||||
* @noinspection UnusedDeclaration
|
||||
*/
|
||||
@Mojo(name = "test-kapt", defaultPhase = LifecyclePhase.PROCESS_TEST_SOURCES, requiresDependencyResolution = ResolutionScope.TEST, threadSafe = false)
|
||||
@Mojo(name = "test-kapt", defaultPhase = LifecyclePhase.PROCESS_TEST_SOURCES, requiresDependencyResolution = ResolutionScope.TEST)
|
||||
public class KaptTestJvmCompilerMojo extends KaptJVMCompilerMojo {
|
||||
/**
|
||||
* Flag to allow test compilation to be skipped.
|
||||
|
||||
Reference in New Issue
Block a user