Skip to content

Commit

Permalink
Upgrade to Quarkus 2.9.1.Final
Browse files Browse the repository at this point in the history
  • Loading branch information
gsmet committed May 17, 2022
1 parent e2bc361 commit 0c3b441
Show file tree
Hide file tree
Showing 7 changed files with 1,275 additions and 1,234 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
import io.quarkus.deployment.dev.DevModeMain;
import io.quarkus.deployment.dev.QuarkusDevModeLauncher;
import io.quarkus.maven.MavenDevModeLauncher.Builder;
import io.quarkus.maven.components.CompilerOptions;
import io.quarkus.maven.components.MavenVersionEnforcer;
import io.quarkus.maven.dependency.ArtifactKey;
import io.quarkus.maven.dependency.GACT;
Expand Down Expand Up @@ -305,6 +306,12 @@ public class DevMojo extends AbstractMojo {
@Parameter
private List<String> compilerArgs;

/**
* Additional compiler arguments
*/
@Parameter
private List<CompilerOptions> compilerOptions;

/**
* The --release argument to javac.
*/
Expand Down Expand Up @@ -957,11 +964,17 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {

builder.sourceEncoding(getSourceEncoding());

if (compilerOptions != null) {
for (CompilerOptions compilerOption : compilerOptions) {
builder.compilerOptions(compilerOption.getName(), compilerOption.getArgs());
}
}

// Set compilation flags. Try the explicitly given configuration first. Otherwise,
// refer to the configuration of the Maven Compiler Plugin.
final Optional<Xpp3Dom> compilerPluginConfiguration = findCompilerPluginConfiguration();
if (compilerArgs != null) {
builder.compilerOptions(compilerArgs);
builder.compilerOptions("java", compilerArgs);
} else if (compilerPluginConfiguration.isPresent()) {
final Xpp3Dom compilerPluginArgsConfiguration = compilerPluginConfiguration.get().getChild("compilerArgs");
if (compilerPluginArgsConfiguration != null) {
Expand All @@ -974,9 +987,10 @@ private QuarkusDevModeLauncher newLauncher() throws Exception {
&& !compilerPluginArgsConfiguration.getValue().isEmpty()) {
compilerPluginArgs.add(compilerPluginArgsConfiguration.getValue().trim());
}
builder.compilerOptions(compilerPluginArgs);
builder.compilerOptions("java", compilerPluginArgs);
}
}

if (release != null) {
builder.releaseJavaVersion(release);
} else if (compilerPluginConfiguration.isPresent()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package io.quarkus.maven.components;

import java.util.ArrayList;
import java.util.List;

public class CompilerOptions {

private String name = null;
private List<String> args = new ArrayList<>();

public void setName(String name) {
this.name = name;
}

public String getName() {
return name;
}

public void setArgs(List<String> options) {
this.args = options;
}

public List<String> getArgs() {
return args;
}

}
Loading

0 comments on commit 0c3b441

Please sign in to comment.