-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
78 lines (65 loc) · 2.31 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
68
69
70
71
72
73
74
75
76
77
78
.PHONY: trace amd64 arm64 java clean amd64-docker arm64-docker default-docker
UNAME_P := $(shell uname -p 2> /dev/null || "x86_64")
DEFAULT := "amd64"
ifneq ($(filter arm%,$(UNAME_P)),)
DEFAULT := "aarch64"
endif
trace:
./gradlew shadowJar
$(JAVA_HOME)/bin/java -agentlib:native-image-agent=config-merge-dir=native-image-config \
-jar build/libs/xls2json-*-all.jar \
src/test/resources/sample.xlsx \
src/test/resources/sample.xls \
src/test/resources/sampleTwoSheets.xls \
src/test/resources/empty.xls \
> /dev/null 2> /dev/null
$(JAVA_HOME)/bin/java -agentlib:native-image-agent=config-merge-dir=native-image-config \
-jar build/libs/xls2json-*-all.jar --pretty \
src/test/resources/sample.xlsx \
src/test/resources/sample.xls \
src/test/resources/sampleTwoSheets.xls \
src/test/resources/empty.xls \
> /dev/null 2> /dev/null
# remove duplicate entries
jq 'del(.resources.includes[] | select(.pattern | startswith("\\Qorg/apache/poi/schemas/ooxml/system/ooxml/")))' \
native-image-config/resource-config.json > native-image-config/resource-config-short.json
mv native-image-config/resource-config-short.json native-image-config/resource-config.json
amd64-docker:
docker build --build-arg ARCH=amd64/ \
--build-arg GVM_PLATFORM=amd64 \
-t xls2json-builder:amd64 .
arm64-docker:
docker build --build-arg ARCH=arm64v8/ \
--build-arg GVM_PLATFORM=aarch64 \
-t xls2json-builder:arm64v8 .
default-docker:
docker build --build-arg GVM_PLATFORM=$(DEFAULT) \
-t xls2json-builder:default .
amd64:
docker run --platform linux/amd64 -it --rm \
-v $(PWD):/app \
xls2json-builder:amd64 \
bash -c "./gradlew nativeImage"
mkdir -p dist
cp build/executable/xls2json dist/xls2json-amd64
arm64:
docker run --platform linux/arm64 -it --rm \
-v $(PWD):/app xls2json-builder:arm64v8 \
bash -c "./gradlew nativeImage"
mkdir -p dist
cp build/executable/xls2json dist/xls2json-arm64
java:
docker run -it --rm \
-v $(PWD):/app \
xls2json-builder:default \
bash -c "./gradlew build"
mkdir -p dist
cp build/distributions/* dist/
cp build/libs/*-all.jar dist/
clean:
docker run -it --rm \
-v $(PWD):/app \
debian:10-slim \
bash -c "rm -rf .gradle build dist"
dist:
$(MAKE) default-docker arm64-docker amd64-docker clean java amd64 arm64