Change examples directory names to "examples"

This commit is contained in:
Éric Lemoine
2012-09-28 14:01:51 +02:00
parent 310d5bfeaa
commit 896f5203db
12 changed files with 16 additions and 16 deletions

4
.gitignore vendored
View File

@@ -6,5 +6,5 @@
/build/ol-all.js
/build/proj4js-combined.js
/build/require-all.js
/demos/*.json
/demos/*.combined.js
/examples/*.json
/examples/*.combined.js

View File

@@ -3,13 +3,13 @@ PHANTOMJS = phantomjs
PLOVR_JAR = bin/plovr-b254c26318c5.jar
SPEC = $(shell find test/spec -name \*.js)
SRC = $(shell find exports externs src/ol -name \*.js)
EXAMPLES = $(shell find demos -maxdepth 1 -name \*.html)
EXAMPLES = $(shell find examples -maxdepth 1 -name \*.html)
comma := ,
empty :=
space := $(empty) $(empty)
.PHONY: all
all: build-all build demos
all: build-all build examples
.PHONY: precommit
precommit: lint build-all doc test build
@@ -31,26 +31,26 @@ build/ol-all.js: $(PLOVR_JAR) $(SRC) base.json build/ol-all.json build/require-a
build/require-all.js: $(SRC)
( echo "goog.require('goog.dom');" ; find src/ol -name \*.js | xargs grep -rh ^goog.provide | sort | uniq | sed -e 's/provide/require/g' ) >$@
.PHONY: demos
demos: $(subst .html,.json,$(EXAMPLES))
.PHONY: examples
examples: $(subst .html,.json,$(EXAMPLES))
demos/%.json: base.json
examples/%.json: base.json
@echo "{\"id\": \"$(basename $(notdir $@))\", \"inherits\": \"../base.json\", \"inputs\": \"$(subst .json,.js,$@)\"}" > $@
demos/%.combined.js: $(PLOVR_JAR) base.json demos/%.js
examples/%.combined.js: $(PLOVR_JAR) base.json examples/%.js
java -jar $(PLOVR_JAR) build $(subst .combined.js,.json,$@) >$@
@echo $@ "uncompressed:" $$(wc -c <$@) bytes
@echo $@ " compressed:" $$(gzip -9 -c <$@ | wc -c) bytes
.PHONY: serve
serve: $(PLOVR_JAR) build/require-all.js demos
java -jar $(PLOVR_JAR) serve build/*.json demos/*.json
serve: $(PLOVR_JAR) build/require-all.js examples
java -jar $(PLOVR_JAR) serve build/*.json examples/*.json
.PHONY: lint
lint: build/lint-src-timestamp build/lint-spec-timestamp
build/lint-src-timestamp: $(SRC)
gjslint --strict --limited_doc_files=$(subst $(space),$(comma),$(shell find externs -name \*.js)) $(SRC) $(filter-out $(shell find demos -name \*.combined.js),$(shell find demos -name \*.js)) && touch $@
gjslint --strict --limited_doc_files=$(subst $(space),$(comma),$(shell find externs -name \*.js)) $(SRC) $(filter-out $(shell find examples -name \*.combined.js),$(shell find examples -name \*.js)) && touch $@
build/lint-spec-timestamp: $(SPEC)
gjslint $(SPEC) && touch $@
@@ -80,8 +80,8 @@ clean:
rm -f build/ol.js
rm -f build/ol-all.js
rm -f build/require-all.js
rm -f demos/*.json
rm -f demos/*.combined.js
rm -f examples/*.json
rm -f examples/*.combined.js
rm -rf build/apidoc
reallyclean: clean

View File

@@ -10,7 +10,7 @@ Run make:
## Run the examples
Run make (as above), then explore the `demos/` directory with your web browser.
Run make (as above), then explore the `examples/` directory with your web browser.
## Run the examples in debug mode
@@ -22,9 +22,9 @@ Then, start a simple webserver, for example:
$ python -mSimpleHTTPServer
Explore the `demos/` directory through this server, for example <http://localhost:8000/demos/side-by-side/debug.html>. You can turn off compilation by appending `?mode=RAW` to the URL, for example <http://localhost:8000/demos/side-by-side/debug.html?mode=RAW>.
Explore the `examples/` directory through this server, for example <http://localhost:8000/examples/side-by-side/debug.html>. You can turn off compilation by appending `?mode=RAW` to the URL, for example <http://localhost:8000/examples/side-by-side/debug.html?mode=RAW>.
Note that appending `?mode=RAW` doesn't work with `file://` URLs, which is why you need to access the `demos/` directory though a web server.
Note that appending `?mode=RAW` doesn't work with `file://` URLs, which is why you need to access the `examples/` directory though a web server.
## Run tests