KT-3008 Add module kind attribute to Maven plugin. Fix tests from libraries subproject

This commit is contained in:
Alexey Andreev
2016-04-22 12:23:56 +03:00
parent b6b604d78f
commit 496539d101
7 changed files with 96 additions and 3 deletions
@@ -74,12 +74,28 @@ public class K2JSCompilerMojo extends KotlinCompileMojoBase<K2JSCompilerArgument
@Parameter(defaultValue = "false")
private boolean sourceMap;
/**
* <p>Specifies which JS module system to generate compatible sources for. Options are:</p>
* <ul>
* <li><b>amd</b> &mdash;
* <a href="https://github.com/amdjs/amdjs-api/wiki/AMD"></a>Asynchronous Module System</a>;</li>
* <li><b>commonjs</b> &mdash; npm/CommonJS conventions based on synchronous <code>require</code>
* function;</li>
* <li><b>plain</b> (default) &mdash; no module system, keep all modules in global scope;</li>
* <li><b>umd</b> &mdash; Universal Module Definition, stub wrapper that detects current
* module system in runtime and behaves as <code>plain</code> if none detected.</li>
* </ul>
*/
@Parameter(defaultValue = "plain")
private String moduleKind;
@Override
protected void configureSpecificCompilerArguments(@NotNull K2JSCompilerArguments arguments) throws MojoExecutionException {
arguments.outputFile = outputFile;
arguments.noStdlib = true;
arguments.metaInfo = metaInfo;
arguments.kjsm = kjsm;
arguments.moduleKind = moduleKind;
List<String> libraries = getKotlinJavascriptLibraryFiles();
getLog().debug("libraryFiles: " + libraries);