Skip to content

Commit

Permalink
Add official support for Java 17
Browse files Browse the repository at this point in the history
  • Loading branch information
mikir committed Dec 11, 2023
1 parent ab239be commit 3ea3c54
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ jobs:
python-version: "3.8"
java-version: "11"
clang-version-suffix: "-11"
- os: "ubuntu-20.04"
python-version: "3.8"
java-version: "17"
clang-version-suffix: "-11"
- os: "ubuntu-22.04"
python-version: "3.8"
java-version: "8"
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
- os: "windows-2022"
python-version: "3.8"
java-version: "11"
- os: "windows-2022"
python-version: "3.8"
java-version: "17"
name: OS ${{matrix.os}}, Python ${{matrix.python-version}}, Java ${{matrix.java-version}}
env:
CPPCHECK_HOME: "/c/Program Files/Cppcheck"
Expand Down
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ gpg.executable - GnuPG executable to use for artifact signing. Defa
<fileset id="zserio_bundle.sources" dir="${zserio_bundle.javadocs_src_dir}"/>
<javadoc packagenames="zserio.*" destdir="${zserio_bundle.javadocs_dir}"
failonerror="true" failonwarning="true" useexternalfile="true">
<arg value="-Xdoclint:-missing"/>
<fileset refid="zserio_bundle.sources"/>
<doctitle>
<![CDATA[<h1>Zserio Bundle</h1><h2>Version ${zserio.version}</h2]]>
Expand Down
2 changes: 1 addition & 1 deletion compiler/extensions/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For an **API documentation** see the [Java Runtime Library](https://zserio.org/d

## Supported Java Versions

Zserio Java generator supports the Java SE 8 (LTS) and the Java SE 11 (LTS).
Zserio Java generator supports the Java SE 8 (LTS), the Java SE 11 (LTS) and the Java SE 17 (LTS).

Although newer Java versions are not tested, they should work as well as long as they are backward compatible.

Expand Down
14 changes: 14 additions & 0 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,20 @@ test_java()
return 1
fi

# calculate number of all run tests from ant output log file
local JAVA_VERSION=`${ANT} -diagnostics | grep ant.java.version | cut -d' ' -f2`
local ANT_LOG_FILE="${TEST_OUT_DIR}/java/${JAVA_VERSION}/test_log.txt"
if [ ! -f "${ANT_LOG_FILE}" ] ; then
stderr_echo "Ant output file '${ANT_LOG_FILE}' does not exist!"
return 1
fi
local TEST_COUNTS=(`grep '.*tests found.*' "${ANT_LOG_FILE}" | tr -s ' ' | cut -d' ' -f4`)
local INDEX
for INDEX in ${!TEST_COUNTS[@]} ; do
TOTAL_TEST_COUNT=$((${TOTAL_TEST_COUNT} + ${TEST_COUNTS[INDEX]}))
done
echo "Total number of testcases: ${TOTAL_TEST_COUNT}"

if [[ ${SWITCH_CLEAN} != 1 ]] ; then
compare_test_data "${TEST_SRC_DIR}" "${TEST_OUT_DIR}/java/" TEST_SUITES[@] "Java"
if [ $? -ne 0 ] ; then
Expand Down
15 changes: 0 additions & 15 deletions test/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -281,20 +281,5 @@ spotbugs.home_dir - Location of the spotbugs tool. If not set, spo
</subant>

<record name="${zserio_java_test.log_file}" action="stop"/>

<loadresource property="num_tests">
<fileset file="${zserio_java_test.log_file}"/>
<filterchain>
<containsregex pattern=".*\s+(\d+) tests found.*" replace="\1 "/>
<striplinebreaks/>
<scriptfilter language="javascript">
numList = self.getToken().trim().split(" ").map(Number);
sum = numList.reduce(function(a, b) { return a+ b; }, 0);
self.setToken(sum)
</scriptfilter>
</filterchain>
</loadresource>

<echo if:set="num_tests" message="Total number of testcases: ${num_tests}"/>
</target>
</project>

0 comments on commit 3ea3c54

Please sign in to comment.