Skip to content

Commit a31fc3f

Browse files
committed
Merge pull request #139 from athenalabs/makefile
new build sys.
2 parents 29ca248 + 0e38c2e commit a31fc3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+286
-538
lines changed

.gitmodules

Lines changed: 0 additions & 3 deletions
This file was deleted.

Gruntfile.coffee

Lines changed: 0 additions & 205 deletions
This file was deleted.

Makefile

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
2+
JS = build/acorn.player.js
3+
4+
CSS = build/acorn.player.css
5+
6+
JS_SRC = $(shell find coffee | grep .coffee | sed 's/coffee\//build\/js-compiled\//g' | sed 's/\.coffee/\.js/g' )
7+
8+
9+
all: build
10+
11+
.PHONY: clean test watch
12+
13+
test:
14+
# probably broken?
15+
@npm test
16+
17+
clean:
18+
rm -rf -- build
19+
20+
21+
# css
22+
build/acorn.player.css: less/acorn-player.less
23+
@mkdir -p `dirname $@`
24+
@rm -f $@
25+
node_modules/.bin/lessc $< $@
26+
27+
build/acorn.player.min.css: build/acorn.player.css
28+
@mkdir -p `dirname $@`
29+
@rm -f $@
30+
cat $< | node_modules/.bin/cssmin > $@
31+
32+
33+
# coffee
34+
build/js-compiled/%.js: coffee/%.coffee
35+
@mkdir -p `dirname $@`
36+
@rm -f $@
37+
node_modules/.bin/coffee -b -p -c $< > $@
38+
39+
40+
# js
41+
build/acorn.player.js: $(JS_SRC) package.json
42+
#: $(shell node_modules/.bin/smash --list build/js-compiled/src/)
43+
# use JS_SRC here because the index.js (for smash --list) is an intermediate
44+
# file, which gets constructed.
45+
@mkdir -p `dirname $@`
46+
@rm -f $@
47+
node_modules/.bin/smash build/js-compiled/src/ | node_modules/.bin/uglifyjs - -b indent-level=2 -o $@
48+
49+
50+
# minification
51+
build/%.min.js: build/%.js
52+
@mkdir -p `dirname $@`
53+
@rm -f $@
54+
node_modules/.bin/uglifyjs $< > $@
55+
56+
57+
# build
58+
build: build/acorn.player.min.js build/acorn.player.min.css
59+
60+
61+
# dist
62+
dist: build
63+
cp -r $< $@
64+
65+
66+
# serve
67+
serve:
68+
@echo "Serving static files..."
69+
@node_modules/.bin/http-server -p 8000
70+
71+
# watching
72+
watch:
73+
@echo "Serving static files..."
74+
@node_modules/.bin/http-server -p 8000 &
75+
@echo "Watching files for changes..."
76+
@watchr -e "watch('(less|coffee|lib)\/.*\.(less|coffee|css)') { system 'make' }"
77+

coffee/src/acorn.coffee

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@
66
# For all details and documentation:
77
# http://github.com/athenalabs/acorn-player
88

9-
goog.provide 'acorn'
10-
11-
goog.require 'acorn.Model'
12-
13-
14-
acorn_ = (data) ->
9+
acorn = (data) ->
1510
acorn.Model.withData data
1611

17-
# patch the global `acorn` object as this function
18-
_.extend acorn_, acorn
19-
acorn = acorn_
12+
acorn.shells = {}
13+
acorn.player = {}
14+
acorn.player.controls = {}

coffee/src/config.coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
if typeof acorn is 'undefined'
22
acorn = {}
33

4-
goog.provide 'acorn.config'
5-
6-
_.extend acorn.config,
4+
acorn.config =
75
version: '0.0.0'
86
url:
97
base: 'https://acorn.athena.ai'

coffee/src/errors.coffee

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
goog.provide 'acorn.errors'
2-
31

2+
acorn.errors = {}
43

54
APIError = acorn.errors.APIError = (description) ->
65
throw new Error "Acorn API Error: #{description}"

coffee/src/index.coffee

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
`(function(){`
2+
3+
`import "acorn"`
4+
`import "errors"`
5+
`import "config"`
6+
`import "util/"`
7+
`import "media"`
8+
`import "model"`
9+
`import "player"`
10+
`import "shells/"`
11+
`import "views/"`
12+
13+
acorn.previousAcorn = @acorn
14+
@acorn = acorn
15+
16+
`}).call(this.exports || this)`

coffee/src/main.coffee

Lines changed: 0 additions & 36 deletions
This file was deleted.

coffee/src/media.coffee

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
goog.provide 'acorn.MediaInterface'
21

32

43
###

coffee/src/model.coffee

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
goog.provide 'acorn.Model'
2-
3-
goog.require 'acorn.util'
1+
`import "util/"`
42

53

64

0 commit comments

Comments
 (0)