Skip to content

Commit

Permalink
Forward release setting to AbstractImageBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
mickaelistria committed Jan 23, 2025
1 parent 9632412 commit 3d90147
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ public class CompilerOptions {
public long complianceLevel;
/** Java source level, refers to a JDK version, e.g. {@link ClassFileConstants#JDK1_4} */
public long sourceLevel;
/**
* Use <code>-release</code> setting instead of <code>-source</code> to pass compilance version
* and checking also availability of system APIs for the compliance version.
*/
public boolean release;
/**
* Initially requested source version, not necessarily consistent with {@link #sourceLevel} as
* sourceLevel forcibly contain a version that is compatible with ECJ.
Expand Down Expand Up @@ -1410,7 +1415,7 @@ public Map<String, String> getMap() {
optionsMap.put(OPTION_ReportUnusedLabel, getSeverityString(UnusedLabel));
optionsMap.put(OPTION_ReportUnusedTypeArgumentsForMethodInvocation, getSeverityString(UnusedTypeArguments));
optionsMap.put(OPTION_Compliance, versionFromJdkLevel(this.complianceLevel));
optionsMap.put(OPTION_Release, DISABLED);
optionsMap.put(OPTION_Release, this.release ? ENABLED : DISABLED);
optionsMap.put(OPTION_Source, versionFromJdkLevel(this.sourceLevel));
optionsMap.put(OPTION_TargetPlatform, versionFromJdkLevel(this.targetJDK));
optionsMap.put(OPTION_FatalOptionalError, this.treatOptionalErrorAsFatal ? ENABLED : DISABLED);
Expand Down Expand Up @@ -1776,6 +1781,7 @@ public void set(Map<String, String> optionsMap) {
long level = versionToJdkLevel(optionValue);
if (level != 0) this.sourceLevel = level;
}
this.release = ENABLED.equals(optionsMap.get(OPTION_Release));
if ((optionValue = optionsMap.get(OPTION_TargetPlatform)) != null) {
long level = versionToJdkLevel(optionValue);
if (level != 0) {
Expand Down

0 comments on commit 3d90147

Please sign in to comment.