diff --git a/src/main/frontend/package-lock.json b/src/main/frontend/package-lock.json index ec33396d..4ed83ede 100644 --- a/src/main/frontend/package-lock.json +++ b/src/main/frontend/package-lock.json @@ -3194,18 +3194,18 @@ "integrity": "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==" }, "polka": { - "version": "1.0.0-next.15", - "resolved": "https://registry.npmjs.org/polka/-/polka-1.0.0-next.15.tgz", - "integrity": "sha512-zBCZO40+USkSj0GDHMqufthqk4TIRc9xVGd50LbMvYNEwGHK8dZczLBQtw9pPHBM+i/Xg7ed7+c+r6J68XkWLg==", + "version": "1.0.0-next.22", + "resolved": "https://registry.npmjs.org/polka/-/polka-1.0.0-next.22.tgz", + "integrity": "sha512-a7tsZy5gFbJr0aUltZS97xCkbPglXuD67AMvTyZX7BTDBH384FWf0ZQF6rPvdutSxnO1vUlXM2zSLf5tCKk5RA==", "requires": { - "@polka/url": "^1.0.0-next.15", + "@polka/url": "^1.0.0-next.21", "trouter": "^3.1.0" }, "dependencies": { "@polka/url": { - "version": "1.0.0-next.15", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.15.tgz", - "integrity": "sha512-15spi3V28QdevleWBNXE4pIls3nFZmBbUGrW9IVPwiQczuSb9n76TCB4bsk8TSel+I1OkHEdPhu5QKMfY6rQHA==" + "version": "1.0.0-next.21", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.21.tgz", + "integrity": "sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==" } } }, diff --git a/src/main/java/io/vlingo/xoom/designer/Configuration.java b/src/main/java/io/vlingo/xoom/designer/Configuration.java index 03578136..1ac181a0 100644 --- a/src/main/java/io/vlingo/xoom/designer/Configuration.java +++ b/src/main/java/io/vlingo/xoom/designer/Configuration.java @@ -8,6 +8,7 @@ import io.vlingo.xoom.common.Tuple2; import io.vlingo.xoom.designer.codegen.CodeGenerationParameterValidationStep; import io.vlingo.xoom.designer.codegen.StagingFolderCleanUpStep; +import io.vlingo.xoom.designer.codegen.StagingFolderCleanUpStep.Phase; import io.vlingo.xoom.designer.codegen.TemporaryTaskFolderCreationStep; import io.vlingo.xoom.designer.codegen.java.applicationsettings.ApplicationSettingsGenerationStep; import io.vlingo.xoom.designer.codegen.java.autodispatch.AutoDispatchMappingGenerationStep; @@ -77,7 +78,7 @@ private static List codeGenerationSteps() { //Preliminary new CodeGenerationParameterValidationStep(), new MainClassResolverStep(), - new StagingFolderCleanUpStep(), + new StagingFolderCleanUpStep(Phase.PRE_GENERATION), new TemporaryTaskFolderCreationStep(), //Java new ReadmeFileGenerationStep(), @@ -110,7 +111,7 @@ private static List codeGenerationSteps() { new MavenWrapperInstallationStep(), new SchemaPushStep(withType(CommandExecutionProcess.class)), new SchemaPullStep(withType(CommandExecutionProcess.class)), - new StagingFolderCleanUpStep() + new StagingFolderCleanUpStep(Phase.POST_GENERATION) ); } diff --git a/src/main/java/io/vlingo/xoom/designer/codegen/StagingFolderCleanUpStep.java b/src/main/java/io/vlingo/xoom/designer/codegen/StagingFolderCleanUpStep.java index 823eabbc..a6a65874 100644 --- a/src/main/java/io/vlingo/xoom/designer/codegen/StagingFolderCleanUpStep.java +++ b/src/main/java/io/vlingo/xoom/designer/codegen/StagingFolderCleanUpStep.java @@ -10,6 +10,7 @@ import io.vlingo.xoom.codegen.CodeGenerationStep; import io.vlingo.xoom.designer.ModelProcessingException; import io.vlingo.xoom.designer.infrastructure.StagingFolder; +import io.vlingo.xoom.turbo.ComponentRegistry; import org.apache.commons.io.FileUtils; import java.io.IOException; @@ -20,6 +21,12 @@ public class StagingFolderCleanUpStep implements CodeGenerationStep { + private final Phase phase; + + public StagingFolderCleanUpStep(final Phase phase) { + this.phase = phase; + } + @Override public void process(final CodeGenerationContext context) { try { @@ -39,4 +46,18 @@ private void removeDirectory(final Path directory) { } } + @Override + public boolean shouldProcess(final CodeGenerationContext context) { + final GenerationTarget generationTarget = ComponentRegistry.withType(GenerationTarget.class); + if(generationTarget.supportDownload()) { + return phase.equals(Phase.PRE_GENERATION); + } + return true; + } + + public enum Phase { + PRE_GENERATION, + POST_GENERATION + } + } \ No newline at end of file