From 5b77b11ed889e7e6a0a38ca8b5d02752a02652ea Mon Sep 17 00:00:00 2001 From: nik Date: Fri, 23 Oct 2009 09:07:02 +0400 Subject: [PATCH] separate target for building all except artifacts added to generated Ant xml --- .../intellij/compiler/ant/ProjectBuild.java | 26 ++++++++++--------- .../compiler/ant/BuildProperties.java | 1 + .../src/messages/CompilerBundle.properties | 1 + 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/ant/ProjectBuild.java b/java/compiler/impl/src/com/intellij/compiler/ant/ProjectBuild.java index 4b8bea36a2b6..eaf0c454a91e 100644 --- a/java/compiler/impl/src/com/intellij/compiler/ant/ProjectBuild.java +++ b/java/compiler/impl/src/com/intellij/compiler/ant/ProjectBuild.java @@ -42,10 +42,10 @@ public abstract class ProjectBuild extends Generator { // the sequence in which modules are imported is important cause output path properties for dependent modules should be defined first - final StringBuilder alltargetNames = new StringBuilder(); - alltargetNames.append(BuildProperties.TARGET_INIT); - alltargetNames.append(", "); - alltargetNames.append(BuildProperties.TARGET_CLEAN); + final StringBuilder buildModulesTargetNames = new StringBuilder(); + buildModulesTargetNames.append(BuildProperties.TARGET_INIT); + buildModulesTargetNames.append(", "); + buildModulesTargetNames.append(BuildProperties.TARGET_CLEAN); final ModuleChunk[] chunks = genOptions.getModuleChunks(); if (chunks.length > 0) { @@ -55,10 +55,10 @@ public abstract class ProjectBuild extends Generator { myAntProject.add(createModuleBuildGenerator(chunk, genOptions), 1); final String[] targets = ChunkBuildExtension.getAllTargets(chunk); for (String target : targets) { - if (alltargetNames.length() > 0) { - alltargetNames.append(", "); + if (buildModulesTargetNames.length() > 0) { + buildModulesTargetNames.append(", "); } - alltargetNames.append(target); + buildModulesTargetNames.append(target); } } } @@ -78,19 +78,21 @@ public abstract class ProjectBuild extends Generator { myAntProject.add(new CleanProject(genOptions, artifactsGenerator), 1); + myAntProject.add(new Target(BuildProperties.TARGET_BUILD_MODULES, buildModulesTargetNames.toString(), + CompilerBundle.message("generated.ant.build.build.all.modules.target.name"), null), 1); + + StringBuilder buildAllTargetNames = new StringBuilder(); + buildAllTargetNames.append(BuildProperties.TARGET_BUILD_MODULES); if (artifactsGenerator != null) { List generators = artifactsGenerator.generate(); for (Generator generator : generators) { myAntProject.add(generator, 1); } - if (alltargetNames.length() > 0) { - alltargetNames.append(", "); - } - alltargetNames.append(ArtifactsGenerator.BUILD_ALL_ARTIFACTS_TARGET); + buildAllTargetNames.append(", ").append(ArtifactsGenerator.BUILD_ALL_ARTIFACTS_TARGET); } - myAntProject.add(new Target(BuildProperties.TARGET_ALL, alltargetNames.toString(), + myAntProject.add(new Target(BuildProperties.TARGET_ALL, buildAllTargetNames.toString(), CompilerBundle.message("generated.ant.build.build.all.target.name"), null), 1); } diff --git a/java/compiler/openapi/src/com/intellij/compiler/ant/BuildProperties.java b/java/compiler/openapi/src/com/intellij/compiler/ant/BuildProperties.java index 5b2fb7bb1d0d..a308f75c9347 100644 --- a/java/compiler/openapi/src/com/intellij/compiler/ant/BuildProperties.java +++ b/java/compiler/openapi/src/com/intellij/compiler/ant/BuildProperties.java @@ -36,6 +36,7 @@ import java.util.Set; public abstract class BuildProperties extends CompositeGenerator { public static final @NonNls String TARGET_ALL = "all"; + public static final @NonNls String TARGET_BUILD_MODULES = "build.modules"; public static final @NonNls String TARGET_CLEAN = "clean"; public static final @NonNls String TARGET_INIT = "init"; public static final @NonNls String DEFAULT_TARGET = TARGET_ALL; diff --git a/resources-en/src/messages/CompilerBundle.properties b/resources-en/src/messages/CompilerBundle.properties index 49386b9805cc..500cde9b63dc 100644 --- a/resources-en/src/messages/CompilerBundle.properties +++ b/resources-en/src/messages/CompilerBundle.properties @@ -46,6 +46,7 @@ generated.ant.build.compile.modules.tests.target.comment=compile {0,choice, 1#mo generated.ant.build.modules.section.title=Modules generated.ant.build.initialization.section.title=Build initialization generated.ant.build.initialization.section.comment=Perform any build initialization in this target +generated.ant.build.build.all.modules.target.name=build all modules generated.ant.build.build.all.target.name=build all generated.ant.build.building.concrete.module.section.title=Module {0} compiler.error.exception=Error: {0}