-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
84 lines (61 loc) · 2.4 KB
/
Makefile
File metadata and controls
84 lines (61 loc) · 2.4 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
77
78
79
80
81
82
83
84
.phony: test bench clean bundle bundle-help ci sbom sbom-csv runtime-info
clean:
rm -rf target dev-resources/bench/*.json pom.xml
JAVA_MODULES ?= $(shell cat .java_modules)
target/nvd:
clojure -Xnvd check :classpath '"'"$$(clojure -Spath -Acli)"'"'
test:
clojure -J--limit-modules -J$(JAVA_MODULES) -X:cli:test :dirs '["src/test"]'
ci: test target/nvd
BENCH_SIZE ?= 10000
BENCH_PROFILE ?= dev-resources/profiles/calibration.jsonld
dev-resources/bench/payload.json:
clojure -Xtest:bench write-payload \
:num-statements $(BENCH_SIZE) \
:profile '"$(BENCH_PROFILE)"' \
:out '"dev-resources/bench/payload.json"'
bench: dev-resources/bench/payload.json
clojure -Xtest:bench run-bench-matrix \
:num-statements $(BENCH_SIZE) \
:payload-path '"dev-resources/bench/payload.json"'
target/bundle/xapipe.jar:
clojure -T:build uber
target/bundle/bin:
mkdir -p target/bundle/bin
cp bin/*.sh target/bundle/bin
chmod +x target/bundle/bin/*.sh
# publish docs
target/bundle/doc:
clojure -X:doc
# Make Runtime Environment (i.e. JREs)
# Will only produce a single jre for macos/linux matching your machine
MACHINE ?= $(shell bin/machine.sh)
target/bundle/runtimes:
mkdir -p target/bundle/runtimes
jlink --output target/bundle/runtimes/${MACHINE}/ --add-modules ${JAVA_MODULES}
BUNDLE_RUNTIMES ?= true
ifeq ($(BUNDLE_RUNTIMES),true)
target/bundle: target/bundle/xapipe.jar target/bundle/bin target/bundle/doc target/bundle/runtimes
else
target/bundle: target/bundle/xapipe.jar target/bundle/bin target/bundle/doc
endif
bundle: target/bundle
# Run the bundle's help, used for compile-time sanity checks
bundle-help: target/bundle
cd target/bundle; bin/run.sh --help
# Generate a POM for dependency graph resolution
pom.xml:
clojure -Acli -Spom
sbom: pom.xml
mvn -q org.cyclonedx:cyclonedx-maven-plugin:makeAggregateBom \
-DoutputFormat=json \
-DoutputName=xapipe \
-DschemaVersion=1.6 \
-DprojectType=application
sbom-csv: sbom
jq -r -f ./dev-resources/sbom/sbom_flat.jq ./target/xapipe.json > ./target/xapipe-sbom.csv
target/runtime-info.txt: bundle Dockerfile
mkdir -p target
docker build -t xapipe:local .
docker run --rm --entrypoint sh xapipe:local -c 'set -e; echo "== OS =="; cat /etc/os-release; echo; echo "== Kernel =="; uname -a; echo; echo "== Java =="; /xapipe/runtimes/linux/bin/java -version 2>&1; echo; echo "== Packages =="; apk info -vv' > target/runtime-info.txt
runtime-info: target/runtime-info.txt