Skip to content

Commit

Permalink
Merge branch 'release/0.6.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
overheadhunter committed Sep 28, 2023
2 parents ea3ec46 + 7ec26bd commit 171a297
Show file tree
Hide file tree
Showing 19 changed files with 131 additions and 60 deletions.
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "06:00"
timezone: "UTC"
groups:
maven-dependencies:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/" # even for `.github/workflows`
schedule:
interval: "monthly"
groups:
github-actions:
patterns:
- "*"
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: 21-ea
java-version: 21
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
Expand All @@ -32,10 +32,10 @@ jobs:
runs-on: macos-12
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: 21-ea
java-version: 21
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
Expand All @@ -56,10 +56,10 @@ jobs:
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: 21-ea
java-version: 21
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
Expand All @@ -78,12 +78,12 @@ jobs:
needs: [linux-amd64, mac, win]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
java-version: 21-ea
java-version: 21
distribution: 'zulu'
cache: 'maven'
- name: Cache SonarCloud packages
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-central.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: "refs/tags/${{ github.event.inputs.tag }}"
- uses: actions/setup-java@v3
with:
java-version: 21-ea
java-version: 21
distribution: 'zulu'
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # only allow publishing tagged versions
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
java-version: 21-ea
java-version: 21
distribution: 'zulu'
cache: 'maven'
gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
Expand Down
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# jFUSE

