Skip to content

Bump FormDesigner module to JDK 17 and adjust javac task #8387

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion java/form/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<target name="absolute-layout" depends="build-init">
<mkdir dir="${build.dir}/absolutelayoutclasses"/>
<javac srcdir="release/sources" target="${javac.target}" source="${javac.source}" destdir="${build.dir}/absolutelayoutclasses"/>
<javac srcdir="release/sources" release="${absolutelayout.javac.release}" destdir="${build.dir}/absolutelayoutclasses"/>
<mkdir dir="${cluster}/modules/ext"/>
<nb-ext-jar jarfile="${cluster}/modules/ext/AbsoluteLayout.jar">
<manifest>
Expand Down
11 changes: 10 additions & 1 deletion java/form/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,17 @@
# specific language governing permissions and limitations
# under the License.


# 'error: exporting a package from system module java.desktop is not allowed with --release'
javac.source=17
javac.target=17

absolutelayout.javac.release=8
extra.module.files=modules/ext/AbsoluteLayout.jar
javac.source=1.8

# see o.n.m.form.fakepeer package
javac.compilerargs=--add-exports=java.desktop/java.awt.peer=ALL-UNNAMED

javadoc.arch=${basedir}/arch.xml
spec.version.base=1.85.0
test-unit-sys-prop.org.netbeans.modules.form.layoutdesign.test=0
Expand Down
11 changes: 6 additions & 5 deletions nbbuild/antsrc/org/netbeans/nbbuild/CustomJavac.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void execute() throws BuildException {
if (tgr.matches("\\d+")) {
tgr = "1." + tgr;
}
if (!isBootclasspathOptionUsed()) {
if (canUseRelease()) {
setRelease(tgr.substring(2));
}
String src = getSource();
Expand Down Expand Up @@ -135,13 +135,14 @@ protected void compile() {
super.compile();
}

private boolean isBootclasspathOptionUsed() {
private boolean canUseRelease() {
// 'error: exporting a package from system module java.desktop is not allowed with --release'
for (String arg : getCurrentCompilerArgs()) {
if (arg.contains("-Xbootclasspath")) {
return true;
if (arg.contains("-Xbootclasspath") || arg.contains("--add-exports=java.")) {
return false;
}
}
return false;
return true;
}

/**
Expand Down
Loading