1 | # CodeGradXlib
|
2 |
|
3 | work : lint tests
|
4 | clean :
|
5 | -rm *~
|
6 | -rm README.log README.tex
|
7 |
|
8 | # ############## Working rules:
|
9 |
|
10 | lint :
|
11 | eslint codegradxlib.js
|
12 |
|
13 | nsp+snyk :
|
14 | npm link nsp
|
15 | node_modules/.bin/nsp check
|
16 | # npm link snyk
|
17 | # -node_modules/.bin/snyk test codegradxlib
|
18 |
|
19 | tests : lint test.with.real.servers test.with.vmauthor
|
20 |
|
21 | test.with.real.servers :
|
22 | jasmine spec/[0-8]*.js 2>&1 | tee /tmp/spec.log
|
23 |
|
24 | test.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 |
|
31 | test.batch.with.real.servers : spec/org.example.fw4ex.grading.check.tgz
|
32 | test.batch.with.real.servers : spec/oefgc.tgz
|
33 | jasmine spec/8*.js 2>&1 | tee /tmp/spec.log
|
34 |
|
35 | spec/org.example.fw4ex.grading.check.tgz : spec/fw4ex.xml
|
36 | cd spec/ && tar czf org.example.fw4ex.grading.check.tgz ./fw4ex.xml
|
37 |
|
38 | spec/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 |
|
50 | publish : 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 |
|
62 | CodeGradXlib.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 |
|
72 | REMOTE = www.paracamplus.com
|
73 | install :
|
74 | -rm CodeGradXlib.tgz
|
75 | m CodeGradXlib.tgz
|
76 | rsync -avu CodeGradXlib.tgz \
|
77 | ${REMOTE}:/var/www/www.paracamplus.com/Resources/Javascript/
|
78 |
|
79 | propagate :
|
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 |
|
97 | bower.json : package.json
|
98 | node npm2bower.js
|
99 |
|
100 | bower.registration :
|
101 | node_modules/.bin/bower register codegradxlib https://github.com/ChristianQueinnec/CodeGradXlib.git
|
102 |
|
103 | # ############## Various experiments (not all finished)
|
104 |
|
105 | README.tex : README.md
|
106 | pandoc -o README.tex -f markdown README.md
|
107 | README.pdf : README.tex
|
108 | pandoc -o README.pdf -f markdown README.md
|
109 |
|
110 | doc : doc/index.html
|
111 | doc/index.html : codegradxlib.js
|
112 | node_modules/.bin/jsdoc -c conf.json codegradxlib.js
|
113 |
|
114 | docco :
|
115 | docco codegradxlib.js
|
116 |
|
117 | browserify :
|
118 | browserify codegradxlib.js -o codegradxlib-bundle.js
|
119 |
|
120 | uglifyjs :
|
121 | uglifyjs codegradx.js -c "evaluate=false" \
|
122 | -m --source-map codegradx.min.map -o codegradx.min.js
|
123 |
|
124 | phantomjs :
|
125 | phantomjs test/run-jasmine.js test/jasmine.html
|
126 |
|
127 | # end of Makefile
|