Skip to content

Commit

Permalink
JNG-5932 add gitignore synchronized workflow (#185)
Browse files Browse the repository at this point in the history
[2024-09-23 10:24:01 +0200] Fixing version
[2024-09-23 10:18:27 +0200] JNG-5932 Fixing workflow regression
  • Loading branch information
robertcsakany authored Sep 23, 2024
1 parent 32d870c commit 1113d92
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,11 +303,11 @@ public static void cleanGeneratedFromChecksumInDirectory(PsmGeneratorParameter p
ModelGenerator.cleanGeneratedFromChecksumInDirectory(genericParams, applications);
}

public static void synchronizeGitignoreInDirectory(PsmGeneratorParameter.PsmGeneratorParameterBuilder builder) throws Exception {
synchronizeGitignoreInDirectory(builder.build());
public static void synchronizeGitignoreInDirectory(PsmGeneratorParameter.PsmGeneratorParameterBuilder builder, Collection<String> ignoredFiles) throws Exception {
synchronizeGitignoreInDirectory(builder.build(), ignoredFiles);
}

public static void synchronizeGitignoreInDirectory(PsmGeneratorParameter parameter) throws Exception {
public static void synchronizeGitignoreInDirectory(PsmGeneratorParameter parameter, Collection<String> ignoredFiles) throws Exception {

GeneratorParameter<ActorType> genericParams = mapPsmParameters(parameter);

Expand All @@ -320,7 +320,7 @@ public static void synchronizeGitignoreInDirectory(PsmGeneratorParameter paramet
.filter(genericParams.getDiscriminatorPredicate())
.collect(Collectors.toSet());

ModelGenerator.synchronizeGitignoreInDirectory(genericParams, applications);
ModelGenerator.synchronizeGitignoreInDirectory(genericParams, applications, (f) -> ignoredFiles.contains(f));
}

public static void recalculateChecksumForDirectory(PsmGeneratorParameter.PsmGeneratorParameterBuilder builder) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,23 @@
import hu.blackbelt.judo.meta.psm.generator.engine.PsmGeneratorParameter;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.plugins.annotations.ResolutionScope;

import java.util.List;

@Mojo(name = "synchronizeGitignore",
defaultPhase = LifecyclePhase.PROCESS_RESOURCES,
requiresDependencyResolution = ResolutionScope.COMPILE,
threadSafe = true)
public class PsmProjectSynchronizeGitignoreMojo extends AbstractPsmProjectMojo {


@Parameter(name = "ignoredFiles", property = "ignoredFiles", defaultValue = "")
protected List<String> ignoredFiles;

@Override
public void performExecutionOnPsmParameters(PsmGeneratorParameter.PsmGeneratorParameterBuilder parameter) throws Exception {
PsmGenerator.synchronizeGitignoreInDirectory(parameter);
PsmGenerator.synchronizeGitignoreInDirectory(parameter, ignoredFiles);
}

}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<emf-genmodel-generator-version>1.1.1.20240410_065331_3400dfa6_develop</emf-genmodel-generator-version>
<judo-genmodel-generator-version>1.1.2.20240410_075618_a6090f79_develop</judo-genmodel-generator-version>
<judo-epp-common-version>4.29.0.20240410_065423_a90724bb_develop</judo-epp-common-version>
<judo-generator-commons-version>1.0.0.20240906_141521_f70c98b5_develop</judo-generator-commons-version>
<judo-generator-commons-version>1.0.0.20240923_081604_d50366e2_feature_JNG_5932_AddGitignoreSynchronizedWorkflow</judo-generator-commons-version>

<xtext-version>2.29.0</xtext-version>
<emf-mwe2-launch-version>2.13.0</emf-mwe2-launch-version>
Expand Down

0 comments on commit 1113d92

Please sign in to comment.