forked from binaryage/dirac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.clj
416 lines (380 loc) · 25.5 KB
/
project.clj
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
(defproject binaryage/dirac "0.2.0"
:description "Dirac DevTools - a Chrome DevTools fork for ClojureScript developers."
:url "https://github.com/binaryage/dirac"
:license {:name "MIT License"
:url "http://opensource.org/licenses/MIT"
:distribution :repo}
:scm {:name "git"
:url "https://github.com/binaryage/dirac"}
:dependencies [[org.clojure/clojure "1.8.0" :scope "provided"]
[org.clojure/clojurescript "1.8.51" :scope "provided"]
[org.clojure/core.async "0.2.374"]
[org.clojure/tools.logging "0.3.1"]
[org.clojure/tools.cli "0.3.3"]
[org.clojure/tools.nrepl "0.2.12"]
[http-kit "2.1.21-alpha2"]
[clj-logging-config "1.9.12"]
[version-clj "0.1.2"]
[environ "1.0.2"]
[clansi "1.0.0"]
[funcool/cuerdas "0.7.2"]
; we cannot use :dependencies under individual profiles because Cursive recognizes only root level
; thus we mark extra deps with :scope "test" and filter them later when producing jar library
[binaryage/chromex "0.4.0" :scope "test"]
[binaryage/devtools "0.6.1" :scope "test"]
[cljs-http "0.1.40" :scope "test"]
[figwheel "0.5.2" :scope "test"]
[reforms "0.4.3" :scope "test"]
[rum "0.8.3" :scope "test"]
[rum-reforms "0.4.3" :scope "test"]
[parinfer "0.2.3" :scope "test"]
[com.lucasbradstreet/cljs-uuid-utils "1.0.2" :scope "test"]
[http.async.client "1.1.0" :scope "test"]
[org.slf4j/slf4j-log4j12 "1.7.21" :scope "test"]
[clj-webdriver "0.7.2" :scope "test"]
[org.seleniumhq.selenium/selenium-java "2.53.0" :scope "test"]
[org.seleniumhq.selenium/selenium-chrome-driver "2.53.0" :scope "test"]
[org.seleniumhq.selenium/selenium-support "2.53.0" :scope "test"]
[org.seleniumhq.selenium/selenium-htmlunit-driver "2.52.0" :scope "test"]
[org.seleniumhq.selenium/selenium-api "2.53.0" :scope "test"]
[ring/ring-core "1.4.0" :scope "test"]
[ring/ring-devel "1.4.0" :scope "test"]
[ring/ring-jetty-adapter "1.4.0" :scope "test"]
[clj-time "0.11.0" :scope "test"]]
; this effectively disables checkouts and gives us a chance to re-enable them on per-profile basis, see :checkouts profile
; http://jakemccrary.com/blog/2015/03/24/advanced-leiningen-checkouts-configuring-what-ends-up-on-your-classpath/
:checkout-deps-shares ^:replace []
:plugins [[lein-shell "0.5.0"]
[lein-environ "1.0.2"]]
; :jvm-opts ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"]
:source-paths ["src/agent"
"src/automation"
"src/background"
"src/dev"
"src/figwheel"
"src/implant"
"src/lib"
"src/logging"
"src/nrepl"
"src/options"
"src/project"
"src/rel"
"src/runtime"
"src/settings"
"src/shared"
"src/test"
"test/backend/src"
"test/browser/fixtures"
"test/browser/src"
"test/marion/src"]
:resource-paths ["resources"] ; this is for Cursive, will be redefined by profiles
:test-paths ["test"] ; this is for Cursive, will be redefined by profiles
; unfortunately this must be on root level because leiningen does not properly merge metadata
; see https://github.com/technomancy/leiningen/issues/1826
; ! be careful with lein clean or tasks which do cleaning implicitly, this will wipe out all generated files
:clean-targets ^{:protect false} ["target"
; also update scripts/clean-compiled.sh
"resources/unpacked/compiled"
"resources/unpacked/devtools/front_end/dirac/compiled"
"test/browser/fixtures/resources/compiled"
"test/marion/resources/unpacked/compiled"]
:cljsbuild {:builds {}} ; prevent https://github.com/emezeske/lein-cljsbuild/issues/413
:env {:dirac-root ~(System/getProperty "user.dir")}
:profiles {:lib
^{:pom-scope :provided} ; ! to overcome default jar/pom behaviour, our :dependencies replacement would be ignored for some reason
[:nuke-aliases
{:dependencies ~(let [project (->> "project.clj"
slurp read-string (drop 3) (apply hash-map))
test-dep? #(->> % (drop 2) (apply hash-map) :scope (= "test"))
non-test-deps (remove test-dep? (:dependencies project))]
(with-meta (vec non-test-deps) {:replace true})) ; so ugly!
:source-paths ^:replace ["src/project"
"src/settings"
"src/logging"
"src/runtime"
"src/lib"
"src/agent"
"src/nrepl"]
:resource-paths ^:replace []
:test-paths ^:replace []}]
:cooper
{:plugins [[lein-cooper "1.2.1"]]}
:cljs
{:plugins [[lein-cljsbuild "1.1.3"]
[lein-figwheel "0.5.2"]]
:hooks [leiningen.cljsbuild]}
:test-runner
{:source-paths ^:replace ["src/project"
"src/settings"
"src/logging"
"src/lib"
"src/agent"
"src/nrepl"]
:test-paths ["src/test"
"test/browser/src"
"test/backend/src"]}
:browser-tests
{:cljsbuild {:builds
{:tests
{:notify-command ["scripts/cljsbuild-notify.sh" "tests"]
:source-paths ["src/settings"
"src/project"
"src/lib"
"src/dev"
"src/automation"
"src/runtime"
"src/test"
"src/shared"
"src/agent"
"src/nrepl"
"test/browser/fixtures/src/tests"]
:compiler {:output-to "test/browser/fixtures/resources/compiled/tests/tests.js"
:output-dir "test/browser/fixtures/resources/compiled/tests"
:asset-path "compiled/tests"
:optimizations :none ; we rely on optimizations :none in test runner
:source-map true}}}}}
:marion-figwheel
{:figwheel {:server-port 7200
:server-logfile ".figwheel_marion.log"
:repl false}}
:marion
{:cljsbuild {:builds
{:marion-background
{:initial-notify-command ["scripts/cljsbuild-notify.sh" "marion-background"]
:source-paths ["src/settings"
"src/shared"
"test/marion/src/dev"
"test/marion/src/background"]
:compiler {:output-to "test/marion/resources/unpacked/compiled/background/background.js"
:output-dir "test/marion/resources/unpacked/compiled/background"
:asset-path "compiled/background"
:optimizations :none
:source-map true}}
:marion-content-script
{:notify-command ["scripts/cljsbuild-notify.sh" "marion-content-script"]
:source-paths ["src/settings"
"src/shared"
"test/marion/src/dev"
"test/marion/src/content_script"]
:compiler {:output-to "test/marion/resources/unpacked/compiled/content_script/content_script.js"
:output-dir "test/marion/resources/unpacked/compiled/content_script"
:asset-path "compiled/content_script"
:closure-output-charset "US-ASCII"
:optimizations :whitespace ; content scripts cannot do eval / load script dynamically
:pretty-print true
:source-map "test/marion/resources/unpacked/compiled/content_script/content_script.js.map"}}}}}
:dirac-figwheel
{:figwheel {:server-port 7100
:server-logfile ".figwheel_dirac.log"
:repl false}}
:dirac-unpacked
{:cljsbuild {:builds
{:dirac-implant
{:initial-notify-command ["scripts/cljsbuild-notify.sh" "dirac-implant"]
:source-paths ["src/settings"
"src/implant"
"src/lib"
"src/project"]
:compiler {:output-to "resources/unpacked/devtools/front_end/dirac/compiled/implant/implant.js"
:output-dir "resources/unpacked/devtools/front_end/dirac/compiled/implant"
:asset-path "dirac/compiled/implant"
:optimizations :none
:source-map true}}
:dirac-background
{:initial-notify-command ["scripts/cljsbuild-notify.sh" "dirac-background"]
:source-paths ["src/settings"
"src/dev"
"src/lib"
"src/figwheel"
"src/shared"
"src/project"
"src/background"]
:compiler {:output-to "resources/unpacked/compiled/background/dirac.js"
:output-dir "resources/unpacked/compiled/background"
:asset-path "compiled/background"
:optimizations :none
:source-map true}}
:dirac-options
{:initial-notify-command ["scripts/cljsbuild-notify.sh" "dirac-options"]
:source-paths ["src/settings"
"src/dev"
"src/lib"
"src/figwheel"
"src/shared"
"src/project"
"src/options"]
:compiler {:output-to "resources/unpacked/compiled/options/dirac.js"
:output-dir "resources/unpacked/compiled/options"
:asset-path "compiled/options"
:optimizations :none
:source-map true}}}}}
:dirac-packed
; note: we want to compile under target folder to prevent unnecessary recompilations after running ./scripts/release.sh
; the script will copy most recent build over
{:env {:chromex-elide-verbose-logging "true"}
:cljsbuild {:builds
{:dirac-implant
{:source-paths ["src/settings"
"src/implant"
"src/lib"
"src/project"]
:compiler {:output-to "target/resources/release/devtools/front_end/dirac/compiled/implant/implant.js"
:output-dir "target/resources/release/devtools/front_end/dirac/compiled/implant"
:asset-path "dirac/compiled/implant"
:optimizations :advanced
:elide-asserts true}}
:dirac-background
{:source-paths ["src/settings"
"src/rel"
"src/lib"
"src/shared"
"src/project"
"src/background"]
:compiler {:output-to "target/resources/release/compiled/background.js"
:output-dir "target/resources/release/compiled/background"
:asset-path "compiled/background"
:optimizations :advanced
:elide-asserts true}}
:dirac-options
{:source-paths ["src/settings"
"src/rel"
"src/lib"
"src/shared"
"src/project"
"src/options"]
:compiler {:output-to "target/resources/release/compiled/options.js"
:output-dir "target/resources/release/compiled/options"
:asset-path "compiled/options"
:optimizations :advanced
:elide-asserts true}}}}}
:pseudo-names
{:cljsbuild {:builds
{:dirac-implant
{:compiler {:pseudo-names true}}
:dirac-background
{:compiler {:pseudo-names true}}
:dirac-options
{:compiler {:pseudo-names true}}}}}
:parallel-build
{:cljsbuild {:builds
{:dirac-implant
{:compiler {:parallel-build true}}
:dirac-background
{:compiler {:parallel-build true}}
:dirac-options
{:compiler {:parallel-build true}}
:marion-background
{:compiler {:parallel-build true}}
:marion-content-script
{:compiler {:parallel-build true}}
:tests
{:compiler {:parallel-build true}}}}}
; DON'T FORGET TO UPDATE scripts/ensure-checkouts.sh
:checkouts
{:checkout-deps-shares ^:replace [:source-paths
:test-paths
:resource-paths
:compile-path
#=(eval leiningen.core.classpath/checkout-deps-paths)]
:cljsbuild {:builds
{:dirac-implant
{:source-paths ["checkouts/cljs-devtools/src"
"checkouts/chromex/src/lib"
"checkouts/chromex/src/exts"]
:compiler {}}
:dirac-background
{:source-paths ["checkouts/cljs-devtools/src"
"checkouts/chromex/src/lib"
"checkouts/chromex/src/exts"]
:compiler {}}
:dirac-options
{:source-paths ["checkouts/cljs-devtools/src"
"checkouts/chromex/src/lib"
"checkouts/chromex/src/exts"]
:compiler {}}
:marion-background
{:source-paths ["checkouts/cljs-devtools/src"
"checkouts/chromex/src/lib"
"checkouts/chromex/src/exts"]
:compiler {}}
:marion-content-script
{:source-paths ["checkouts/cljs-devtools/src"
"checkouts/chromex/src/lib"
"checkouts/chromex/src/exts"]
:compiler {}}
:tests
{:source-paths ["checkouts/cljs-devtools/src"
"checkouts/chromex/src/lib"
"checkouts/chromex/src/exts"]
:compiler {}}}}}
:nuke-aliases
{:aliases ^:replace {}}
; to develop browser tests:
;
; ./scripts/dev-browser-tests.sh
;
; after first launch you might need to reload extensions at chrome://extensions
; * 'dirac' should point to 'resources/unpacked'
; * 'marion' should point to 'test/marion/resources/unpacked'
;
; dev fixtures server is running at http://localhost:9080
:dev-browser-tests
{:cooper {"fixtures-server" ["scripts/launch-fixtures-server.sh"]
"dev-agent" ["lein" "run-browser-tests-agent"]
"fig-dirac" ["lein" "fig-dirac"]
"fig-marion" ["lein" "fig-marion"]
"marion-cs" ["lein" "auto-compile-marion-cs"]
"tests" ["lein" "auto-compile-browser-tests"]
"browser" ["scripts/launch-test-browser.sh"]}}}
:aliases {"check" ["shell" "scripts/check-code.sh"]
"test" ["shell" "scripts/test-all.sh"]
"test-backend" ["run-backend-tests"]
"test-browser" ["do" ; this will run browser tests against fully optimized dirac extension (release build)
"compile-browser-tests,"
"compile-marion,"
"release," ; = compile-dirac and devtools plus some cleanup, see scripts/release.sh
"run-browser-tests"]
"test-browser-dev" ["do" ; this will run browser tests against unpacked dirac extension
"compile-browser-tests,"
"compile-dirac-dev,"
"compile-marion,"
"run-browser-tests-dev"]
"dev-browser-tests" ["shell" "scripts/dev-browser-tests.sh"]
"run-backend-tests" ["with-profile" "+test-runner" "run" "-m" "dirac.backend-tests-runner"]
"run-browser-tests" ["with-profile" "+test-runner" "run" "-m" "dirac.browser-tests-runner"]
"run-browser-tests-dev" ["with-profile" "+test-runner" "run" "-m" "dirac.browser-tests-runner/-dev-main"]
"run-browser-tests-agent" ["with-profile" "+test-runner" "run" "-m" "dirac.browser-tests-runner/run-agent"]
"fig-dirac" ["with-profile" "+cljs,+checkouts,+dirac-unpacked,+dirac-figwheel"
"figwheel"
"dirac-background" "dirac-options" "dirac-implant"]
"compile-dirac-dev" ["with-profile" "+cljs,+checkouts,+parallel-build,+dirac-unpacked"
"cljsbuild" "once"
"dirac-background" "dirac-options" "dirac-implant"]
"auto-compile-dirac-dev" ["with-profile" "+cljs,+checkouts,+parallel-build,+dirac-unpacked"
"cljsbuild" "auto"
"dirac-background" "dirac-options" "dirac-implant"]
"compile-dirac" ["with-profile" "+cljs,+parallel-build,+dirac-packed"
"cljsbuild" "once"
"dirac-background" "dirac-options" "dirac-implant"]
"fig-marion" ["with-profile" "+cljs,+checkouts,+marion,+marion-figwheel"
"figwheel"
"marion-background"]
"compile-marion" ["with-profile" "+cljs,+parallel-build,+marion"
"cljsbuild" "once"
"marion-background" "marion-content-script"]
"auto-compile-marion" ["with-profile" "+cljs,+checkouts,+parallel-build,+marion"
"cljsbuild" "auto"
"marion-background" "marion-content-script"]
"auto-compile-marion-cs" ["with-profile" "+cljs,+checkouts,+parallel-build,+marion"
"cljsbuild" "auto"
"marion-content-script"]
"compile-browser-tests" ["with-profile" "+cljs,+checkouts,+parallel-build,+browser-tests"
"cljsbuild" "once" "tests"]
"auto-compile-browser-tests" ["with-profile" "+cljs,+checkouts,+parallel-build,+browser-tests"
"cljsbuild" "auto" "tests"]
"clean-compiled" ["shell" "scripts/clean-compiled.sh"]
"release" ["shell" "scripts/release.sh"]
"package" ["shell" "scripts/package.sh"]
"install" ["shell" "scripts/local-install.sh"]
"publish" ["shell" "scripts/deploy-clojars.sh"]
"regenerate" ["shell" "scripts/regenerate.sh"]})