diff --git a/java/compiler/impl/src/com/intellij/compiler/ant/artifacts/ArtifactAntGenerationContextImpl.java b/java/compiler/impl/src/com/intellij/compiler/ant/artifacts/ArtifactAntGenerationContextImpl.java index d567c2b43fe3..42d09995d41c 100644 --- a/java/compiler/impl/src/com/intellij/compiler/ant/artifacts/ArtifactAntGenerationContextImpl.java +++ b/java/compiler/impl/src/com/intellij/compiler/ant/artifacts/ArtifactAntGenerationContextImpl.java @@ -12,6 +12,7 @@ import com.intellij.openapi.vfs.VfsUtil; import com.intellij.packaging.artifacts.Artifact; import com.intellij.packaging.artifacts.ArtifactManager; import com.intellij.packaging.elements.ArtifactAntGenerationContext; +import com.intellij.packaging.elements.ArtifactRootElement; import gnu.trove.THashMap; import gnu.trove.THashSet; import org.jetbrains.annotations.NonNls; @@ -40,7 +41,7 @@ public class ArtifactAntGenerationContextImpl implements ArtifactAntGenerationCo myGenerationOptions = generationOptions; for (Artifact artifact : ArtifactManager.getInstance(project).getArtifacts()) { final String outputPath = artifact.getOutputPath(); - if (!StringUtil.isEmpty(outputPath) && artifact.isClearOutputDirectoryOnRebuild()) { + if (!StringUtil.isEmpty(outputPath) && artifact.getRootElement() instanceof ArtifactRootElement) { myArtifactsToClean.add(artifact); } } diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactImpl.java b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactImpl.java index 43c3325a4ac4..123966a4e532 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactImpl.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactImpl.java @@ -27,14 +27,12 @@ public class ArtifactImpl extends UserDataHolderBase implements ModifiableArtifa private Map> myProperties; public ArtifactImpl(@NotNull String name, @NotNull ArtifactType artifactType, boolean buildOnMake, @NotNull CompositePackagingElement rootElement, - String outputPath, - boolean clearOutputDirectoryOnRebuild) { + String outputPath) { myName = name; myArtifactType = artifactType; myBuildOnMake = buildOnMake; myRootElement = rootElement; myOutputPath = outputPath; - myClearOutputDirectoryOnRebuild = clearOutputDirectoryOnRebuild; myProperties = new HashMap>(); for (ArtifactPropertiesProvider provider : ArtifactPropertiesProvider.getProviders()) { if (provider.isAvailableFor(artifactType)) { @@ -61,14 +59,6 @@ public class ArtifactImpl extends UserDataHolderBase implements ModifiableArtifa return myRootElement; } - public void setClearOutputDirectoryOnRebuild(boolean clearOutputDirectoryOnRebuild) { - myClearOutputDirectoryOnRebuild = clearOutputDirectoryOnRebuild; - } - - public boolean isClearOutputDirectoryOnRebuild() { - return myClearOutputDirectoryOnRebuild; - } - public String getOutputPath() { return myOutputPath; } @@ -78,8 +68,7 @@ public class ArtifactImpl extends UserDataHolderBase implements ModifiableArtifa } public ArtifactImpl createCopy() { - final ArtifactImpl artifact = new ArtifactImpl(myName, myArtifactType, myBuildOnMake, myRootElement, myOutputPath, - myClearOutputDirectoryOnRebuild); + final ArtifactImpl artifact = new ArtifactImpl(myName, myArtifactType, myBuildOnMake, myRootElement, myOutputPath); for (Map.Entry> entry : myProperties.entrySet()) { final ArtifactProperties newProperties = artifact.myProperties.get(entry.getKey()); //noinspection unchecked @@ -126,7 +115,6 @@ public class ArtifactImpl extends UserDataHolderBase implements ModifiableArtifa myOutputPath = modified.getOutputPath(); myBuildOnMake = modified.isBuildOnMake(); myRootElement = modified.getRootElement(); - myClearOutputDirectoryOnRebuild = modified.isClearOutputDirectoryOnRebuild(); myProperties = modified.myProperties; myArtifactType = modified.getArtifactType(); } diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactManagerImpl.java b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactManagerImpl.java index 381d2b6fb1d5..4693a530954f 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactManagerImpl.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactManagerImpl.java @@ -81,7 +81,6 @@ public class ArtifactManagerImpl extends ArtifactManager implements ProjectCompo artifactState.setOutputPath(artifact.getOutputPath()); artifactState.setRootElement(serializePackagingElement(artifact.getRootElement())); artifactState.setArtifactType(artifact.getArtifactType().getId()); - artifactState.setClearOutputOnRebuild(artifact.isClearOutputDirectoryOnRebuild()); for (ArtifactPropertiesProvider provider : artifact.getPropertiesProviders()) { final ArtifactPropertiesState propertiesState = serializeProperties(provider, artifact.getProperties(provider)); if (propertiesState != null) { @@ -155,8 +154,7 @@ public class ArtifactManagerImpl extends ArtifactManager implements ProjectCompo rootElement = type.createRootElement(artifactName); } - final ArtifactImpl artifact = new ArtifactImpl(artifactName, type, state.isBuildOnMake(), rootElement, state.getOutputPath(), - state.isClearOutputOnRebuild()); + final ArtifactImpl artifact = new ArtifactImpl(artifactName, type, state.isBuildOnMake(), rootElement, state.getOutputPath()); final List propertiesList = state.getPropertiesList(); for (ArtifactPropertiesState propertiesState : propertiesList) { final ArtifactPropertiesProvider provider = ArtifactPropertiesProvider.findById(propertiesState.getId()); diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactModelImpl.java b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactModelImpl.java index adea3f771cad..53e7a6e262f3 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactModelImpl.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactModelImpl.java @@ -53,7 +53,7 @@ public class ArtifactModelImpl extends ArtifactModelBase implements ModifiableAr final String artifactName = generateUniqueName(name); final CompositePackagingElement rootElement = artifactType.createRootElement(artifactName); - final ArtifactImpl artifact = new ArtifactImpl(artifactName, artifactType, false, rootElement, outputPath, true); + final ArtifactImpl artifact = new ArtifactImpl(artifactName, artifactType, false, rootElement, outputPath); myOriginalArtifacts.add(artifact); myArtifact2ModifiableCopy.put(artifact, artifact); myModifiable2Original.put(artifact, artifact); diff --git a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactState.java b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactState.java index 7f777017185b..65a346317da6 100644 --- a/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactState.java +++ b/java/compiler/impl/src/com/intellij/packaging/impl/artifacts/ArtifactState.java @@ -20,7 +20,6 @@ public class ArtifactState { private String myOutputPath; private String myArtifactType = PlainArtifactType.ID; private boolean myBuildOnMake; - private boolean myClearOutputOnRebuild; private Element myRootElement; private List myPropertiesList = new ArrayList(); @@ -49,11 +48,6 @@ public class ArtifactState { return myRootElement; } - @Attribute("clear-output-on-rebuild") - public boolean isClearOutputOnRebuild() { - return myClearOutputOnRebuild; - } - @Property(surroundWithTag = false) @AbstractCollection(surroundWithTag = false) public List getPropertiesList() { @@ -72,10 +66,6 @@ public class ArtifactState { myName = name; } - public void setClearOutputOnRebuild(boolean clearOutputOnRebuild) { - myClearOutputOnRebuild = clearOutputOnRebuild; - } - public void setOutputPath(String outputPath) { myOutputPath = outputPath; } diff --git a/java/compiler/openapi/src/com/intellij/packaging/artifacts/Artifact.java b/java/compiler/openapi/src/com/intellij/packaging/artifacts/Artifact.java index 72207264d0b0..a782b5918a50 100644 --- a/java/compiler/openapi/src/com/intellij/packaging/artifacts/Artifact.java +++ b/java/compiler/openapi/src/com/intellij/packaging/artifacts/Artifact.java @@ -28,5 +28,4 @@ public interface Artifact extends UserDataHolder { ArtifactProperties getProperties(@NotNull ArtifactPropertiesProvider propertiesProvider); - boolean isClearOutputDirectoryOnRebuild(); } diff --git a/java/compiler/openapi/src/com/intellij/packaging/artifacts/ModifiableArtifact.java b/java/compiler/openapi/src/com/intellij/packaging/artifacts/ModifiableArtifact.java index 9c84c265376a..e6a784357078 100644 --- a/java/compiler/openapi/src/com/intellij/packaging/artifacts/ModifiableArtifact.java +++ b/java/compiler/openapi/src/com/intellij/packaging/artifacts/ModifiableArtifact.java @@ -19,6 +19,4 @@ public interface ModifiableArtifact extends Artifact { void setProperties(ArtifactPropertiesProvider provider, ArtifactProperties properties); void setArtifactType(@NotNull ArtifactType selected); - - void setClearOutputDirectoryOnRebuild(boolean clearOutputDirectoryOnRebuild); } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java index 01256db46832..4d73d18ba00d 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactEditorImpl.java @@ -51,7 +51,6 @@ public class ArtifactEditorImpl implements ArtifactEditorEx { private TextFieldWithBrowseButton myOutputDirectoryField; private JCheckBox myShowIncludedCheckBox; private JPanel myEditorPanel; - private JCheckBox myClearOnRebuildCheckBox; private JPanel myErrorPanelPlace; private Splitter mySplitter; private final Project myProject; @@ -75,7 +74,6 @@ public class ArtifactEditorImpl implements ArtifactEditorEx { Disposer.register(this, mySourceItemsTree); Disposer.register(this, myLayoutTreeComponent); myBuildOnMakeCheckBox.setSelected(artifact.isBuildOnMake()); - myClearOnRebuildCheckBox.setSelected(artifact.isClearOutputDirectoryOnRebuild()); final String outputPath = artifact.getOutputPath(); myOutputDirectoryField.addBrowseFolderListener(CompilerBundle.message("dialog.title.output.directory.for.artifact"), CompilerBundle.message("chooser.description.select.output.directory.for.0.artifact", @@ -93,7 +91,6 @@ public class ArtifactEditorImpl implements ArtifactEditorEx { public void apply() { final ModifiableArtifact modifiableArtifact = myContext.getModifiableArtifactModel().getOrCreateModifiableArtifact(myOriginalArtifact); modifiableArtifact.setBuildOnMake(myBuildOnMakeCheckBox.isSelected()); - modifiableArtifact.setClearOutputDirectoryOnRebuild(myClearOnRebuildCheckBox.isSelected()); modifiableArtifact.setOutputPath(getConfiguredOutputPath()); myPropertiesEditors.applyProperties(); myLayoutTreeComponent.saveElementProperties(); @@ -261,7 +258,6 @@ public class ArtifactEditorImpl implements ArtifactEditorEx { public boolean isModified() { return myBuildOnMakeCheckBox.isSelected() != myOriginalArtifact.isBuildOnMake() || !Comparing.equal(getConfiguredOutputPath(), myOriginalArtifact.getOutputPath()) - || myClearOnRebuildCheckBox.isSelected() != myOriginalArtifact.isClearOutputDirectoryOnRebuild() || myPropertiesEditors.isModified() || myLayoutTreeComponent.isPropertiesModified(); } diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsEditorImpl.form b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsEditorImpl.form index 6fe6240bc089..b1c4f58611b9 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsEditorImpl.form +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/ArtifactsEditorImpl.form @@ -30,7 +30,7 @@ - + @@ -46,17 +46,9 @@ - - - - - - - - - + diff --git a/resources-en/src/messages/CompilerBundle.properties b/resources-en/src/messages/CompilerBundle.properties index 3eec988503ab..24a0d23d5743 100644 --- a/resources-en/src/messages/CompilerBundle.properties +++ b/resources-en/src/messages/CompilerBundle.properties @@ -158,7 +158,7 @@ node.text.0.with.dependencies=''{0}'' with dependencies element.type.name.module.output=Module Output element.type.name.directory=Directory element.type.name.archive=Archive -artifact.type.plain=Plain +artifact.type.plain=Other incremental.packaging.compiler.description=Incremental packaging compiler packaging.method.name.do.not.package=Do not package