Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/#414
Browse files Browse the repository at this point in the history
# Conflicts:
#	libraries/pi4j-library-gpiod/pom.xml
#	libraries/pi4j-library-linuxfs/pom.xml
#	libraries/pi4j-library-pigpio/pom.xml
#	libraries/pi4j-library/pom.xml
#	pi4j-core/pom.xml
#	pi4j-distribution/pom.xml
#	pi4j-test/pom.xml
#	plugins/pi4j-plugin-gpiod/pom.xml
#	plugins/pi4j-plugin-linuxfs/pom.xml
#	plugins/pi4j-plugin-mock/pom.xml
#	plugins/pi4j-plugin-pigpio/pom.xml
#	plugins/pi4j-plugin-raspberrypi/pom.xml
#	plugins/pi4j-plugin/pom.xml
#	pom.xml
  • Loading branch information
FDelporte committed Nov 28, 2024
2 parents 50167b3 + 2f381f1 commit c0358f5
Show file tree
Hide file tree
Showing 172 changed files with 3,538 additions and 848 deletions.
78 changes: 48 additions & 30 deletions libraries/pi4j-library-gpiod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

<!-- MAVEN ARTIFACT INFORMATION -->
<artifactId>pi4j-library-gpiod</artifactId>
<name>Pi4J :: LIBRARY :: JNI Wrapper for GpioD Library</name>
<name>Pi4J :: LIBRARY :: JNI Wrapper for GpioD Library</name>
<description>Pi4J wrapper for the GpioD library</description>
<packaging>jar</packaging>

Expand Down Expand Up @@ -43,9 +43,11 @@
<include>LICENSE.txt</include>
<include>NOTICE.txt</include>
<include>README.md</include>
<include>lib/armhf/pi4j-gpiod/libpi4j-gpiod.so</include> <!-- include the native 32-bit JNI library as a resource -->
<include>lib/armhf/pi4j-gpiod/libpi4j-gpiod.so
</include> <!-- include the native 32-bit JNI library as a resource -->
<include>lib/armhf/pi4j-gpiod/libgpiod.so</include>
<include>lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so</include> <!-- include the native 64-bit JNI library as a resource -->
<include>lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so
</include> <!-- include the native 64-bit JNI library as a resource -->
<include>lib/aarch64/pi4j-gpiod/libgpiod.so</include>
</includes>
</resource>
Expand Down Expand Up @@ -75,10 +77,12 @@
<requireFilesExist>
<files>
<!-- include 32-bit (ARMHF) Pi4J GpioD JNI Library -->
<file>${project.build.outputDirectory}/lib/armhf/pi4j-gpiod/libpi4j-gpiod.so</file>
<file>${project.build.outputDirectory}/lib/armhf/pi4j-gpiod/libpi4j-gpiod.so
</file>
<file>${project.build.outputDirectory}/lib/armhf/pi4j-gpiod/libgpiod.so</file>
<!-- include 64-bit (AARCH64) Pi4J GpioD JNI Library -->
<file>${project.build.outputDirectory}/lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so</file>
<file>${project.build.outputDirectory}/lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so
</file>
<file>${project.build.outputDirectory}/lib/aarch64/pi4j-gpiod/libgpiod.so</file>
</files>
</requireFilesExist>
Expand All @@ -104,14 +108,15 @@
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
classpathref="maven.plugin.classpath"/>
<if>
<equals arg1="${pi4j.dev.transfer}" arg2="true" />
<equals arg1="${pi4j.dev.transfer}" arg2="true"/>
<then>
<!-- ensure the target directory exists on the Raspberry Pi via SSH -->
<sshexec host="${pi4j.dev.host}" port="${pi4j.dev.port}" username="${pi4j.dev.user}"
<sshexec host="${pi4j.dev.host}" port="${pi4j.dev.port}"
username="${pi4j.dev.user}"
password="${pi4j.dev.password}" trust="true" failonerror="false"
verbose="false" command="mkdir --parents ${pi4j.dev.directory}" />
verbose="false" command="mkdir --parents ${pi4j.dev.directory}"/>

