-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
67 lines (53 loc) · 1.83 KB
/
Makefile
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
CYAN=\033[0;36m
NC=\033[0m
APP_NAME=ExampleApp
VERSION=3.0.0
BUILD_DIR=./build
TARGET=${BUILD_DIR}/${APP_NAME}.app
JLINK_IMAGE=${BUILD_DIR}/image
SKETCH_TOOL=/Applications/Sketch.app/Contents/Resources/sketchtool/bin/sketchtool
default:
./gradlew build run
jpackage_linux:
./gradlew jlink
# Temporarily copy icon file to root dir, since it needs to be in input dir.
cp ./src/main/resources/com/example/pew/icon.png .
${JAVA_HOME}/bin/jpackage \
--app-version ${VERSION} \
--copyright "Copyright 2022, example.com" \
--description "Pew File Viewer" \
--name "${APP_NAME}" \
--dest build/distribution \
--vendor "example.com" \
--runtime-image build/image \
--icon icon.png \
--file-associations linux.properties \
--module pew/com.example.pew.Launcher
rm -f icon.png
jpackage_darwin:
./gradlew jlink
# Temporarily copy icon file to root dir, since it needs to be in input dir.
cp ${BUILD_DIR}/res/FileIcon.icns ${BUILD_DIR}/..
${JAVA_HOME}/bin/jpackage \
--app-version ${VERSION} \
--copyright "Copyright 2022, example.com" \
--description "Pew File Viewer" \
--name "${APP_NAME}" \
--dest build/distribution \
--vendor "example.com" \
--runtime-image build/image \
--icon build/res/AppIcon.icns \
--mac-package-identifier com.example.pew \
--mac-package-name "PewFileViewer" \
--file-associations mac.properties \
--module pew/com.example.pew.Launcher
rm -f ${BUILD_DIR}/../FileIcon.icns
sketch_icons:
${SKETCH_TOOL} export artboards ./raw/AppIcon.sketch --output=${BUILD_DIR}/res/AppIcon.iconset
iconutil -c icns ${BUILD_DIR}/res/AppIcon.iconset
rm -rf ${BUILD_DIR}/res/AppIcon.iconset
${SKETCH_TOOL} export artboards ./raw/FileIcon.sketch --output=${BUILD_DIR}/res/FileIcon.iconset
iconutil -c icns ${BUILD_DIR}/res/FileIcon.iconset
rm -rf ${BUILD_DIR}/res/FileIcon.iconset
clean:
rm -rf ${BUILD_DIR}