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

feat: build native package for JDKs 7, 8, and 11 #153

Merged
merged 4 commits into from
Feb 1, 2024
Merged
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: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ the following files:
| ----------------------- | ---------------------- | -------- |
| jtopen-x.y.z.jar | <default> | This is the main JTOpen jar file. It contains almost all open source code (except for the few Toolbox classes that could not be open-sourced), including the utilities package and the JDBC driver (JDBC 3.0). This is analagous to the jar file classically named `jt400.jar`.|
| jtopen-x.y.z-native.jar | `native` | This is the main JTOpen jar file with support for "Native Optimizations" when running on IBM i. This is analagous to the file classically named `jt400Native.jar`.|
| jtopen-x.y.z-native-java8.jar | `native-java8` | This is the main JTOpen jar file with support for "Native Optimizations" built with Java 8.|
| jtopen-x.y.z-native-java11.jar | `native-java11` | This is the main JTOpen jar file with support for "Native Optimizations" built with Java 11.|
| jtopen-x.y.z-java8.jar | `java8` | This is the main JTOpen jar file but built for Java 8 (or newer). Some components (most notably the JDBC driver) may have extra capabilities available in Java 8. |
| jtopen-x.y.z-java11.jar | `java11` | This is the main JTOpen jar file but built for Java 11 (or newer). Some components (most notably the JDBC driver) may have extra capabilities available in Java 11. |
| jtopen-x.y.z-sources.zip | N/A | This is a zip file of all the source files in the repository. It is not a Java jar file. |
Expand Down
209 changes: 199 additions & 10 deletions pom-dist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>net.sf.jt400</groupId>
<artifactId>jt400</artifactId>
<packaging>jar</packaging>
<version>20.0.6</version>
<version>20.0.7</version>
<name>JTOpen</name>
<description>The Open Source version of the IBM Toolbox for Java</description>
<url>http://github.com/IBM/JTOpen</url>
Expand Down Expand Up @@ -281,7 +281,7 @@
<phase>process-classes</phase>
<configuration>
<target name="source-pcml">
<echo> Processing PCML files...</echo>
<echo> Processing NetServer PCML files...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${project.build.outputDirectory}/com/ibm/as400/access"
Expand Down Expand Up @@ -319,10 +319,10 @@
<phase>process-classes</phase>
<configuration>
<target name="source-pcml">
<echo> Processing PCML files...</echo>
<echo> Processing NetServer PCML files for Java 8...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${basedir}/target/sources_java8/com/ibm/as400/access"
destdir="${project.build.outputDirectory}_java8/com/ibm/as400/access"
srcdir="${basedir}/pcml"
includes="**/NetServer.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
Expand All @@ -338,10 +338,10 @@
<phase>process-classes</phase>
<configuration>
<target name="source-pcml-resources">
<echo> Processing PCML files...</echo>
<echo> Processing PCML files for Java 8...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${basedir}/target/sources_java8/com/ibm/as400/resource"
destdir="${project.build.outputDirectory}_java8/com/ibm/as400/resource"
srcdir="${basedir}/pcml"
includes="**/R*.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
Expand All @@ -357,10 +357,10 @@
<phase>process-classes</phase>
<configuration>
<target name="source-pcml">
<echo> Processing PCML files...</echo>
<echo> Processing NetServer PCML files for Java 11...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${basedir}/target/sources_java11/com/ibm/as400/access"
destdir="${project.build.outputDirectory}_java11/com/ibm/as400/access"
srcdir="${basedir}/pcml"
includes="**/NetServer.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
Expand All @@ -376,10 +376,124 @@
<phase>process-classes</phase>
<configuration>
<target name="source-pcml-resources">
<echo> Processing PCML files...</echo>
<echo> Processing PCML files for Java 11...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${project.build.outputDirectory}_java11/com/ibm/as400/resource"
srcdir="${basedir}/pcml"
includes="**/R*.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>source-pcml-NetServer-native</id>
<phase>process-classes</phase>
<configuration>
<target name="source-pcml">
<echo> Processing NetServer PCML files for Native...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${basedir}/target/sources_java11/com/ibm/as400/resource"
destdir="${project.build.outputDirectory}_native/com/ibm/as400/access"
srcdir="${basedir}/pcml"
includes="**/NetServer.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>source-pcml-resource-native</id>
<phase>process-classes</phase>
<configuration>
<target name="source-pcml-resources">
<echo> Processing PCML files for Native...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${project.build.outputDirectory}_native/com/ibm/as400/resource"
srcdir="${basedir}/pcml"
includes="**/R*.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>source-pcml-NetServer-java8-native</id>
<phase>process-classes</phase>
<configuration>
<target name="source-pcml">
<echo> Processing NetServer PCML files for Native Java 8...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${project.build.outputDirectory}_java8_native/com/ibm/as400/access"
srcdir="${basedir}/pcml"
includes="**/NetServer.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>source-pcml-resource-java8-native</id>
<phase>process-classes</phase>
<configuration>
<target name="source-pcml-resources">
<echo> Processing PCML files for Native Java 8...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${project.build.outputDirectory}_java8_native/com/ibm/as400/resource"
srcdir="${basedir}/pcml"
includes="**/R*.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>source-pcml-NetServer-java11-native</id>
<phase>process-classes</phase>
<configuration>
<target name="source-pcml">
<echo> Processing NetServer PCML files for Native Java 11...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${project.build.outputDirectory}_java11_native/com/ibm/as400/access"
srcdir="${basedir}/pcml"
includes="**/NetServer.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
/>
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
<execution>
<id>source-pcml-resource-java11-native</id>
<phase>process-classes</phase>
<configuration>
<target name="source-pcml-resources">
<echo> Processing PCML files for Native Java 11...</echo>
<taskdef name="pcml" classname="PCMLTask" classpath="${project.build.outputDirectory}_ant" />
<pcml
destdir="${project.build.outputDirectory}_java11_native/com/ibm/as400/resource"
srcdir="${basedir}/pcml"
includes="**/R*.pcml"
classpath="${project.build.outputDirectory}:${basedir}/pcml"
Expand Down Expand Up @@ -497,6 +611,53 @@
<outputDirectory>${project.build.outputDirectory}_native</outputDirectory>
</configuration>
</execution>

