Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix for when config agent.metadataCopy.disabledStages have 2 custom stage elements other than main and test, it would never run correctly. #630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ public class MergeAgentFilesMojo extends AbstractMergeAgentFilesMojo {

private static int numberOfExecutions = 0;

private static final List<String> DEFAULT_DIRS = Arrays.asList("main", "test");

@Override
public void execute() throws MojoExecutionException {
// we need this mojo to be executed only once
Expand All @@ -96,15 +98,14 @@ public void execute() throws MojoExecutionException {
}

List<String> disabledPhases = agentConfiguration.getMetadataCopyConfiguration().getDisabledStages();
if (disabledPhases.size() == 2) {

Set<String> dirs = new HashSet<>(DEFAULT_DIRS);
dirs.removeAll(disabledPhases);
if (dirs.isEmpty()) {
logger.info("Both phases are skipped.");
return;
}

Set<String> dirs = new HashSet(2);
dirs.addAll(Arrays.asList("main", "test"));
dirs.removeAll(disabledPhases);

for (String dir : dirs) {
String agentOutputDirectory = (target + "/native/agent-output/" + dir).replace('/', File.separatorChar);
mergeForGivenDir(agentOutputDirectory);
Expand Down