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)
|
||||
}
|
||||
|
||||
override fun getTargetPlatform(): TargetPlatform {
|
||||
return JvmPlatform
|
||||
}
|
||||
override val targetPlatform: TargetPlatform
|
||||
get() = JvmPlatform
|
||||
|
||||
companion object {
|
||||
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)
|
||||
}
|
||||
|
||||
override fun getTargetPlatform(): TargetPlatform {
|
||||
return JsPlatform
|
||||
}
|
||||
override val targetPlatform: TargetPlatform
|
||||
get() = JsPlatform
|
||||
|
||||
companion object {
|
||||
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.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 {
|
||||
return KotlinPluginUtil.isMavenModule(module)
|
||||
}
|
||||
|
||||
override fun getPresentableText() = presentableText
|
||||
|
||||
override fun getName(): String {
|
||||
return name
|
||||
}
|
||||
|
||||
override fun isConfigured(module: Module): Boolean {
|
||||
if (!isKotlinModule(module)) {
|
||||
return false
|
||||
|
||||
@@ -114,6 +114,6 @@ public class KotlinJavaModuleConfigurator extends KotlinWithLibraryConfigurator
|
||||
}
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.idea.configuration;
|
||||
package org.jetbrains.kotlin.idea.configuration
|
||||
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.kotlin.resolve.TargetPlatform;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName
|
||||
import com.intellij.openapi.module.Module
|
||||
import com.intellij.openapi.project.Project
|
||||
import org.jetbrains.kotlin.resolve.TargetPlatform
|
||||
|
||||
import java.util.Collection;
|
||||
interface KotlinProjectConfigurator {
|
||||
|
||||
public interface KotlinProjectConfigurator {
|
||||
ExtensionPointName<KotlinProjectConfigurator> EP_NAME = ExtensionPointName.create("org.jetbrains.kotlin.projectConfigurator");
|
||||
fun isConfigured(module: Module): Boolean
|
||||
|
||||
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
|
||||
TargetPlatform getTargetPlatform();
|
||||
companion object {
|
||||
val EP_NAME = ExtensionPointName.create<KotlinProjectConfigurator>("org.jetbrains.kotlin.projectConfigurator")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user