Skip to content
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

Ant buildfiles export ignores the --release javac option #1437

Open
1 task done
jourquin opened this issue Jun 20, 2024 · 2 comments
Open
1 task done

Ant buildfiles export ignores the --release javac option #1437

jourquin opened this issue Jun 20, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@jourquin
Copy link

jourquin commented Jun 20, 2024

This issue is related to the File|Export|Ant Buildfiles tool of a Java project.

The generated build.xml file is supposed to reflect the compiler settings set either at the workspace or the project level.

In the Java|Compiler settings, the Compiler compliance level can be set. Another checkbox allows for using the --release option (instead of the -source and -target options pair).

As explained here, using --release is different from using the -source and -target pair.

However, the generated build.xml file always contains the following code, even if the "Use --release" option is checked in the Java Compiler properties:

<target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="classes" includeantruntime="false" source="${source}" target="${target}">
            <src path="src"/>
            <classpath refid="Nodus.classpath"/>
        </javac>
    </target>

Expected behavior:

  • When "Use --release" is checked (at the project or workspace level) a "release" property should be set, instead of the "target" and "source" properties in build.xml. Example:
<property name="release" value="11"/>
  • The following code should replace the previous one in build.xml:
<target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="classes" includeantruntime="false" release="${release}">
            <src path="src"/>
            <classpath refid="Nodus.classpath"/>
        </javac>
    </target>

Tested under this environment:

  • Eclipse IDE/Platform version (as shown in Help > About): 2024-06 (4.32.0)

Community

  • I understand reporting an issue to this OSS project does not mandate anyone to fix it. Other contributors may consider the issue, or not, at their own convenience. The most efficient way to get it fixed is that I fix it myself and contribute it back as a good quality patch to the project.
@jourquin jourquin added the bug Something isn't working label Jun 20, 2024
@akurtakov
Copy link
Member

Would you please give exact instructions and maybe sample plugin to reproduce the issue?

@jourquin
Copy link
Author

jourquin commented Jun 20, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants