2013-12-16 22:19:36 +00:00
|
|
|
PORT = 4562
|
|
|
|
|
2014-01-17 15:00:42 +00:00
|
|
|
PROF = dev
|
|
|
|
# PROF = prod,srcmap
|
2013-12-16 22:19:36 +00:00
|
|
|
# PROF = prod
|
|
|
|
|
|
|
|
CLJSBUILD = client
|
|
|
|
CLJSDIRS = src test
|
|
|
|
|
2014-10-28 15:34:26 +00:00
|
|
|
VERSION = 0.4.3
|
2013-12-16 22:19:36 +00:00
|
|
|
|
2014-10-29 13:18:28 +00:00
|
|
|
REACT_VERSION = 0.12.0
|
2014-10-29 10:38:40 +00:00
|
|
|
|
2013-12-16 22:19:36 +00:00
|
|
|
all: buildrun
|
|
|
|
|
|
|
|
run: openbrowser buildrun
|
|
|
|
|
|
|
|
leinbuild: setup
|
2014-01-05 10:16:01 +00:00
|
|
|
lein -o with-profile $(PROF) cljsbuild once $(CLJSBUILD)
|
2013-12-16 22:19:36 +00:00
|
|
|
|
|
|
|
openbrowser:
|
2013-12-17 19:10:03 +00:00
|
|
|
(sleep 1 && open site/test.html) &
|
2013-12-16 22:19:36 +00:00
|
|
|
|
|
|
|
buildrun: setup
|
|
|
|
lein -o with-profile $(PROF) cljsbuild auto $(CLJSBUILD)
|
|
|
|
|
2014-01-17 15:00:42 +00:00
|
|
|
runtest:
|
2014-01-24 10:40:15 +00:00
|
|
|
$(MAKE) run PROF=test,$(PROF)
|
2014-01-17 15:00:42 +00:00
|
|
|
|
2014-01-24 10:03:01 +00:00
|
|
|
runsite: setup
|
2014-01-27 21:30:42 +00:00
|
|
|
(sleep 3 && open "http://127.0.0.1:$(PORT)/$$(basename $$PWD)") &
|
2014-01-24 10:03:01 +00:00
|
|
|
( trap "kill 0" SIGINT SIGTERM EXIT; \
|
2014-01-27 21:30:42 +00:00
|
|
|
( cd .. && python -m SimpleHTTPServer $(PORT) & ); \
|
2014-01-29 10:53:45 +00:00
|
|
|
lein -o with-profile $(PROF),prod cljsbuild auto $(CLJSBUILD) )
|
2014-01-24 10:03:01 +00:00
|
|
|
|
2013-12-18 13:56:38 +00:00
|
|
|
install: leinbuild
|
2013-12-16 22:19:36 +00:00
|
|
|
lein install
|
|
|
|
|
|
|
|
preclean:
|
2013-12-17 18:20:20 +00:00
|
|
|
rm -rf repl .repl target out
|
2014-02-11 16:10:04 +00:00
|
|
|
mkdir -p vendor/reagent
|
2013-12-16 22:19:36 +00:00
|
|
|
|
|
|
|
clean: preclean
|
2014-01-19 11:13:19 +00:00
|
|
|
rm -rf news assets
|
2013-12-16 22:19:36 +00:00
|
|
|
lein -o clean
|
|
|
|
|
2014-10-29 10:38:40 +00:00
|
|
|
setup: preclean
|
2014-01-19 11:13:19 +00:00
|
|
|
mkdir -p news assets
|
2013-12-16 22:19:36 +00:00
|
|
|
|
|
|
|
show-outdated:
|
|
|
|
lein ancient :all
|
|
|
|
|
2014-10-29 10:38:40 +00:00
|
|
|
download-react:
|
|
|
|
curl -L "http://fb.me/react-$(REACT_VERSION).js" \
|
|
|
|
-o vendor/reagent/react.js
|
|
|
|
curl -L "http://fb.me/react-$(REACT_VERSION).min.js" \
|
|
|
|
-o vendor/reagent/react.min.js
|
2013-12-18 13:56:38 +00:00
|
|
|
|
2014-01-05 10:16:01 +00:00
|
|
|
gensite:
|
|
|
|
node bin/gen-site.js
|
|
|
|
|
2014-01-10 10:49:36 +00:00
|
|
|
demobuild:
|
|
|
|
$(MAKE) PROF=prod,demo leinbuild
|
2014-01-05 10:16:01 +00:00
|
|
|
|
2014-01-10 10:49:36 +00:00
|
|
|
buildsite: demobuild gensite
|
2014-01-05 10:16:01 +00:00
|
|
|
|
2013-12-16 22:19:36 +00:00
|
|
|
setversion:
|
2013-12-16 22:22:54 +00:00
|
|
|
version=$(VERSION); \
|
2014-01-26 08:51:36 +00:00
|
|
|
find . -name project.clj -o -name README.md | \
|
2014-01-17 10:12:11 +00:00
|
|
|
xargs -n1 sed -i "" -e 's,\(reagent "\)\([^"]*\)",\1'"$$version"'"',g
|
2013-12-16 22:19:36 +00:00
|
|
|
|
|
|
|
tag: setversion
|
|
|
|
if git rev-parse v$(VERSION) 2>/dev/null; then \
|
|
|
|
echo "Tag already exists"; \
|
|
|
|
exit 1; \
|
|
|
|
else \
|
2014-01-26 08:51:36 +00:00
|
|
|
git commit --allow-empty -a -v -e -m"Version "$(VERSION) && \
|
2013-12-16 22:19:36 +00:00
|
|
|
git tag v$(VERSION); \
|
|
|
|
fi
|