Skip to content
28 changes: 21 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,35 @@ on:
branches: [ master ]

jobs:
test:

mvn-test-x86:

runs-on: ${{ matrix.os }}

strategy:
matrix:
java-version: ['8', '11', '17', '21', '25']

runs-on: ubuntu-latest
os: [ubuntu-latest, macos-latest]
java-test-version: ['8', '11', '17', '21', '25']
fail-fast: false

steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v1.4.3
- name: Set up JDK 17 for build
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: 'zulu'
java-version: |
8
17
- name: Build
run: mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
- name: Set up JDK ${{ matrix.java-test-version }} for test
uses: actions/setup-java@v5
with:
distribution: 'zulu'
java-version: ${{ matrix.java-test-version }}
- name: Install dependencies on macOS
if: matrix.os == 'macos-latest'
run: brew install texinfo automake autoconf
- name: Test
run: ant test
177 changes: 32 additions & 145 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.jnr</groupId>

<parent>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-parent</artifactId>
<version>0.0.1</version>
</parent>

<artifactId>jffi</artifactId>
<packaging>jar</packaging>
<version>1.3.16-SNAPSHOT</version>
Expand Down Expand Up @@ -47,9 +53,6 @@
<properties>
<maven.test.skip>true</maven.test.skip>
<maven.test.failure.ignore>true</maven.test.failure.ignore>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
<make.exe>make</make.exe>
</properties>

Expand Down Expand Up @@ -78,120 +81,41 @@
<make.exe>gmake</make.exe>
</properties>
</profile>
<profile>
<id>java9</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<!-- Compile UnsafeMemoryIO without release flag, so it can access Unsafe -->
<id>default-compile</id>
<phase>compile</phase>
<configuration>
<includes>
<include>com/kenai/jffi/UnsafeMemoryIO.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>java9-compile</id>
<phase>compile</phase>
<goals><goal>compile</goal></goals>
<configuration>
<!-- Compile the rest with release flag to ensure compatibility with 8 -->
<!-- Use -release compiler option rather than source/target if 9+ -->
<release>${maven.compiler.target}</release>
<!-- Exclude unsafe-using class when compiling with release flag -->
<includes>
<include>**/*.java</include>
</includes>
<excludes>
<exclude>com/kenai/jffi/UnsafeMemoryIO.java</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<activation>
<jdk>[9,)</jdk>
</activation>
</profile>
<profile>
<id>release</id>
<build>
<plugins>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<doclint>none</doclint>
</configuration>
</plugin>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<gpgArguments>
<gpgArgument>--pinentry-mode</gpgArgument>
<gpgArgument>loopback</gpgArgument>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<invoker.skip>true</invoker.skip>
</properties>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<debug>true</debug>
<showDeprecation>true</showDeprecation>
</configuration>
<!-- This is a bit gross; we can't access sun.misc without jdk.supported, but we can't add jdk.unsupported
while also setting release 8. For now we require a JDK 8 toolchain to compile this one class. -->
<executions>
<execution>
<id>default-compile</id>
<configuration>
<jdkToolchain>
<version>8</version>
</jdkToolchain>
<includes>
<include>com/kenai/jffi/UnsafeMemoryIO.java</include>
</includes>
</configuration>
</execution>
<execution>
<id>java9-compile</id>
<phase>compile</phase>
<goals><goal>compile</goal></goals>
<configuration>
<excludes>
<exclude>com/kenai/jffi/UnsafeMemoryIO.java</exclude>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>default-jar</id>
Expand All @@ -208,7 +132,6 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>2.4.0</version>
<extensions>false</extensions>
<executions>
<execution>
Expand Down Expand Up @@ -252,33 +175,6 @@
</execution>
</executions>
</plugin>
<!--
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>build-native-library</id>
<phase>process-classes</phase>
<configuration>
<tasks>
<property name="os.name" value="${os.name}" />
<property name="os.arch" value="${os.arch}" />
<property name="java.home" value="${java.home}" />
<property name="dist.dir" value="${project.build.directory}" />
<property name="build.dir" value="${project.build.directory}" />
<property name="build.classes.dir" value="${project.build.outputDirectory}" />
<ant antfile="custom-build.xml" dir="." target="-assemble-native-jar" />
<unjar src="${project.build.directory}/native.jar" dest="${project.build.outputDirectory}" />
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
-->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
Expand Down Expand Up @@ -385,15 +281,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>0.7.0</version>
<extensions>true</extensions>
<configuration>
<publishingServerId>central</publishingServerId>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading