KotlinProjectConfigurator: J2K
This commit is contained in:
+2
-3
@@ -38,9 +38,8 @@ class KotlinJavaMavenConfigurator : KotlinMavenConfigurator(KotlinJavaMavenConfi
|
|||||||
createExecution(pomFile, kotlinPlugin, PomFile.DefaultPhases.TestCompile, PomFile.KotlinGoals.TestCompile, module, true)
|
createExecution(pomFile, kotlinPlugin, PomFile.DefaultPhases.TestCompile, PomFile.KotlinGoals.TestCompile, module, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTargetPlatform(): TargetPlatform {
|
override val targetPlatform: TargetPlatform
|
||||||
return JvmPlatform
|
get() = JvmPlatform
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val NAME = "maven"
|
private val NAME = "maven"
|
||||||
|
|||||||
+2
-3
@@ -38,9 +38,8 @@ class KotlinJavascriptMavenConfigurator : KotlinMavenConfigurator(KotlinJavascri
|
|||||||
createExecution(pomFile, kotlinPlugin, PomFile.DefaultPhases.TestCompile, PomFile.KotlinGoals.TestJs, module, true)
|
createExecution(pomFile, kotlinPlugin, PomFile.DefaultPhases.TestCompile, PomFile.KotlinGoals.TestJs, module, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTargetPlatform(): TargetPlatform {
|
override val targetPlatform: TargetPlatform
|
||||||
return JsPlatform
|
get() = JsPlatform
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val NAME = "js maven"
|
private val NAME = "js maven"
|
||||||
|
|||||||
+6
-7
@@ -41,18 +41,17 @@ import org.jetbrains.kotlin.idea.framework.ui.ConfigureDialogWithModulesAndVersi
|
|||||||
import org.jetbrains.kotlin.idea.maven.PomFile
|
import org.jetbrains.kotlin.idea.maven.PomFile
|
||||||
import org.jetbrains.kotlin.idea.maven.excludeMavenChildrenModules
|
import org.jetbrains.kotlin.idea.maven.excludeMavenChildrenModules
|
||||||
|
|
||||||
abstract class KotlinMavenConfigurator protected constructor(private val stdlibArtifactId: String, private val testArtifactId: String?, private val addJunit: Boolean, private val name: String, private val presentableText: String) : KotlinProjectConfigurator {
|
abstract class KotlinMavenConfigurator
|
||||||
|
protected constructor(private val stdlibArtifactId: String,
|
||||||
|
private val testArtifactId: String?,
|
||||||
|
private val addJunit: Boolean,
|
||||||
|
override val name: String,
|
||||||
|
override val presentableText: String) : KotlinProjectConfigurator {
|
||||||
|
|
||||||
override fun isApplicable(module: Module): Boolean {
|
override fun isApplicable(module: Module): Boolean {
|
||||||
return KotlinPluginUtil.isMavenModule(module)
|
return KotlinPluginUtil.isMavenModule(module)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getPresentableText() = presentableText
|
|
||||||
|
|
||||||
override fun getName(): String {
|
|
||||||
return name
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun isConfigured(module: Module): Boolean {
|
override fun isConfigured(module: Module): Boolean {
|
||||||
if (!isKotlinModule(module)) {
|
if (!isKotlinModule(module)) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -114,6 +114,6 @@ public class KotlinJavaModuleConfigurator extends KotlinWithLibraryConfigurator
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static KotlinJavaModuleConfigurator getInstance() {
|
public static KotlinJavaModuleConfigurator getInstance() {
|
||||||
return Extensions.findExtension(EP_NAME, KotlinJavaModuleConfigurator.class);
|
return Extensions.findExtension(Companion.getEP_NAME(), KotlinJavaModuleConfigurator.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,29 +14,28 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.configuration;
|
package org.jetbrains.kotlin.idea.configuration
|
||||||
|
|
||||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
import com.intellij.openapi.extensions.ExtensionPointName
|
||||||
import com.intellij.openapi.module.Module;
|
import com.intellij.openapi.module.Module
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.kotlin.resolve.TargetPlatform
|
||||||
import org.jetbrains.kotlin.resolve.TargetPlatform;
|
|
||||||
|
|
||||||
import java.util.Collection;
|
interface KotlinProjectConfigurator {
|
||||||
|
|
||||||
public interface KotlinProjectConfigurator {
|
fun isConfigured(module: Module): Boolean
|
||||||
ExtensionPointName<KotlinProjectConfigurator> EP_NAME = ExtensionPointName.create("org.jetbrains.kotlin.projectConfigurator");
|
|
||||||
|
|
||||||
boolean isConfigured(@NotNull Module module);
|
fun isApplicable(module: Module): Boolean
|
||||||
|
|
||||||
boolean isApplicable(@NotNull Module module);
|
@JvmSuppressWildcards fun configure(project: Project, excludeModules: Collection<Module>)
|
||||||
|
|
||||||
void configure(@NotNull Project project, Collection<Module> excludeModules);
|
val presentableText: String
|
||||||
|
|
||||||
@NotNull String getPresentableText();
|
val name: String
|
||||||
|
|
||||||
@NotNull String getName();
|
val targetPlatform: TargetPlatform
|
||||||
|
|
||||||
@NotNull
|
companion object {
|
||||||
TargetPlatform getTargetPlatform();
|
val EP_NAME = ExtensionPointName.create<KotlinProjectConfigurator>("org.jetbrains.kotlin.projectConfigurator")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user