From 25234f672aa14536be2c292881a0c6f54263b4ab Mon Sep 17 00:00:00 2001 From: Michael Bogdanov Date: Thu, 3 Sep 2015 15:48:36 +0300 Subject: [PATCH] Maven plugin fixes --- build.xml | 6 +++--- .../src/test/kotlin/NoInternalVisibilityInStdLibTest.kt | 6 ++++-- .../tools/kotlin-maven-plugin/src/it/simple/expected.log | 1 + .../org/jetbrains/kotlin/maven/K2JVMCompileMojo.java | 9 +++++++++ .../jetbrains/kotlin/maven/KotlinTestCompileMojo.java | 1 + 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/build.xml b/build.xml index 3a2a5020366..c67932f2408 100644 --- a/build.xml +++ b/build.xml @@ -499,7 +499,7 @@ - + @@ -526,8 +526,8 @@ - - + + diff --git a/libraries/stdlib/validator/src/test/kotlin/NoInternalVisibilityInStdLibTest.kt b/libraries/stdlib/validator/src/test/kotlin/NoInternalVisibilityInStdLibTest.kt index 729fb91036f..5f3bfb74026 100644 --- a/libraries/stdlib/validator/src/test/kotlin/NoInternalVisibilityInStdLibTest.kt +++ b/libraries/stdlib/validator/src/test/kotlin/NoInternalVisibilityInStdLibTest.kt @@ -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 } diff --git a/libraries/tools/kotlin-maven-plugin/src/it/simple/expected.log b/libraries/tools/kotlin-maven-plugin/src/it/simple/expected.log index dd875df23f3..0debfa1295d 100644 --- a/libraries/tools/kotlin-maven-plugin/src/it/simple/expected.log +++ b/libraries/tools/kotlin-maven-plugin/src/it/simple/expected.log @@ -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 \ No newline at end of file diff --git a/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JVMCompileMojo.java b/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JVMCompileMojo.java index bd8019cc0f0..cbd8676d6dd 100644 --- a/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JVMCompileMojo.java +++ b/libraries/tools/kotlin-maven-plugin/src/main/java/org/jetbrains/kotlin/maven/K2JVMCompileMojo.java @@ -73,6 +73,12 @@ public class K2JVMCompileMojo extends KotlinCompileMojoBase 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