From 8246da023f35a0d8dc89022e1e6c79b528677343 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Tue, 24 Sep 2024 09:41:30 +0200 Subject: [PATCH] successful graalvm compilation --- pom.xml | 371 +++++++++++------- .../org/cryptomator/cli/CryptomatorCli.java | 5 +- 2 files changed, 244 insertions(+), 132 deletions(-) diff --git a/pom.xml b/pom.xml index 14ed0bc..e500979 100644 --- a/pom.xml +++ b/pom.xml @@ -1,144 +1,253 @@ - - 4.0.0 - org.cryptomator - cli - 1.0.0-SNAPSHOT - Cryptomator CLI - Command line program to access encrypted files via WebDAV. - https://github.com/cryptomator/cli + + 4.0.0 + org.cryptomator + cli + 1.0.0-SNAPSHOT + Cryptomator CLI + Command line program to access encrypted files via WebDAV. + https://github.com/cryptomator/cli - - UTF-8 - UTF-8 - 22 + + UTF-8 + UTF-8 + 22 - - org.cryptomator.hubcli.HubCli - -Ob + + cryptomator-cli + org.cryptomator.cli.CryptomatorCli - - 2.7.0-beta1 - 2.0.6 - 5.0.0 - 2.0.16 + + 2.8.0-SNAPSHOT + 2.0.6 + 5.0.0 + 2.0.16 - - 24.0.1 - 4.7.6 + + 24.0.1 + 4.7.6 - - 3.13.0 - 3.7.1 - + + 3.13.0 + 3.3.0 + 3.7.1 + 0.10.3 + - - - GNU Affero General Public License (AGPL) version 3.0 - https://www.gnu.org/licenses/agpl.txt - repo - - + + + GNU Affero General Public License (AGPL) version 3.0 + https://www.gnu.org/licenses/agpl.txt + repo + + - - - Sebastian Stenzel - sebastian.stenzel@gmail.com - +1 - cryptomator.org - http://cryptomator.org - - - Armin Schrenk - armin.schrenk@skymatic.de - +1 - Skymatic GmbH - https://skymatic.de - - + + + Sebastian Stenzel + sebastian.stenzel@gmail.com + +1 + cryptomator.org + http://cryptomator.org + + + Armin Schrenk + armin.schrenk@skymatic.de + +1 + Skymatic GmbH + https://skymatic.de + + - - - org.cryptomator - cryptofs - ${cryptofs.version} - - - org.cryptomator - webdav-nio-adapter - ${webdav-nio.version} - - - org.cryptomator - fuse-nio-adapter - ${fuse-nio.version} - + + + org.cryptomator + cryptofs + ${cryptofs.version} + + + + org.cryptomator + fuse-nio-adapter + ${fuse-nio.version} + - - info.picocli - picocli - ${picocli.version} - + + info.picocli + picocli + ${picocli.version} + - - - org.slf4j - slf4j-api - ${slf4j.version} - - - org.slf4j - slf4j-jdk14 - ${slf4j.version} - - + + + org.slf4j + slf4j-api + ${slf4j.version} + + + org.slf4j + slf4j-jdk14 + ${slf4j.version} + + - - - - maven-compiler-plugin - ${maven-compiler.version} - - ${jdk.version} - true - - - info.picocli - picocli-codegen - ${picocli.version} - - - - -Aproject=${project.groupId}/${project.artifactId} - - - + + + + maven-compiler-plugin + ${maven-compiler.version} + + ${jdk.version} + true + + + info.picocli + picocli-codegen + ${picocli.version} + + + + -Aproject=${project.groupId}/${project.artifactId} + + + + + org.apache.maven.plugins + maven-jar-plugin + ${maven-jar.version} + + + + true + org.cryptomator.cli.CryptomatorCli + + + + + + maven-assembly-plugin + ${maven-assembly.version} + + + make-assembly + package + + single + + + + + + cryptomator-cli-${project.version} + + jar-with-dependencies + + false + + + ${mainClass} + ${project.version} + + + + + + - - maven-assembly-plugin - ${maven-assembly.version} - - - make-assembly - package - - single - - - - - cryptomator-cli-${project.version} - - jar-with-dependencies - - false - - - org.cryptomator.cli.CryptomatorCli - ${project.version} - - - - - - + + + native + + + + org.graalvm.buildtools + native-maven-plugin + ${graal-native.version} + true + + + build-native + + generateResourceConfig + compile-no-fork + + package + + + test-native + + test + + test + + + + + -Ob + -H:+PrintClassInitialization + -H:+UnlockExperimentalVMOptions + --initialize-at-build-time=org.cryptomator.cryptofs + --initialize-at-build-time=dagger.internal.DoubleCheck + --initialize-at-build-time=com.google.common.io.BaseEncoding$Alphabet + --initialize-at-build-time=com.google.common.io.BaseEncoding$Base64Encoding + --initialize-at-build-time=com.google.common.io.BaseEncoding$Base16Encoding + --initialize-at-build-time=com.google.common.collect.ImmutableSortedMap + --initialize-at-build-time=com.google.common.collect.ImmutableSortedMap$1EntrySet + --initialize-at-build-time=com.google.common.collect.ImmutableSortedMap$1EntrySet$1 + --initialize-at-build-time=com.google.common.collect.RegularImmutableSortedSet + --initialize-at-build-time=com.google.common.collect.RegularImmutableList + --initialize-at-build-time=com.google.common.collect.ImmutableAsList + --initialize-at-build-time=com.google.common.collect.ImmutableSortedAsList + --initialize-at-build-time=com.google.common.collect.NaturalOrdering + --initialize-at-build-time=org.slf4j.jul.JDK14LoggerAdapter + --initialize-at-build-time=com.google.common.base.CharMatcher$IsEither + --initialize-at-build-time=org.cryptomator.cryptolib.api.CryptorProvider$Scheme + + ${binaryName} + false + + true + + + + + org.codehaus.mojo + exec-maven-plugin + 3.4.1 + + + java-agent + + exec + + + ${env.JAVA_HOME}/bin/java + + --module-path + + --module + org.cryptomator.cli/${mainClass} + + + + + native + + exec + + + ${project.build.directory}/${binaryName} + ${project.build.directory} + + + + + + + + diff --git a/src/main/java/org/cryptomator/cli/CryptomatorCli.java b/src/main/java/org/cryptomator/cli/CryptomatorCli.java index 512c0a3..372a3b4 100644 --- a/src/main/java/org/cryptomator/cli/CryptomatorCli.java +++ b/src/main/java/org/cryptomator/cli/CryptomatorCli.java @@ -2,6 +2,7 @@ import org.cryptomator.cryptofs.CryptoFileSystemProperties; import org.cryptomator.cryptofs.CryptoFileSystemProvider; +import org.cryptomator.cryptofs.CryptoFileSystemUri; import org.cryptomator.cryptolib.api.Masterkey; import org.cryptomator.cryptolib.common.MasterkeyFileAccess; import org.cryptomator.integrations.mount.UnmountFailedException; @@ -14,6 +15,7 @@ import java.io.IOException; import java.net.URI; import java.nio.CharBuffer; +import java.nio.file.FileSystems; import java.nio.file.Path; import java.security.SecureRandom; import java.util.concurrent.Callable; @@ -47,7 +49,8 @@ public Integer call() throws Exception { //TODO: shortening Threshold //TODO: maxCleartextname .build(); - try (var fs = CryptoFileSystemProvider.newFileSystem(pathToVault, fsProps); + var uri = CryptoFileSystemUri.create(pathToVault); + try (var fs = FileSystems.newFileSystem(uri, fsProps); var mount = mountOptions.mount(fs)) { while (true) {