Skip to content

Commit fdf979f

Browse files
authored
Add Makefile to replicate CI (#146)
1 parent bc21038 commit fdf979f

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
index.html
2+
node_modules/
23
.DS_Store
34
.idea/
5+

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
SHELL := /bin/bash
2+
3+
DST := $(patsubst %.bs,%.html,$(wildcard *.bs))
4+
REMOTE := $(filter remote,$(MAKECMDGOALS))
5+
6+
all: $(DST)
7+
@ echo "All done"
8+
9+
%.html : %.bs node_modules/vnu-jar/build/dist/vnu.jar
10+
ifndef REMOTE
11+
@ echo "Building $@"
12+
bikeshed --die-on=warning spec $< $@
13+
java -jar node_modules/vnu-jar/build/dist/vnu.jar --also-check-css $@
14+
else
15+
@ echo "Building $@ remotely"
16+
@ (HTTP_STATUS=$$(curl https://api.csswg.org/bikeshed/ \
17+
--output $@ \
18+
--write-out "%{http_code}" \
19+
--header "Accept: text/plain, text/html" \
20+
-F die-on=warning \
21+
-F file=@$<) && \
22+
[[ "$$HTTP_STATUS" -eq "200" ]]) || ( \
23+
echo ""; cat $@; echo ""; \
24+
rm -f index.html; \
25+
exit 22 \
26+
);
27+
endif
28+
29+
node_modules/vnu-jar/build/dist/vnu.jar:
30+
npm install vnu-jar
31+
32+
remote: all
33+

package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "web-speech-api",
3+
"version": "1.0.0",
4+
"description": "This is the source for the [Web Speech API](https://webaudio.github.io/web-speech-api/) spec.",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/WebAudio/web-speech-api.git"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/WebAudio/web-speech-api/issues"
15+
},
16+
"homepage": "https://github.com/WebAudio/web-speech-api#readme",
17+
"devDependencies": {
18+
"vnu-jar": "^24.10.17"
19+
}
20+
}

0 commit comments

Comments
 (0)