File tree Expand file tree Collapse file tree 3 files changed +31
-2
lines changed
Expand file tree Collapse file tree 3 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2+ set -euxo pipefail
23
34echo " Building cryptomator cli..."
45
@@ -14,6 +15,14 @@ if [ -z "$JAVA_HOME" ]; then
1415 exit 1
1516fi
1617
18+ # Check Java version
19+ MIN_JAVA_VERSION=$( mvn help:evaluate " -Dexpression=jdk.version" -q -DforceStdout) :w
20+ JAVA_VERSION=$( " $JAVA_HOME /bin/java" -version | head -n1 | cut -d' ' -f2 | cut -d' .' -f1)
21+ if [ " $JAVA_VERSION " -lt " $MIN_JAVA_VERSION " ]; then
22+ echo " Java version $JAVA_VERSION is too old. Minimum required version is $MIN_JAVA_VERSION "
23+ exit 1
24+ fi
25+
1726echo " Building java app with maven..."
1827mvn -B clean package
1928cp ./LICENSE.txt ./target/
@@ -44,6 +53,9 @@ if (echo "$_OS" | grep -q "Linux.*") ; then
4453 NATIVE_ACCESS_PACKAGE=" org.cryptomator.jfuse.linux.amd64"
4554 elif [ " $_ARCH " = " aarch64" ]; then
4655 NATIVE_ACCESS_PACKAGE=" org.cryptomator.jfuse.linux.aarch64"
56+ else
57+ echo " Warning: Unsupported Linux architecture for FUSE mounter: $_ARCH "
58+ echo " FUSE supported architectures: x86_64, aarch64"
4759 fi
4860fi
4961
Original file line number Diff line number Diff line change @@ -14,6 +14,14 @@ if [ -z "$JAVA_HOME" ]; then
1414 exit 1
1515fi
1616
17+ # Check Java version
18+ MIN_JAVA_VERSION=$( mvn help:evaluate " -Dexpression=jdk.version" -q -DforceStdout)
19+ JAVA_VERSION=$( " $JAVA_HOME /bin/java" -version | head -n1 | cut -d' ' -f2 | cut -d' .' -f1)
20+ if [ " $JAVA_VERSION " -lt " $MIN_JAVA_VERSION " ]; then
21+ echo " Java version $JAVA_VERSION is too old. Minimum required version is $MIN_JAVA_VERSION "
22+ exit 1
23+ fi
24+
1725echo " Building java app with maven..."
1826mvn -B clean package
1927cp ./LICENSE.txt ./target/
Original file line number Diff line number Diff line change 11" Building cryptomator cli..."
22
3+ # Check if maven is installed
34$commands = ' mvn'
45foreach ($cmd in $commands ) {
56 Invoke-Expression - Command " ${cmd} --version" - ErrorAction Stop
67}
78
9+ # Check if JAVA_HOME is set
810if (-not $env: JAVA_HOME ) {
911 throw " Environment variable JAVA_HOME not defined"
1012}
1113
14+ # Check Java version
15+ $minJavaVersion = $ (mvn help:evaluate " -Dexpression=jdk.version" - q - DforceStdout)
16+ $javaVersion = $ (& " $env: JAVA_HOME \bin\java" -- version) -split ' ' | Select-Object - Index 1
17+ if ( ($javaVersion -split ' .' | Select-Object - First 1 ) -ne " 22" ) {
18+ throw " Java version $javaVersion is too old. Minimum required version is $minJavaVersion "
19+ }
20+
1221Write-Host " Building java app with maven..."
1322mvn - B clean package
14- Copy-Item ./ LICENSE.txt - Destination ./ target
15- Move-Item ./ target/ cryptomator- cli-* .jar ./ target/ mods
23+ Copy-Item ./ LICENSE.txt - Destination ./ target - ErrorAction Stop
24+ Move-Item ./ target/ cryptomator- cli-* .jar ./ target/ mods - ErrorAction Stop
1625
1726Write-Host " Creating JRE with jlink..."
1827& $env: JAVA_HOME / bin/ jlink `
You can’t perform that action at this time.
0 commit comments