Improve the build process; add Makefile

This commit is contained in:
Jeremy Dormitzer 2018-02-07 08:39:12 -05:00
parent bf73b17cbe
commit ad8f1acdbd
No known key found for this signature in database
GPG Key ID: 04F17C0F5A32C320
13 changed files with 72 additions and 28 deletions

3
.gitignore vendored
View File

@ -11,4 +11,5 @@ pom.xml.asc
.hg/
ext/js/generated/
.cljs_rhino_repl
profiles.clj
profiles.clj
dist

16
Makefile Normal file
View File

@ -0,0 +1,16 @@
dev :
lein cljsbuild once
rm -rf ext/js/generated/out-*
prod :
lein with-profile prod cljsbuild once
rm -rf ext/js/generated/out-*
package : clean prod
(cd ext; zip -r looped-in.zip * -x "*.DS_Store")
mkdir -p dist
mv ext/looped-in.zip dist
clean :
rm -rf ext/js/generated
rm -rf dist

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,6 @@
"background": {
"scripts": [
"js/browser-polyfill.min.js",
"js/generated/out/cljs_base.js",
"js/generated/background.js"
]
},
@ -25,7 +24,6 @@
"matches": ["<all_urls>"],
"js": [
"js/browser-polyfill.min.js",
"js/generated/out/cljs_base.js",
"js/generated/content.js"
]
}

View File

@ -6,7 +6,6 @@
<script src="js/browser-polyfill.min.js"></script>
<script src="js/moment.min.js"></script>
<script src="js/moment-range.min.js"></script>
<script src="js/generated/out/cljs_base.js"></script>
</head>
<body>
<div id="sidebar"></div>

View File

@ -9,26 +9,57 @@
[org.clojure/core.match "0.3.0-alpha5"]
[cljs-ajax "0.7.3"]]
:plugins [[lein-cljsbuild "1.1.7"]]
:clean-targets ["ext/js/generated"]
:aliases {"build" ["do" "clean" ["cljsbuild" "once"]]}
:cljsbuild
{:builds
{:main
{:source-paths ["src"]
:compiler {:optimizations :simple
:pretty-print true
:source-map true
:output-dir "ext/js/generated/out"
:closure-output-charset "us-ascii"
:modules {:background
{:output-to "ext/js/generated/background.js"
:entries #{"looped-in.background"}}
:content
{:output-to "ext/js/generated/content.js"
:entries #{"looped-in.content"}}
:sidebar
{:output-to "ext/js/generated/sidebar.js"
:entries #{"looped-in.sidebar"}}}}}}}
:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.2"]
[org.clojure/tools.nrepl "0.2.10"]]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}})
:profiles {:cljs-shared
{:cljsbuild
{:builds
{:background
{:source-paths ["src/background" "src/lib"]
:compiler {:output-dir "ext/js/generated/out-background"
:closure-output-charset "us-ascii"
:main looped-in.background
:output-to "ext/js/generated/background.js"}}
:content
{:source-paths ["src/content" "src/lib"]
:compiler {:output-dir "ext/js/generated/out-content"
:closure-output-charset "us-ascii"
:main looped-in.content
:output-to "ext/js/generated/content.js"}}
:sidebar
{:source-paths ["src/sidebar" "src/lib"]
:compiler {:output-dir "ext/js/generated/out-sidebar"
:closure-output-charset "us-ascii"
:main looped-in.sidebar
:output-to "ext/js/generated/sidebar.js"}}}}}
:dev [:cljs-shared
{:cljsbuild
{:builds
{:background
{:compiler {:optimizations :whitespace
:pretty-print true
:source-map "ext/js/generated/background.js.map"}}
:content
{:compiler {:optimizations :whitespace
:pretty-print true
:source-map "ext/js/generated/content.js.map"}}
:sidebar
{:compiler {:optimizations :whitespace
:pretty-print true
:source-map "ext/js/generated/sidebar.js.map"}}}}}
{:dependencies [[com.cemerick/piggieback "0.2.2"]
[org.clojure/tools.nrepl "0.2.10"]]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}}]
:prod [:cljs-shared
{:cljbuilds
{:builds
{:background
{:compiler {:optimizations :simple
:pretty-print false
:source-map false}}
:content
{:compiler {:optimizations :simple
:pretty-print false
:source-map false}}
:sidebar
{:compiler {:optimizations :simple
:pretty-print false
:source-map false}}}}}]})