<!-- copy the JAR file to the Raspberry Pi vs SCP -->
<scp file="${project.build.directory}/${project.build.finalName}.jar"
Expand All @@ -133,15 +138,20 @@
<goal>run</goal>
</goals>
<configuration>
<target name="pi4j-attach-native-library" >
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath"/>
<target name="pi4j-attach-native-library">
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath"/>
<!-- attach 32-bit (ARMHF) Pi4J GpioD JNI Library -->
<attachartifact file="${project.build.directory}/lib/armhf/pi4j-gpiod/libpi4j-gpiod.so" classifier="armhf" type="so"/>
<attachartifact file="${project.build.directory}/lib/armhf/pi4j-gpiod/libgpiod.so" classifier="armhf" type="so"/>
<attachartifact file="${project.build.directory}/lib/armhf/pi4j-gpiod/libpi4j-gpiod.so"
classifier="armhf" type="so"/>
<attachartifact file="${project.build.directory}/lib/armhf/pi4j-gpiod/libgpiod.so"
classifier="armhf" type="so"/>
<!-- attach 64-bit (AARCH64) Pi4J GpioD JNI Library -->
<attachartifact file="${project.build.directory}/lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so" classifier="aarch64" type="so"/>
<attachartifact file="${project.build.directory}/lib/aarch64/pi4j-gpiod/libgpiod.so" classifier="aarch64" type="so"/>
<attachartifact
file="${project.build.directory}/lib/aarch64/pi4j-gpiod/libpi4j-gpiod.so"
classifier="aarch64" type="so"/>
<attachartifact file="${project.build.directory}/lib/aarch64/pi4j-gpiod/libgpiod.so"
classifier="aarch64" type="so"/>
</target>
</configuration>
</execution>
Expand Down Expand Up @@ -213,7 +223,8 @@
<classifier>armhf</classifier>
<type>so</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/armhf/pi4j-gpiod</outputDirectory>
<outputDirectory>${project.build.directory}/lib/armhf/pi4j-gpiod
</outputDirectory>
<destFileName>libpi4j-gpiod.so</destFileName>
</artifactItem>
<artifactItem>
Expand All @@ -223,7 +234,8 @@
<classifier>armhf</classifier>
<type>so</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/armhf/pi4j-gpiod</outputDirectory>
<outputDirectory>${project.build.directory}/lib/armhf/pi4j-gpiod
</outputDirectory>
<destFileName>libgpiod.so</destFileName>
</artifactItem>

Expand All @@ -237,7 +249,8 @@
<type>so</type>
<classifier>aarch64</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/aarch64/pi4j-gpiod</outputDirectory>
<outputDirectory>${project.build.directory}/lib/aarch64/pi4j-gpiod
</outputDirectory>
<destFileName>libpi4j-gpiod.so</destFileName>
</artifactItem>
<artifactItem>
Expand All @@ -247,7 +260,8 @@
<type>so</type>
<classifier>aarch64</classifier>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/lib/aarch64/pi4j-gpiod</outputDirectory>
<outputDirectory>${project.build.directory}/lib/aarch64/pi4j-gpiod
</outputDirectory>
<destFileName>libgpiod.so</destFileName>
</artifactItem>
</artifactItems>
Expand Down Expand Up @@ -283,10 +297,10 @@
<phase>generate-resources</phase>
<configuration>
<target>
<mkdir dir="target" />
<mkdir dir="target/classes" />
<mkdir dir="target/build" />
<mkdir dir="target/build/native" />
<mkdir dir="target"/>
<mkdir dir="target/classes"/>
<mkdir dir="target/build"/>
<mkdir dir="target/build/native"/>
<copy todir="target/build/native">
<fileset dir="src/main/native"/>
</copy>
Expand All @@ -311,28 +325,32 @@
<configuration>
<target>
<taskdef resource="net/sf/antcontrib/antcontrib.properties"
classpathref="maven.plugin.classpath" />
classpathref="maven.plugin.classpath"/>
<if>
<!-- check for DOCKER-COMPILER setting in the 'pi4j.native.compiler' property -->
<equals arg1="${pi4j.native.compiler.effective}" arg2="DOCKER-COMPILER" />
<equals arg1="${pi4j.native.compiler.effective}" arg2="DOCKER-COMPILER"/>
<then>
<!-- perform native build using Pi4J Docker Builder Image for native cross-compiling -->
<exec dir="${project.build.directory}/build/native" executable="/bin/bash" failonerror="true">
<exec dir="${project.build.directory}/build/native"
executable="/bin/bash" failonerror="true">
<arg value="build-docker.sh"/>
</exec>
</then>
<else>
<if>
<!-- check for CROSS-COMPILER setting in the 'pi4j.native.compiler' property -->
<equals arg1="${pi4j.native.compiler.effective}" arg2="CROSS-COMPILER" />
<equals arg1="${pi4j.native.compiler.effective}"
arg2="CROSS-COMPILER"/>
<then>
<!-- perform native build using cross-compiler toolchains directly on host -->
<exec dir="${project.build.directory}/build/native" executable="/bin/bash" failonerror="true">
<exec dir="${project.build.directory}/build/native"
executable="/bin/bash" failonerror="true">
<arg value="build.sh"/>
</exec>
</then>
<else>
<fail message="NATIVE BUILD FAILED/ABORTED; Missing or invalid 'pi4j.native.compiler' property. [${pi4j.native.compiler}]; Expected 'CROSS-COMPILER|DOCKER-COMPILER'"/>
<fail
message="NATIVE BUILD FAILED/ABORTED; Missing or invalid 'pi4j.native.compiler' property. [${pi4j.native.compiler}]; Expected 'CROSS-COMPILER|DOCKER-COMPILER'"/>
</else>
</if>
</else>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ else if (libpath.equalsIgnoreCase("local")) {

/**
* Loads library from classpath
*
* <p>
* The file from classpath is copied into system temporary directory and then loaded. The temporary file is
* deleted after exiting. Method uses String as filename because the pathname is
* "abstract", not system-dependent.
Expand Down
Loading

0 comments on commit c0358f5

Please sign in to comment.