Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilone committed Nov 25, 2024
2 parents 7ec2172 + b213ecc commit 20e69c5
Show file tree
Hide file tree
Showing 175 changed files with 1,023 additions and 784 deletions.
29 changes: 29 additions & 0 deletions config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">

<module name="Checker">
<module name="TreeWalker">
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->

<!-- Ignore missing field/variable comments -->
<module name="JavadocVariable">
<property name="severity" value="ignore"/>
</module>

<!-- Ignore missing method comments -->
<module name="JavadocMethod">
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
</module>

<!-- Ignore enum constant documentation -->
<module name="JavadocType">
<property name="tokens" value="INTERFACE_DEF, CLASS_DEF, ANNOTATION_DEF"/>
<!-- This excludes ENUM_DEF -->
</module>
</module>
</module>
80 changes: 49 additions & 31 deletions libraries/pi4j-library-gpiod/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<parent>
<groupId>com.pi4j</groupId>
<artifactId>pi4j-library</artifactId>
<version>2.7.0-SNAPSHOT</version>
<version>2.7.1-SNAPSHOT</version>
<relativePath>../pi4j-library/pom.xml</relativePath>
</parent>

<!-- 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 20e69c5

Please sign in to comment.