Skip to content

Commit

Permalink
added generic compiler args setting (#42)
Browse files Browse the repository at this point in the history
* added generic compiler args setting

* formatting fix
  • Loading branch information
mojo2012 authored May 30, 2021
1 parent 2899c72 commit ebcda4b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/java/org/codehaus/mojo/aspectj/AbstractAjcCompiler.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.codehaus.mojo.aspectj;


import org.apache.commons.collections.CollectionUtils;

/**
* The MIT License
*
Expand Down Expand Up @@ -406,6 +409,14 @@ public abstract class AbstractAjcCompiler extends AbstractAjcMojo {
@Parameter( defaultValue = "false" )
protected boolean forceAjcCompile;

/**
* Sets the arguments to be passed to the compiler if {@link #fork} is set to true.<br />
* Example: &lt;compilerArgs&gt; &lt;arg&gt;-Xmaxerrs=1000&lt;/arg&gt; &lt;arg&gt;-Xlint&lt;/arg&gt; &lt;arg&gt;-J-Duser.language=en_us&lt;/arg&gt;
* &lt;/compilerArgs&gt;
*/
@Parameter
protected List<String> compilerArgs = new ArrayList<>();

/**
* Holder for ajc compiler options
*/
Expand Down Expand Up @@ -632,6 +643,10 @@ protected void assembleArguments()
resolvedIncludes = getIncludedSources();
}
ajcOptions.addAll(resolvedIncludes);

if (CollectionUtils.isNotEmpty(compilerArgs)) {
ajcOptions.addAll(compilerArgs);
}
}

protected Set<String> getIncludedSources()
Expand Down

0 comments on commit ebcda4b

Please sign in to comment.