Skip to content

Commit

Permalink
Merge pull request #1393 from matthiasblaesing/native_encoding_jdk18
Browse files Browse the repository at this point in the history
Update native encoding detection for JEP400
  • Loading branch information
matthiasblaesing authored Nov 3, 2021
2 parents 797cd46 + 06ec1e4 commit 18d0988
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 84 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [8, 11, 16, 17-ea]
java: [8, 11, 17, 18-ea]
os: [ubuntu-latest, macos-latest]
# Run all tests even if one fails
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ pom-jna-platform.xml.asc
/contrib/platform/nbproject/private/
/nbproject/private/
/native/.ccls-cache/
/contrib/ntservice/nbproject/private/
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Features
* [#1093](https://github.com/java-native-access/jna/issues/1093): Add `OpenFileMapping` to `c.s.j.p.win32.Kernel32` - [@lmitusinski](https://github.com/lmitusinski).
* [#1388](https://github.com/java-native-access/jna/issues/1388): Map the arch `zarch_64` as reported by SAPJVM8 to `s390x` - [@MBaesken](https://github.com/MBaesken).
* [#1381](https://github.com/java-native-access/jna/issues/1381): Update embedded libffi to 3.4.2 - [@matthiasblaesing](https://github.com/matthiasblaesing).
* [#1393](https://github.com/java-native-access/jna/issues/1393): Update native encoding detection for JEP400 / JDK 18 (`file.encoding` now defaults to `UTF-8`) - [@matthiasblaesing](https://github.com/matthiasblaesing).

Bug Fixes
---------
Expand Down
2 changes: 2 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,8 @@ osname=macosx;processor=aarch64
<property name="file.reference.jna.build" location="${build}"/>
<property name="file.reference.jna.jar" location="${build}/${jar}"/>
<property name="libs.junit.classpath" refid="test.libs"/>
<property name="javac.source" value="${compatibility}" />
<property name="javac.target" value="${compatibility}" />
<fileset dir="${contrib}" includes="*/build.xml" excludes="platform/build.xml"/>
</subant>
</target>
Expand Down
18 changes: 10 additions & 8 deletions contrib/alphamaskdemo/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.alphamaskdemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.alphamaskdemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-alphamask.jar"/>
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-alphamask.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.AlphaMaskDemo" />
<property name="main-class" value="com.sun.jna.contrib.demo.AlphaMaskDemo" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -37,7 +38,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
18 changes: 10 additions & 8 deletions contrib/balloonmanagerdemo/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.balloonmanagerdemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.balloonmanagerdemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-balloonmanager.jar"/>
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-balloonmanager.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.BalloonManagerDemo" />
<property name="main-class" value="com.sun.jna.contrib.demo.BalloonManagerDemo" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -37,7 +38,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
20 changes: 11 additions & 9 deletions contrib/balloontips/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.balloontipsdemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.balloontipsdemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-balloontips.jar"/>
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-balloontips.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.FilteredTextField" />
<property name="main-class" value="com.sun.jna.contrib.demo.FilteredTextField" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -37,8 +38,9 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
encoding="UTF-8" debug="on" includeantruntime="false">
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
</classpath>
Expand Down
18 changes: 10 additions & 8 deletions contrib/dnddemo/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.dnddemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.dnddemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-dnd.jar"/>
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-dnd.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.GhostedDragImageDemo" />
<property name="main-class" value="com.sun.jna.contrib.demo.GhostedDragImageDemo" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -37,7 +38,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
18 changes: 10 additions & 8 deletions contrib/monitordemo/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.monitordemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.monitordemo.</description>
<!-- Locations -->
<property name="src" location="./src"/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-monitordemo.jar"/>
<property name="src" location="./src"/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-monitordemo.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.MonitorInfoDemo" />
<property name="main-class" value="com.sun.jna.contrib.demo.MonitorInfoDemo" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -37,7 +38,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
18 changes: 10 additions & 8 deletions contrib/msoffice/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.msoffice" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.msoffice.</description>
<!-- Locations -->
<property name="src" location="./src"/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-msoffice.jar"/>
<property name="src" location="./src"/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-msoffice.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="" />
<property name="main-class" value="" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -37,7 +38,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
5 changes: 4 additions & 1 deletion contrib/native_window_msg/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
<property name="jar" location="${build}/demo-nativewindowmsg.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.platform.win32.Win32WindowDemo" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -36,7 +38,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
18 changes: 10 additions & 8 deletions contrib/shapedwindowdemo/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.shapedwindowdemo" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.shapedwindowdemo.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-shapedwindow.jar"/>
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-shapedwindow.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.ShapedWindowDemo" />
<property name="main-class" value="com.sun.jna.contrib.demo.ShapedWindowDemo" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -37,7 +38,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
18 changes: 10 additions & 8 deletions contrib/w32printing/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.w32printing" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.w32printing.</description>
<!-- Locations -->
<property name="src" location="./src"/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-w32printing.jar"/>
<property name="src" location="./src"/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-w32printing.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.platform.win32.Win32SpoolMonitor" />
<property name="main-class" value="com.sun.jna.platform.win32.Win32SpoolMonitor" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand All @@ -27,7 +28,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
18 changes: 10 additions & 8 deletions contrib/w32windowhooks/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
<project name="jnacontrib.w32windowhooks" default="jar" basedir=".">
<description>Builds, tests, and runs the project jnacontrib.w32windowhooks.</description>
<!-- Locations -->
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../../dist"/>

<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-w32windowhooks.jar"/>
<property name="src" location="."/>
<property name="build" location="build"/>
<property name="jna-dist" location="../../../dist"/>
<property name="classes" location="${build}/classes"/>
<property name="jar" location="${build}/demo-w32windowhooks.jar"/>
<property name="file.reference.jna.jar" location="../../build/jna.jar"/>
<property name="main-class" value="com.sun.jna.contrib.demo.WindowHooks" />
<property name="main-class" value="com.sun.jna.contrib.demo.WindowHooks" />
<property name="javac.target" value="1.6" />
<property name="javac.source" value="1.6" />

<path id="classpath">
<fileset file="${file.reference.jna.jar}"/>
Expand Down Expand Up @@ -37,7 +38,8 @@
<target name="compile">
<mkdir dir="${classes}"/>
<!-- Compile the project. -->
<javac srcdir="${src}" destdir="${classes}" target="1.6" source="1.6"
<javac srcdir="${src}" destdir="${classes}"
target="${javac.target}" source="${javac.source}"
encoding="UTF-8" debug="on" includeantruntime="false">
<classpath>
<path refid="classpath"/>
Expand Down
Loading

0 comments on commit 18d0988

Please sign in to comment.