UNPKG

3.66 kBPlain TextView Raw
1# CodeGradXlib
2
3work : lint tests
4clean :
5 -rm *~
6 -rm README.log README.tex
7
8# ############## Working rules:
9
10lint :
11 eslint codegradxlib.js
12
13nsp+snyk :
14 npm link nsp
15 node_modules/.bin/nsp check
16# npm link snyk
17# -node_modules/.bin/snyk test codegradxlib
18
19tests : lint test.with.real.servers test.with.vmauthor
20
21test.with.real.servers :
22 jasmine spec/[0-8]*.js 2>&1 | tee /tmp/spec.log
23
24test.with.vmauthor : spec/org.example.fw4ex.grading.check.tgz spec/oefgc.tgz
25 @echo " tests require a running vmauthor..."
26 ping -c 3 xvmauthor.codegradx.org
27 export NODE_TLS_REJECT_UNAUTHORIZED=0 ;\
28 jasmine spec/9*.js 2>&1 | tee -a /tmp/spec.log
29 @echo "*** Report with less /tmp/spec.log"
30
31test.batch.with.real.servers : spec/org.example.fw4ex.grading.check.tgz
32test.batch.with.real.servers : spec/oefgc.tgz
33 jasmine spec/8*.js 2>&1 | tee /tmp/spec.log
34
35spec/org.example.fw4ex.grading.check.tgz : spec/fw4ex.xml
36 cd spec/ && tar czf org.example.fw4ex.grading.check.tgz ./fw4ex.xml
37
38spec/oefgc.tgz : Makefile spec/oefgc/fw4ex.xml
39 cd spec/oefgc/ && for d in 1 2 3 4 5 6 7 8 9 ; do \
40 mkdir -p $$d && echo "$${d}0" > $$d/mark.txt ;\
41 tar czf $$d.tgz -C $$d mark.txt ; \
42 done
43 cd spec/oefgc/ && tar czf ../oefgc.tgz fw4ex.xml [0-9]*.tgz
44 tar tzf spec/oefgc.tgz
45
46# ############## NPM package
47# Caution: npm takes the whole directory that is . and not the sole
48# content of CodeGradXlib.tgz
49
50publish : lint bower.json clean
51 git status .
52 -git commit -m "NPM publication `date`" .
53 git push
54 -rm -f CodeGradXlib.tgz
55 m CodeGradXlib.tgz install
56 cd tmp/CodeGradXlib/ && npm version patch && npm publish
57 cp -pf tmp/CodeGradXlib/package.json .
58 rm -rf tmp
59 npm install -g codegradxlib@`jq -r .version < package.json`
60# m propagate
61
62CodeGradXlib.tgz :
63 -rm -rf tmp
64 mkdir -p tmp
65 cd tmp/ && \
66 git clone https://github.com/ChristianQueinnec/CodeGradXlib.git
67 rm -rf tmp/CodeGradXlib/.git
68 cp -p package.json tmp/CodeGradXlib/
69 tar czf CodeGradXlib.tgz -C tmp CodeGradXlib
70 tar tzf CodeGradXlib.tgz
71
72REMOTE = www.paracamplus.com
73install :
74 -rm CodeGradXlib.tgz
75 m CodeGradXlib.tgz
76 rsync -avu CodeGradXlib.tgz \
77 ${REMOTE}:/var/www/www.paracamplus.com/Resources/Javascript/
78
79propagate :
80 npm install -g codegradxlib@`jq -r .version < package.json`
81 cd ../CodeGradXagent ; m update
82 cd ../CodeGradXvmauthor ; m update
83 cd ../CodeGradXenroll ; m update
84 cd ../CodeGradXmarker ; m update
85 cd ../CodeGradXlib4node ; m update
86 cd ../CodeGradXinquiry ; m update
87 cd ../CodeGradXmarker ; npm install -S yasmini
88 cd ../../Servers/np/Paracamplus-*/; m refresh.codegradx
89 cd ../../Servers/w.js/Paracamplus-*/; m refresh.codegradx
90 cd ../../Servers/w.ncc/Paracamplus-*/; m refresh.codegradx
91 cd ../../Servers/w.unx2/Paracamplus-*/; m refresh.codegradx
92 cd ../../Servers/w.njfp/Paracamplus-*/; m refresh.codegradx
93 grep '"codegradxlib":' ../CodeGradX*/package.json
94
95# ############## bower
96
97bower.json : package.json
98 node npm2bower.js
99
100bower.registration :
101 node_modules/.bin/bower register codegradxlib https://github.com/ChristianQueinnec/CodeGradXlib.git
102
103# ############## Various experiments (not all finished)
104
105README.tex : README.md
106 pandoc -o README.tex -f markdown README.md
107README.pdf : README.tex
108 pandoc -o README.pdf -f markdown README.md
109
110doc : doc/index.html
111doc/index.html : codegradxlib.js
112 node_modules/.bin/jsdoc -c conf.json codegradxlib.js
113
114docco :
115 docco codegradxlib.js
116
117browserify :
118 browserify codegradxlib.js -o codegradxlib-bundle.js
119
120uglifyjs :
121 uglifyjs codegradx.js -c "evaluate=false" \
122 -m --source-map codegradx.min.map -o codegradx.min.js
123
124phantomjs :
125 phantomjs test/run-jasmine.js test/jasmine.html
126
127# end of Makefile