Skip to content

Commit

Permalink
Test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dnestoro committed Mar 7, 2023
1 parent 83f2ea3 commit c1e7dae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ public class MetadataCopyMojo extends AbstractMergeAgentFilesMojo {

@Override
public void execute() throws MojoExecutionException {
if (agentConfiguration != null && (agentConfiguration.isEnabled() || agentIsEnabledFromCmd())) {
System.out.println("===============================================================================");
System.out.println(session.getSystemProperties().getProperty("agent"));
System.out.println(agentConfiguration.isEnabled());
System.out.println("===============================================================================");
if (agentConfiguration != null && agentConfiguration.isEnabled()) {
// in direct mode user is fully responsible for agent configuration, and we will not execute anything besides line that user provided
if (agentConfiguration.getDefaultMode().equalsIgnoreCase("direct")) {
logger.info("You are running agent in direct mode. Skipping both merge and metadata copy tasks.");
Expand Down Expand Up @@ -219,16 +223,4 @@ private List<String> getListDiff(List<String> list1, List<String> list2) {
return diff;
}

private boolean agentIsEnabledFromCmd() {
if (session == null) {
return false;
}

if (session.getSystemProperties().getProperty("agent") == null) {
return false;
}

return session.getSystemProperties().getProperty("agent").equalsIgnoreCase("true");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

public class AgentConfiguration extends org.graalvm.buildtools.agent.AgentConfiguration {

@Parameter
@Parameter(property = "agent")
private boolean enabled;

@Parameter(defaultValue = "standard")
Expand Down

0 comments on commit c1e7dae

Please sign in to comment.