mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
artifact fixes
This commit is contained in:
+16
-2
@@ -41,6 +41,7 @@ public class ArtifactManagerImpl extends ArtifactManager implements ProjectCompo
|
||||
private final Project myProject;
|
||||
private final DefaultPackagingElementResolvingContext myResolvingContext;
|
||||
private boolean myInsideCommit = false;
|
||||
private boolean myLoaded;
|
||||
private long myModificationCount;
|
||||
private final ModificationTracker myModificationTracker = new ModificationTracker() {
|
||||
public long getModificationCount() {
|
||||
@@ -164,7 +165,16 @@ public class ArtifactManagerImpl extends ArtifactManager implements ProjectCompo
|
||||
}
|
||||
artifacts.add(artifact);
|
||||
}
|
||||
myModel.setArtifactsList(artifacts);
|
||||
|
||||
if (myLoaded) {
|
||||
final ArtifactModelImpl model = new ArtifactModelImpl(this);
|
||||
model.addArtifacts(artifacts);
|
||||
doCommit(model);
|
||||
}
|
||||
else {
|
||||
myModel.setArtifactsList(artifacts);
|
||||
myLoaded = true;
|
||||
}
|
||||
}
|
||||
|
||||
private static <S> void deserializeProperties(ArtifactProperties<S> artifactProperties, ArtifactPropertiesState propertiesState) {
|
||||
@@ -249,8 +259,12 @@ public class ArtifactManagerImpl extends ArtifactManager implements ProjectCompo
|
||||
|
||||
public void commit(ArtifactModelImpl artifactModel) {
|
||||
ApplicationManager.getApplication().assertWriteAccessAllowed();
|
||||
LOG.assertTrue(!myInsideCommit, "Recursive commit");
|
||||
|
||||
doCommit(artifactModel);
|
||||
}
|
||||
|
||||
private void doCommit(ArtifactModelImpl artifactModel) {
|
||||
LOG.assertTrue(!myInsideCommit, "Recursive commit");
|
||||
myInsideCommit = true;
|
||||
try {
|
||||
|
||||
|
||||
@@ -20,12 +20,6 @@ public class ArtifactPointerImpl implements ArtifactPointer {
|
||||
myName = name;
|
||||
}
|
||||
|
||||
public ArtifactPointerImpl(@NotNull Project project, @NotNull Artifact artifact) {
|
||||
myProject = project;
|
||||
myArtifact = artifact;
|
||||
myName = artifact.getName();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String getName() {
|
||||
return myName;
|
||||
|
||||
+9
-1
@@ -4,8 +4,8 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.packaging.artifacts.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author nik
|
||||
@@ -25,6 +25,14 @@ public class ArtifactPointerManagerImpl extends ArtifactPointerManager {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void artifactAdded(@NotNull Artifact artifact) {
|
||||
final ArtifactPointerImpl artifactPointer = myPointers.get(artifact.getName());
|
||||
if (artifactPointer != null) {
|
||||
artifactPointer.setArtifact(artifact);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void artifactChanged(@NotNull Artifact artifact, @NotNull String oldName) {
|
||||
final ArtifactPointerImpl pointer = myPointers.get(oldName);
|
||||
|
||||
Reference in New Issue
Block a user