Skip to content

Commit ada176d

Browse files
committed
Use make for building
- `./build` -> `make` - `./build prod` -> `make prod` (but probably just use `make release`) - `./build test` -> `make test` - `./build test_once` -> `make ci` - `./release` -> `make release` - `./selenium.clj` -> `make selenium`
1 parent 48daaa8 commit ada176d

File tree

6 files changed

+47
-25
lines changed

6 files changed

+47
-25
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
*.org
33
*.xpi
44
.nrepl*
5+
jpm-install
6+
node_modules
57
out
68
gitique.js
79
gitique.js.map

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ install:
33
- mkdir phantomjs
44
- wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2
55
- tar -xvf phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C phantomjs
6-
- ./build test_once
7-
script: phantomjs/phantomjs test/runner.js
6+
- export PATH=phantomjs:$PATH
7+
script: make ci

Makefile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CLJS_COMPILER=java -cp cljs.jar:src clojure.main
2+
3+
all: dev
4+
5+
cljs.jar:
6+
wget https://github.com/clojure/clojurescript/releases/download/r1.7.28/cljs.jar
7+
8+
jpm-install:
9+
npm install jpm
10+
touch jpm-install
11+
12+
dev: cljs.jar
13+
$(CLJS_COMPILER) script/dev.clj
14+
15+
test: cljs.jar
16+
$(CLJS_COMPILER) script/test.clj
17+
18+
ci: cljs.jar
19+
$(CLJS_COMPILER) script/test_once.clj
20+
phantomjs test/runner.js
21+
22+
prod: cljs.jar
23+
$(CLJS_COMPILER) script/prod.clj
24+
25+
firefox: prod jpm-install
26+
cd dist/firefox && ../../node_modules/.bin/jpm xpi
27+
28+
chrome: prod
29+
cd dist/chrome && zip -r ../chrome.zip .
30+
31+
release: firefox chrome
32+
33+
selenium: firefox
34+
./selenium.clj

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ included in the Gitique view, but all commits following it will be.)
7373
## Developing
7474

7575
1. Clone this repo.
76-
2. From the root of the cloned repo, run `./build`. This will download the ClojureScript
76+
2. From the root of the cloned repo, run `make`. This will download the ClojureScript
7777
compiler and run it on the source, producing the file `gitique.js`. This script will
7878
watch for changes in the source.
7979
3. This depends on the browser.
@@ -84,20 +84,20 @@ included in the Gitique view, but all commits following it will be.)
8484
[`src/firefox`](src/firefox) do `jpm run` and use the blank profile that generates.
8585
Alternatively, run `jpm xpi` and then choose to install an add-on from a file at
8686
[about:addons](about:addons).
87-
4. To run the unit tests, run `./build test`. This requires
87+
4. To run the unit tests, run `make test`. This requires
8888
[PhantomJS](http://phantomjs.org/) version 2 to be on the path as `phantomjs`. It will
89-
watch the `test` and `src` directories and run the tests on the built output.
90-
5. To run the Webdriver tests, install [boot](http://boot-clj.com/) and run
91-
[`./selenium.clj`](selenium.clj). This will run some basic tests against the
92-
[gitique-examples repo][examples] in Chrome and Firefox. A
93-
[production build](#production-builds) is needed for these, as the generated XPI is
94-
loaded by Firefox for the tests.
89+
watch the `test` and `src` directories and run the tests on the built output. `make ci`
90+
will compile, run the tests, and exit without watching.
91+
5. To run the Webdriver tests, install [boot](http://boot-clj.com/) and run `make
92+
selenium`. This will run some basic tests against the [gitique-examples repo][examples]
93+
in Chrome and Firefox. A [production build](#production-builds) is needed for these, as
94+
the generated XPI is loaded by Firefox for the tests.
9595

9696
### Production builds
9797

9898
1. Update [`dist/chrome/manifest.json`](dist/chrome/manifest.json) and
9999
[`dist/firefox/package.json`](dist/firefox/package.json) for the new version.
100-
2. Run `./release`. This will build using advanced optimizations, then package
100+
2. Run `make release`. This will build using advanced optimizations, then package
101101
`dist/chrome` into `dist/chrome.zip`, and `dist/firefox` into
102102
`dist/firefox/@gitique-$version.xpi`.
103103

build

-5
This file was deleted.

release

-9
This file was deleted.

0 commit comments

Comments
 (0)