mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fixed adding artifacts to 'before launch tasks' when they are marked for deployment
This commit is contained in:
+21
-10
@@ -203,7 +203,10 @@ public class BuildArtifactsBeforeRunTaskProvider extends BeforeRunTaskProvider<B
|
||||
return result.get();
|
||||
}
|
||||
|
||||
public static void setBuildArtifactBeforeRunOption(@NotNull JComponent runConfigurationEditorComponent, @NotNull Artifact artifact, final boolean enable) {
|
||||
public static void setBuildArtifactBeforeRunOption(@NotNull JComponent runConfigurationEditorComponent,
|
||||
Project project,
|
||||
@NotNull Artifact artifact,
|
||||
final boolean enable) {
|
||||
final DataContext dataContext = DataManager.getInstance().getDataContext(runConfigurationEditorComponent);
|
||||
final ConfigurationSettingsEditorWrapper editor = ConfigurationSettingsEditorWrapper.CONFIGURATION_EDITOR_KEY.getData(dataContext);
|
||||
if (editor != null) {
|
||||
@@ -214,15 +217,23 @@ public class BuildArtifactsBeforeRunTaskProvider extends BeforeRunTaskProvider<B
|
||||
myTasks.add((BuildArtifactsBeforeRunTask)task);
|
||||
}
|
||||
}
|
||||
for (BuildArtifactsBeforeRunTask task : myTasks) {
|
||||
if (enable) {
|
||||
task.addArtifact(artifact);
|
||||
task.setEnabled(true);
|
||||
}
|
||||
else {
|
||||
task.removeArtifact(artifact);
|
||||
if (task.getArtifactPointers().isEmpty()) {
|
||||
task.setEnabled(false);
|
||||
if (enable && myTasks.isEmpty()) {
|
||||
BuildArtifactsBeforeRunTask task = new BuildArtifactsBeforeRunTask(project);
|
||||
task.addArtifact(artifact);
|
||||
task.setEnabled(true);
|
||||
editor.addBeforeLaunchStep(task);
|
||||
}
|
||||
else {
|
||||
for (BuildArtifactsBeforeRunTask task : myTasks) {
|
||||
if (enable) {
|
||||
task.addArtifact(artifact);
|
||||
task.setEnabled(true);
|
||||
}
|
||||
else {
|
||||
task.removeArtifact(artifact);
|
||||
if (task.getArtifactPointers().isEmpty()) {
|
||||
task.setEnabled(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user