-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathbuild.clj
More file actions
138 lines (133 loc) · 5.51 KB
/
Copy pathbuild.clj
File metadata and controls
138 lines (133 loc) · 5.51 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
(ns build
(:require
[clojure.tools.build.api :as b])
(:import
[java.time LocalDate]))
(def lib 'samply/blaze)
(def class-dir "target/classes")
(def basis (b/create-basis {:project "deps.edn"}))
(def uber-file (format "target/%s-standalone.jar" (name lib)))
(defn clean [_]
(b/delete {:path "target"}))
(defn- git
"Returns the trimmed output of the Git command with `args` or nil if it
produces no output or Git isn't available at all."
[& args]
(try
(b/git-process {:git-args (vec args)})
(catch Exception _ nil)))
(defn- write-version-file []
;; the only tags used are release tags like `v1.11.0`, so the version is the
;; tag HEAD points at without its leading `v`
(let [version (or (some-> (git "tag" "--points-at" "HEAD") (subs 1))
(git "rev-parse" "--short" "HEAD")
"unknown")]
(println "Build version:" version)
(b/write-file {:path (str class-dir "/blaze/version.edn")
:content {:blaze/version version
:blaze/release-date (str (LocalDate/now))}})))
(defn uber [_]
(clean nil)
(b/copy-dir {:src-dirs ["src" "resources"]
:target-dir class-dir})
(write-version-file)
(b/compile-clj {:basis basis
:class-dir class-dir
:ns-compile
'[blaze.admin-api
blaze.cache-collector
blaze.core
blaze.cql
blaze.db.kv.mem
blaze.db.kv.rocksdb
blaze.db.node
blaze.db.node.resource-indexer
blaze.db.resource-cache
blaze.db.resource-store.cassandra
blaze.db.resource-store.kv
blaze.db.search-param-registry
blaze.db.tx-cache
blaze.db.tx-log.kafka
blaze.db.tx-log.local
blaze.elm.expression.cache
blaze.fhir.operation.code-system.lookup
blaze.fhir.operation.code-system.validate-code
blaze.fhir.operation.compact
blaze.fhir.operation.cql
blaze.fhir.operation.evaluate-measure
blaze.fhir.operation.graphql
blaze.fhir.operation.graphql.middleware
blaze.fhir.operation.totals
blaze.fhir.operation.value-set.expand
blaze.fhir.operation.value-set.validate-code
blaze.fhir.parsing-context
blaze.fhir.structure-definition-repo
blaze.fhir.writing-context
blaze.handler.app
blaze.handler.health
blaze.http-client
blaze.interaction.conditional-delete-type
blaze.interaction.create
blaze.interaction.delete
blaze.interaction.delete-history
blaze.interaction.history.instance
blaze.interaction.history.system
blaze.interaction.history.type
blaze.interaction.read
blaze.interaction.search-compartment
blaze.interaction.search-system
blaze.interaction.search-type
blaze.interaction.transaction
blaze.interaction.update
blaze.interaction.vread
blaze.job-scheduler
blaze.job.async-interaction
blaze.job.compact
blaze.job.re-index
blaze.metrics.handler
blaze.metrics.registry
blaze.openid-auth
blaze.operation.graph
blaze.operation.patient.everything
blaze.operation.patient.purge
blaze.page-id-cipher
blaze.page-store.cassandra
blaze.page-store.local
blaze.rest-api
blaze.rest-api.async-status-cancel-handler
blaze.rest-api.async-status-handler
blaze.rest-api.batch-handler
blaze.rest-api.capabilities-handler
blaze.scheduler
blaze.server
blaze.terminology-service.extern
blaze.terminology-service.local
blaze.terminology-service.local.code-system.loinc
blaze.terminology-service.local.code-system.sct
blaze.terminology-service.not-available
blaze.thread-pool-executor-collector]
:compile-opts
{:direct-linking true
:elide-meta [:doc :file :line :added]}
:java-opts
["--enable-native-access=ALL-UNNAMED"]})
(b/uber {:class-dir class-dir
:uber-file uber-file
:basis basis
:main 'blaze.core
:exclude
["^about.html"
"^META-INF/versions/\\d+/module-info.class"
"^HISTORY-JAVA.md"
"^dse_protocol_v\\d.spec"
"^native_protocol_v\\d.spec"
".*-musl.so$"
".*-ppc64le.so$"
".*-s390x.so$"
".*-linux32.so$"
".*-linux-riscv64.so$"
".*.dll$"
".*.jnilib$"]
:conflict-handlers
{"META-INF/io.netty.versions.properties" :append
:default :warn}}))