mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
(no message)
This commit is contained in:
@@ -6,10 +6,25 @@ package org.jetbrains.idea.devkit.module;
|
||||
|
||||
import com.intellij.ide.util.projectWizard.JavaModuleBuilder;
|
||||
import com.intellij.openapi.module.ModuleType;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.options.ConfigurationException;
|
||||
import org.jetbrains.idea.devkit.sandbox.Sandbox;
|
||||
import org.jetbrains.idea.devkit.sandbox.SandboxManager;
|
||||
import com.intellij.openapi.roots.ModifiableRootModel;
|
||||
import private Sandbox mySandbox;
|
||||
com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.options.Co }
|
||||
|
||||
public class PluginModuleBuilder extends JavaModuleBuilder{
|
||||
|
||||
public ModuleType getModuleType() {
|
||||
return PluginModuleType.getInstance();
|
||||
public void setupRootModel(ModifiableRootModel rootModel) throws ConfigurationException {
|
||||
super.setupRootModel(rootModel);
|
||||
ModuleSandboxManager.getInstance(rootModel.getModule()).setSandbox(getSandbox(), rootModel);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSandbox(Sandbox sandbox) {
|
||||
mySandbox = sandbox;
|
||||
}
|
||||
|
||||
public Sandbox getSandbox() {
|
||||
return mySandbox;
|
||||
nfigurat
|
||||
@@ -64,28 +64,13 @@ public class PluginModuleType extends ModuleType<PluginModuleBuilder> {
|
||||
return new ModuleWizardStep[] {
|
||||
nameAndLocationStep,
|
||||
stepFactory.createSourcePathsStep(nameAndLocationStep, pluginModuleBuilder, ADD_PLUGIN_MODULE_ICON, null),
|
||||
stepFactory.createOutputPathPathsStep(nameAndLocationStep, pluginModuleBuilder, ADD_PLUGIN_MODULE_ICON, null),
|
||||
new PluginModuleTypeStep(wizardContext, pluginModuleBuilder, ADD_PLUGIN_MODULE_ICON, null),
|
||||
stepFactory.createOutputPathPathsStep(nameAndLocationStep, pluginModuleBuilder, ADD_PLUGIN_MODULE_ICON, null)
|
||||
reateOutputPathPathsStep(nameAndLocationStep, pluginModuleBuilder, ADD_PLUGIN_MODULE_ICON, null)
|
||||
reateOutputPathPathsStep(nameAndLocationStep, pluginModuleBuilder, ADD_PLUGIN_MODULE_ICON, null)
|
||||
reateOutputPathPathsStep(nameAndLocationStep, pluginModuleBuilder, ADD_PLUGIN_MODULE_ICON, null)
|
||||
reateOutputPathPathsStep(nameAndLocationStep, pluginModuleBuilder, ADD_PLUGIN_MODULE_ICON, null)
|
||||
};
|
||||
}
|
||||
|
||||
public PluginModuleBuilder createModuleBuilder() {
|
||||
return new PluginModuleBuilder();
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return "Plugin Module";
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
//TODO: better description
|
||||
return "Useful for IDEA plugin development";
|
||||
}
|
||||
|
||||
public Icon getBigIcon() {
|
||||
return PLUGIN_MODULE_ICON;
|
||||
}
|
||||
|
||||
public Icon getNodeIcon(boolean isOpened) {
|
||||
return PLUGIN_MODULE_NODE_ICON;
|
||||
}
|
||||
}
|
||||
public PluginModuleBuilder crea
|
||||
@@ -100,6 +100,15 @@ public class PluginRunConfiguration extends RunConfigurationBase {
|
||||
ConfigurationPerRunnerSettings configurationSettings) throws ExecutionException {
|
||||
final JavaCommandLineState state = new JavaCommandLineState(runnerSettings, configurationSettings) {
|
||||
protected JavaParameters createJavaParameters() throws ExecutionException {
|
||||
if (getSandbox() == null){
|
||||
throw new CantRunException("No sandbox specified");
|
||||
}
|
||||
|
||||
Module[] modules = getModules();
|
||||
if (modules.length == 0) {
|
||||
throw new CantRunException("No plugin modules selected");
|
||||
}
|
||||
|
||||
final JavaParameters params = new JavaParameters();
|
||||
|
||||
ParametersList vm = params.getVMParametersList();
|
||||
@@ -118,10 +127,7 @@ public class PluginRunConfiguration extends RunConfigurationBase {
|
||||
|
||||
params.setWorkingDirectory(getBasePath() + "/bin/");
|
||||
|
||||
Module[] modules = getModules();
|
||||
if (modules.length == 0) {
|
||||
throw new CantRunException("No plugin modules selected");
|
||||
}
|
||||
|
||||
|
||||
//TODO: Should run against same JRE IDEA runs against, right?
|
||||
final ModuleRootManager rootManager = ModuleRootManager.getInstance(modules[0]);
|
||||
@@ -147,6 +153,9 @@ public class PluginRunConfiguration extends RunConfigurationBase {
|
||||
}
|
||||
|
||||
public void checkConfiguration() throws RuntimeConfigurationException {
|
||||
if (getSandbox() == null){
|
||||
throw new RuntimeConfigurationException("No sandbox specified");
|
||||
}
|
||||
/*
|
||||
final Module module = getModule();
|
||||
if (module != null) {
|
||||
|
||||
Reference in New Issue
Block a user