-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild-installer.sh
More file actions
executable file
·76 lines (64 loc) · 2.32 KB
/
Copy pathbuild-installer.sh
File metadata and controls
executable file
·76 lines (64 loc) · 2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# Build native installer for lens-correct CLI tool
# Usage: ./build-installer.sh [platform]
# platform: linux, windows, osx (optional, defaults to current platform)
set -e
PLATFORM=$1
MVN_OPTS="-Djava.awt.headless=true --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED"
echo "========================================="
echo "Building lens-correct installer"
echo "========================================="
# Clean previous builds
echo "Cleaning previous builds..."
mvn clean
# Build JAR with dependencies
echo "Building JAR with dependencies..."
mvn package
# Copy JAR to jpackage input directory
echo "Preparing jpackage input directory..."
mkdir -p target/jars
cp target/*-jar-with-dependencies.jar target/jars/ 2>/dev/null || true
# Build installer for specified or current platform
if [ -z "$PLATFORM" ]; then
echo "Building installer for current platform..."
mvn install
else
echo "Building installer for platform: $PLATFORM"
case $PLATFORM in
linux)
echo "Building Linux DEB installer..."
mvn install -Dos.detected.name=linux
;;
windows)
echo "Building Windows MSI installer..."
mvn install -Dos.detected.name=windows
;;
osx)
echo "Building macOS PKG installer..."
mvn install -Dos.detected.name=osx
;;
all)
echo "Building installers for all platforms..."
echo "Note: Cross-platform builds may require additional tools"
# Linux
echo "Building Linux installer..."
mvn install -Dos.detected.name=linux
# Windows (requires Windows or Wine)
echo "Building Windows installer..."
mvn install -Dos.detected.name=windows
# macOS (requires macOS)
echo "Building macOS installer..."
mvn install -Dos.detected.name=osx
;;
*)
echo "Unknown platform: $PLATFORM"
echo "Valid options: linux, windows, osx, all"
exit 1
;;
esac
fi
echo "========================================="
echo "Build complete!"
echo "Installers can be found in:"
echo " target/installer-*/"
echo "========================================="