Skip to content

Commit

Permalink
Add upward compatibility to Java 9 Modularity (jython#325)
Browse files Browse the repository at this point in the history
This change uses the Automatic-Module-Name attribute to MANIFEST.MF to give distinct module names to the JARs that may appear as dependencies in modular Java builds. There is guidance in NEWS on how to manage some cases that proved a surprise in testing. Existing use of these JARs on the class path is not impeded.
---------
Co-authored-by: Jeff Allen <[email protected]>
  • Loading branch information
R077A6r1an authored Apr 29, 2024
1 parent 668a95e commit f3d8684
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions ACKNOWLEDGMENTS
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ In no particular order they are:
Diogo Teles Sant'Anna (GitHub: diogoteles08) C, 2023-08-10
Phil Turmel (GitHub: pturmel) C, 2023-12-30
lifebarier (GitHub: lifebarier) C, 2024-03-06
Adrian Ross (GitHub: R077A6r1an) C, 2024-04-09


Since about 2012 we have been asking contributors to sign the Python
Expand Down
18 changes: 16 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,23 @@ Jython 2.7.4

New Features

- Bug fixes only.
- When building a modular application or library, the jython-slim JAR may
be placed on the module path [GH-325]. It will export its usual packages
in an automatic module org.python.jython2. Application build tools that
create a run script, will generally add the dependencies of Jython to
the module path automatically. The developer may have to add (via the
build script) --add-modules ALL-MODULE-PATH to the java command to
ensure that these dependencies are resolved.

Jython 2.7.4b2 Bugs fixed
- The jython-standalone JAR (module org.python.jython2.standalone) may
also be used. Many shaded (and some unshaded) dependencies are then
duplicated in its module, which can be a problem. It may be necessary to
--add-modules ALL-DEFAULT to ensure JDK classes are resolved.


Jython 2.7.4b2 Bugs fixed and features

- [ GH-325 ] Upward compatibility to Java 9 Modularity


Jython 2.7.4b1 Bugs fixed
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ jar {
attributes ([
'Main-Class': 'org.python.util.jython',
'Built-By': 'build.gradle',
'Automatic-Module-Name': 'org.python.jython2'
])

attributes( [ // Build-Info section
Expand Down
4 changes: 4 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@ The text for an official release would continue like ...
<manifest>
<attribute name="Main-Class" value="org.python.util.jython" />
<attribute name="Built-By" value="${user.name}" />
<attribute name="Automatic-Module-Name" value="org.python.jython2.shaded"/>
<attribute name="Implementation-Vendor" value="Python Software Foundation"/>
<attribute name="Implementation-Title" value="Jython fat jar"/>
<attribute name="Implementation-Version" value="${jython.version}"/>
Expand All @@ -939,6 +940,7 @@ The text for an official release would continue like ...
<manifest>
<attribute name="Main-Class" value="org.python.util.jython" />
<attribute name="Built-By" value="${user.name}" />
<attribute name="Automatic-Module-Name" value="org.python.jython2.standalone"/>
<attribute name="Implementation-Vendor" value="Python Software Foundation"/>
<attribute name="Implementation-Title" value="Jython fat jar with stdlib"/>
<attribute name="Implementation-Version" value="${jython.version}"/>
Expand Down Expand Up @@ -982,6 +984,7 @@ The text for an official release would continue like ...
<manifest>
<attribute name="Main-Class" value="org.python.util.jython" />
<attribute name="Built-By" value="${user.name}" />
<attribute name="Automatic-Module-Name" value="org.python.jython2"/>
<attribute name="Implementation-Vendor" value="Python Software Foundation"/>
<attribute name="Implementation-Title" value="Jython"/>
<attribute name="Implementation-Version" value="${jython.version}"/>
Expand Down Expand Up @@ -1011,6 +1014,7 @@ The text for an official release would continue like ...
<manifest>
<attribute name="Main-Class" value="org.python.util.jython" />
<attribute name="Built-By" value="${user.name}" />
<attribute name="Automatic-Module-Name" value="org.python.jython2.test"/>
<attribute name="Implementation-Vendor" value="Python Software Foundation"/>
<attribute name="Implementation-Title" value="Jython Test JAR"/>
<attribute name="Implementation-Version" value="${jython.version}"/>
Expand Down

0 comments on commit f3d8684

Please sign in to comment.