Zero-Dependency Java bindings for FUSE using [JEP 4442](https://openjdk.org/jeps/442).
Zero-Dependency Java bindings for FUSE using [JEP 442](https://openjdk.org/jeps/442).

## Status

Expand Down
2 changes: 1 addition & 1 deletion jfuse-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-api</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions jfuse-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-examples</artifactId>
Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.3</version>
<version>2.0.9</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion jfuse-linux-aarch64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>jfuse-parent</artifactId>
<groupId>org.cryptomator</groupId>
<version>0.6.1</version>
<version>0.6.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-linux-aarch64</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@SupportedPlatform(os = OperatingSystem.LINUX, arch = Architecture.ARM64)
public class LinuxFuseBuilder implements FuseBuilder {

private static final String DEFAULT_LIB_PATH = "/lib/aarch64-linux-gnu/libfuse3.so.3";
private static final String DEFAULT_LIBNAME = "fuse3";
private static final Errno ERRNO = new LinuxErrno();
private String libraryPath;

Expand All @@ -39,7 +39,7 @@ public Fuse build(FuseOperations fuseOperations) throws UnsatisfiedLinkError {
if (libraryPath != null) {
System.load(libraryPath);
} else {
System.load(DEFAULT_LIB_PATH);
System.loadLibrary(DEFAULT_LIBNAME);
}
return new FuseImpl(fuseOperations);
}
Expand Down
2 changes: 1 addition & 1 deletion jfuse-linux-amd64/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-linux-amd64</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@SupportedPlatform(os = OperatingSystem.LINUX, arch = Architecture.AMD64)
public class LinuxFuseBuilder implements FuseBuilder {

private static final String DEFAULT_LIB_PATH = "/lib/x86_64-linux-gnu/libfuse3.so.3";
private static final String DEFAULT_LIBNAME = "fuse3";
private static final Errno ERRNO = new LinuxErrno();
private String libraryPath;

Expand All @@ -39,7 +39,7 @@ public Fuse build(FuseOperations fuseOperations) throws UnsatisfiedLinkError {
if (libraryPath != null) {
System.load(libraryPath);
} else {
System.load(DEFAULT_LIB_PATH);
System.loadLibrary(DEFAULT_LIBNAME);
}
return new FuseImpl(fuseOperations);
}
Expand Down
2 changes: 1 addition & 1 deletion jfuse-mac/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-mac</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@
import org.cryptomator.jfuse.api.platforms.OperatingSystem;
import org.cryptomator.jfuse.api.platforms.SupportedPlatform;

import java.nio.file.Files;
import java.nio.file.Path;

/**
* Builds FUSE file system instances on macOS.
*/
@SupportedPlatform(os = OperatingSystem.MAC, arch = Architecture.AMD64)
@SupportedPlatform(os = OperatingSystem.MAC, arch = Architecture.ARM64)
public class MacFuseBuilder implements FuseBuilder {

private static final String DEFAULT_MACFUSE_PATH = "/usr/local/lib/libfuse.dylib";
private static final String DEFAULT_FUSET_PATH = "/usr/local/lib/libfuse-t.dylib";
private static final String DEFAULT_MACFUSE_LIBNAME = "fuse";
private static final String DEFAULT_FUSET_LIBNAMNE = "fuse-t";
private static final Errno ERRNO = new MacErrno();
private String libraryPath;

Expand All @@ -43,12 +40,17 @@ public void setLibraryPath(String libraryPath) {
public Fuse build(FuseOperations fuseOperations) throws UnsatisfiedLinkError {
if (libraryPath != null) {
System.load(libraryPath);
} else if (Files.exists(Path.of(DEFAULT_MACFUSE_PATH))) {
System.load(DEFAULT_MACFUSE_PATH);
} else if (Files.exists(Path.of(DEFAULT_FUSET_PATH))) {
System.load(DEFAULT_FUSET_PATH);
} else {
System.loadLibrary("fuse");
try {
System.loadLibrary(DEFAULT_MACFUSE_LIBNAME);
} catch (UnsatisfiedLinkError errorLoadingMacFuse) {
try {
System.loadLibrary(DEFAULT_FUSET_LIBNAMNE);
} catch (UnsatisfiedLinkError errorLoadingFuseT) {
errorLoadingFuseT.addSuppressed(errorLoadingMacFuse);
throw errorLoadingFuseT;
}
}
}
return new FuseImpl(fuseOperations);
}
Expand Down
20 changes: 10 additions & 10 deletions jfuse-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-tests</artifactId>
Expand Down Expand Up @@ -58,19 +58,19 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.3</version>
<version>2.0.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-core</artifactId>
<version>1.35</version>
<version>1.37</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.openjdk.jmh</groupId>
<artifactId>jmh-generator-annprocess</artifactId>
<version>1.35</version>
<version>1.37</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -81,10 +81,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<argLine>@{surefire.jacoco.args} --enable-native-access=ALL-UNNAMED --enable-preview</argLine>
<systemProperties>
<argLine>@{surefire.jacoco.args} --enable-native-access=ALL-UNNAMED --enable-preview -Djava.library.path=".:${java.library.path}"</argLine>
<systemPropertyVariables>
<fuse.lib.path>${fuse.lib.path}</fuse.lib.path>
</systemProperties>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
Expand All @@ -100,10 +100,10 @@
<includes>
<include>**/*IT.java</include>
</includes>
<argLine>@{failsafe.jacoco.args} --enable-native-access=ALL-UNNAMED --enable-preview</argLine>
<systemProperties>
<argLine>@{failsafe.jacoco.args} --enable-native-access=ALL-UNNAMED --enable-preview -Djava.library.path=".:${java.library.path}"</argLine>
<systemPropertyVariables>
<fuse.lib.path>${fuse.lib.path}</fuse.lib.path>
</systemProperties>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package org.cryptomator.jfuse.tests;

import org.cryptomator.jfuse.api.Fuse;
import org.cryptomator.jfuse.examples.RandomFileSystem;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.api.condition.OS;
import org.junit.jupiter.api.io.TempDir;

import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.TimeoutException;

@EnabledIfSystemProperty(named = "fuse.lib.path", matches = ".+")
public class FallbackLibLoadingIT {

@Test
@EnabledOnOs(OS.LINUX)
@DisplayName("loads fuse lib from java.library.path, if not calling FuseBuilder.setLibraryPath(...)")
public void loadFromJavaLibraryPathOnLinux() throws IOException, TimeoutException {
loadFromJavaLibraryPath("libfuse3.so");
}

@Test
@EnabledOnOs(OS.MAC)
@DisplayName("loads fuse lib from java.library.path, if not calling FuseBuilder.setLibraryPath(...)")
public void loadFromJavaLibraryPathOnMacOS() throws IOException, TimeoutException {
loadFromJavaLibraryPath("libfuse-t.dylib");
}

private void loadFromJavaLibraryPath(String libFileName) throws IOException, TimeoutException {
// symlink ./${libName} -> ${fuse.lib.path}
var symlinkPath = Path.of(System.getProperty("user.dir"), libFileName);
Files.createSymbolicLink(symlinkPath, Path.of(System.getProperty("fuse.lib.path")));

var builder = Fuse.builder();
var fs = new RandomFileSystem(builder.errno());
var fuse = Assertions.assertDoesNotThrow(() -> builder.build(fs));
fuse.close();
}

}
2 changes: 1 addition & 1 deletion jfuse-win/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse-win</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion jfuse/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.cryptomator</groupId>
<artifactId>jfuse-parent</artifactId>
<version>0.6.1</version>
<version>0.6.2</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jfuse</artifactId>
Expand Down
Loading

0 comments on commit 171a297

Please sign in to comment.