mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
option to run ant target before building artifact
This commit is contained in:
+15
-4
@@ -44,6 +44,7 @@ import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.newvfs.RefreshQueue;
|
||||
import com.intellij.packaging.artifacts.Artifact;
|
||||
import com.intellij.packaging.artifacts.ArtifactManager;
|
||||
import com.intellij.packaging.artifacts.ArtifactProperties;
|
||||
import com.intellij.packaging.artifacts.ArtifactPropertiesProvider;
|
||||
import com.intellij.packaging.elements.CompositePackagingElement;
|
||||
import com.intellij.packaging.elements.PackagingElementResolvingContext;
|
||||
@@ -211,6 +212,11 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler {
|
||||
}
|
||||
|
||||
try {
|
||||
onBuildStartedOrFinished(builderContext, false);
|
||||
if (context.getMessageCount(CompilerMessageCategory.ERROR) > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (final ProcessingItem item0 : items) {
|
||||
if (item0 instanceof MockProcessingItem) continue;
|
||||
@@ -276,7 +282,7 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler {
|
||||
}
|
||||
}
|
||||
|
||||
onBuildFinished(builderContext);
|
||||
onBuildStartedOrFinished(builderContext, true);
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
throw e;
|
||||
@@ -354,13 +360,18 @@ public class IncrementalArtifactsCompiler implements PackagingCompiler {
|
||||
return outputPath;
|
||||
}
|
||||
|
||||
protected static void onBuildFinished(ArtifactsProcessingItemsBuilderContext context)
|
||||
throws Exception {
|
||||
private static void onBuildStartedOrFinished(ArtifactsProcessingItemsBuilderContext context, final boolean finished) throws Exception {
|
||||
final CompileContext compileContext = context.getCompileContext();
|
||||
final Set<Artifact> artifacts = getAffectedArtifacts(compileContext);
|
||||
for (Artifact artifact : artifacts) {
|
||||
for (ArtifactPropertiesProvider provider : artifact.getPropertiesProviders()) {
|
||||
artifact.getProperties(provider).onBuildFinished(artifact, compileContext);
|
||||
final ArtifactProperties<?> properties = artifact.getProperties(provider);
|
||||
if (finished) {
|
||||
properties.onBuildFinished(artifact, compileContext);
|
||||
}
|
||||
else {
|
||||
properties.onBuildStarted(artifact, compileContext);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
*/
|
||||
public abstract class ArtifactProperties<S> implements PersistentStateComponent<S> {
|
||||
|
||||
public void onBuildStarted(@NotNull Artifact artifact, @NotNull CompileContext compileContext) {
|
||||
}
|
||||
|
||||
public void onBuildFinished(@NotNull Artifact artifact, @NotNull CompileContext compileContext) {
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ import com.intellij.openapi.options.UnnamedConfigurable;
|
||||
*/
|
||||
public abstract class ArtifactPropertiesEditor implements UnnamedConfigurable {
|
||||
protected static final String VALIDATION_TAB = "Validation";
|
||||
protected static final String POSTPROCESSING_TAB = "Post-processing";
|
||||
protected static final String POST_PROCESSING_TAB = "Post-processing";
|
||||
protected static final String PRE_PROCESSING_TAB = "Pre-processing";
|
||||
|
||||
public abstract String getTabName();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user