-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
160 lines (132 loc) · 5.36 KB
/
Makefile
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
.PHONY: test remotes jslib qunit get_phantomjs get_jshint jshint jstest pytest dist release deploy pypi dev clean purge tagv
wrap_jslib = { \
echo "/***" && echo $(2) && echo "***/" && \
echo "//{{{" && \
curl --location -f -s $(2) && \
echo "//}}}"; \
} > $(1)
download = \
curl --location -f --output $(1) --time-cond $(1) --remote-time $(2)
pytest:
py.test -x test
tagv: version = $(shell python -c 'import mangler; \
import tiddlywebplugins.tiddlyspace; \
print "v" + tiddlywebplugins.tiddlyspace.__version__')
tagv:
git tag -a -m $(version) $(version) && \
git push origin master --tags
test: pytest jstest
tiddlywiki:
mkdir tiddlywebplugins/tiddlyspace/resources || true
$(call download, "tiddlywebplugins/tiddlyspace/resources/beta.html", \
"http://classic.tiddlywiki.com/beta/empty.html")
$(call download, "tiddlywebplugins/tiddlyspace/resources/external_beta.html", \
"http://classic.tiddlywiki.com/beta/tiddlywiki_externaljs_tiddlyspace.html")
$(call download, "src/externals/beta_jquery.js.js", \
"http://classic.tiddlywiki.com/beta/jquery.js")
$(call download, "src/externals/beta_jQuery.twStylesheet.js.js", \
"http://classic.tiddlywiki.com/beta/jQuery.twStylesheet.js")
$(call download, "src/externals/beta_twcore.js.js", \
"http://classic.tiddlywiki.com/beta/twcore.js")
$(call download, "tiddlywebplugins/tiddlyspace/resources/external.html.wrongbag", \
"http://classic.tiddlywiki.com/tiddlywiki_externaljs_tiddlyspace.html")
$(call download, "src/externals/jQuery.twStylesheet.js.js", \
"http://classic.tiddlywiki.com/jQuery.twStylesheet.js")
$(call download, "src/externals/twcore.js.js", \
"http://classic.tiddlywiki.com/twcore.js")
$(call download, "src/externals/twjquery.js.js", \
"http://classic.tiddlywiki.com/jquery.js")
# Fix up path to jquery to avoid collision with main hosted
# jquery.
sed -e 's|/bags/common/tiddlers/jquery.js|/bags/common/tiddlers/twjquery.js|;' < \
tiddlywebplugins/tiddlyspace/resources/external.html.wrongbag > \
tiddlywebplugins/tiddlyspace/resources/external.html && \
rm tiddlywebplugins/tiddlyspace/resources/external.html.wrongbag
remotes: tiddlywiki jslib csslib
twibuilder tiddlywebplugins.tiddlyspace
jslib: qunit remotejs
csslib:
$(call download, "src/lib/normalize.css", \
"https://raw.github.com/necolas/normalize.css/master/normalize.css")
remotejs:
$(call wrap_jslib, "src/lib/chrjs.js", \
"https://raw.github.com/tiddlyweb/chrjs/master/main.js")
$(call wrap_jslib, "src/lib/chrjs.users.js", \
"https://raw.github.com/tiddlyweb/chrjs/master/users.js")
$(call wrap_jslib, "src/lib/jquery.js.js", \
"http://code.jquery.com/jquery.min.js")
$(call wrap_jslib, "src/lib/ts.js.js", \
"https://raw.github.com/TiddlySpace/ts.js/master/src/ts.js")
$(call wrap_jslib, "src/lib/chrjs-store.js.js", \
"https://raw.github.com/bengillies/chrjs.store/master/dist/chrjs-store-latest.js")
$(call wrap_jslib, "src/lib/bookmark_bubble.js.js", \
"http://mobile-bookmark-bubble.googlecode.com/hg/bookmark_bubble.js")
$(call wrap_jslib, "src/lib/jquery-json.js.js", \
"http://jquery-json.googlecode.com/files/jquery.json-2.3.min.js")
$(call wrap_jslib, "src/lib/jquery-form.js.js", \
"http://malsup.github.io/jquery.form.js")
$(call wrap_jslib, "src/lib/jquery.timeago.js.js", \
"http://timeago.yarp.com/jquery.timeago.js")
$(call wrap_jslib, "src/lib/html5.js.js", \
"http://html5shiv.googlecode.com/svn/trunk/html5.js")
qunit:
mkdir -p src/test/qunit
mkdir -p src/test/lib
cp src/lib/json2.js.js src/test/lib/json2.js
$(call download, "src/test/qunit/qunit.js", \
"http://code.jquery.com/qunit/qunit-1.12.0.js")
$(call download, "src/test/qunit/qunit.css", \
"http://code.jquery.com/qunit/qunit-1.12.0.css")
$(call download, "src/test/lib/jquery.js", \
"http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js")
$(call download, "src/test/lib/jquery-json.js", \
"http://jquery-json.googlecode.com/files/jquery.json-2.2.js")
$(call download, "src/test/lib/jquery.mockjax.js", \
"https://raw.github.com/appendto/jquery-mockjax/master/jquery.mockjax.js")
$(call download, "src/test/run-qunit.js", \
"https://raw.github.com/ariya/phantomjs/1.6/examples/run-qunit.js")
get_phantomjs:
npm install -g phantomjs
jstest:
phantomjs src/test/run-qunit.js src/test/index.html
get_jshint:
npm install -g jshint
jshint:
jshint src/**/*.js
saucelabs_deps:
npm install -g grunt-cli
npm install
saucelabs_test:
grunt test
jstest_browser:
grunt dev
dist: clean remotes test
python setup.py sdist
release: tagv dist pypi
deploy: release
@echo "Go to tiddlyspace.com to run tsupdate."
pypi: test
python setup.py sdist upload
dev: remotes dev_local
dev_local:
@mysqladmin -f drop tiddlyspace || true
@mysqladmin create tiddlyspace
@PYTHONPATH="." ./tiddlyspace dev_instance
( cd dev_instance && \
ln -s ../devconfig.py && \
ln -s ../mangler.py && \
ln -s ../tiddlywebplugins && \
ln -s ../tiddlywebplugins/templates )
@echo "from devconfig import update_config; update_config(config)" \
>> dev_instance/tiddlywebconfig.py
@echo "INFO development instance created in dev_instance"
clean:
find . -name "*.pyc" | xargs rm || true
rm -rf dist || true
rm -rf build || true
rm -rf *.egg-info || true
rm -rf tiddlywebplugins/tiddlyspace/resources || true
rm -f src/externals/*js || true
rm -r test_instance || true
purge: clean
cat .gitignore | while read -r entry; do rm -r $$entry; done || true