<execution>
<id>Compile Native JDK 8</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>8</source>
<target>8</target>
<release>8</release>
<fork>true</fork>
<compileSourceRoots>
<compileSourceRoot>${basedir}/target/sources_java8
</compileSourceRoot>
</compileSourceRoots>
<excludes>
<exclude>**/module-info.java</exclude>
</excludes>
<outputDirectory>${project.build.outputDirectory}_java8_native</outputDirectory>
</configuration>
</execution>
<execution>
<id>Compile Native JDK 11</id>
<phase>compile</phase>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<source>11</source>
<target>11</target>
<release>11</release>
<fork>true</fork>
<compileSourceRoots>
<compileSourceRoot>${basedir}/target/sources_java11
</compileSourceRoot>
</compileSourceRoots>
<excludes>
<exclude>jt400/module-info.java</exclude>
<exclude>jt400Servlet/module-info.java</exclude>
<exclude>com/ibm/as400/util/html/**</exclude>
<exclude>com/ibm/as400/util/servlet/**</exclude>
<exclude>com/ibm/as400/access/TunnelProxyServer.java</exclude>
</excludes>
<outputDirectory>${project.build.outputDirectory}_java11_native</outputDirectory>
</configuration>
</execution>
<execution>
<id>default-compile</id>
<phase>compile</phase>
Expand Down Expand Up @@ -613,6 +774,34 @@
</archive>
</configuration>
</execution>
<execution>
<id>jt400Native-java8</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${project.build.outputDirectory}_java8_native</classesDirectory>
<classifier>native-java8</classifier>
<archive>
<manifestFile>${project.build.outputDirectory}/../manifests/jt400Native_manifest.txt</manifestFile>
</archive>
</configuration>
</execution>
<execution>
<id>jt400Native-java11</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${project.build.outputDirectory}_java11_native</classesDirectory>
<classifier>native-java11</classifier>
<archive>
<manifestFile>${project.build.outputDirectory}/../manifests/jt400Native_manifest.txt</manifestFile>
</archive>
</configuration>
</execution>
<execution>
<id>jt400-java11</id>
<phase>package</phase>
Expand Down