Maven plugin fixes

This commit is contained in:
Michael Bogdanov
2015-09-03 15:48:36 +03:00
parent c31f2eecc1
commit 25234f672a
5 changed files with 18 additions and 5 deletions
@@ -42,6 +42,7 @@ import org.jetbrains.kotlin.js.analyze.TopDownAnalyzerFacadeForJS
import com.intellij.openapi.Disposable
import org.jetbrains.kotlin.cli.jvm.compiler.CliLightClassGenerationSupport
import org.jetbrains.kotlin.context.ModuleContext
import org.jetbrains.kotlin.cli.jvm.compiler.JvmPackagePartProvider
private val ANALYZE_PACKAGE_ROOTS_FOR_JVM = listOf("kotlin")
private val ANALYZE_PACKAGE_ROOTS_FOR_JS = listOf("kotlin", "jquery", "html5")
@@ -125,8 +126,9 @@ class NoInternalVisibilityInStdLibTest {
val environment = KotlinCoreEnvironment.createForProduction(disposable!!, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES)
TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegrationWithCustomContext(
TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(environment.project),
environment.getSourceFiles(), CliLightClassGenerationSupport.NoScopeRecordCliBindingTrace(), null, null
TopDownAnalyzerFacadeForJVM.createContextWithSealedModule(environment.project, "test"),
environment.getSourceFiles(), CliLightClassGenerationSupport.NoScopeRecordCliBindingTrace(), null, null,
JvmPackagePartProvider(environment)
).moduleDescriptor
}
@@ -2,6 +2,7 @@
[INFO] Compiling Kotlin sources from [/src/main/kotlin]
[INFO] Classes directory is /target/classes
[INFO] Using kotlin annotations from /local-repo/org/jetbrains/kotlin/kotlin-jdk-annotations/0.1-SNAPSHOT/kotlin-jdk-annotations-0.1-SNAPSHOT.jar
[INFO] ModuleName is test-project
[INFO] PERF: INIT: Compiler initialized in LLL ms
[INFO] PERF: ANALYZE: 1 files (2 lines) in LLL ms
[INFO] PERF: GENERATE: 1 files (2 lines) in LLL ms
@@ -73,6 +73,12 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
@Parameter(defaultValue = "${project.testClasspathElements}", required = true, readonly = true)
protected List<String> testClasspath;
@Parameter(defaultValue = "${project.artifactId}", required = true, readonly = true)
protected String moduleName;
@Parameter(defaultValue = "${project.artifactId}-test", required = true, readonly = true)
protected String testModuleName;
@NotNull
@Override
protected K2JVMCompiler createCompiler() {
@@ -112,6 +118,9 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase<K2JVMCompilerArgumen
arguments.annotations = getFullAnnotationsPath(getLog(), annotationPaths);
getLog().info("Using kotlin annotations from " + arguments.annotations);
arguments.moduleName = moduleName;
getLog().info("ModuleName is " + moduleName);
try {
Args.parse(arguments, ArrayUtil.toStringArray(args));
}
@@ -87,6 +87,7 @@ public class KotlinTestCompileMojo extends K2JVMCompileMojo {
module = testModule;
classpath = testClasspath;
output = testOutput;
moduleName = testModuleName;
super.configureSpecificCompilerArguments(arguments);
}