-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathMakefile
141 lines (96 loc) · 3.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
VERSION=unversioned
TOKEN=none
ifeq (, $(shell which go.exe))
go=go
go-bindata=go-bindata-assetfs
else
go=go.exe
go-bindata=go-bindata-assetfs.exe
endif
ifeq ($(filter v%,${VERSION}),${VERSION})
NPMVERSION=$(subst v,,${VERSION})
else
NPMVERSION=0.0.0
endif
all: build test package docs CHANGELOG.md
.PHONY: setup
setup: setup-submodule setup-go setup-npm
.PHONY: setup-go
setup-go:
${go} mod download
${go} get github.com/go-bindata/go-bindata/...
${go} get github.com/elazarl/go-bindata-assetfs/...
.PHONY: setup-npm
setup-npm:
cd vscode-yolol && \
npm install && \
npm install -g vsce
.PHONY: setup-submodule
setup-submodule:
git submodule init
git submodule update
.PHONY: test
test: go-test acid-tests vsc-test
.PHONY: go-test
go-test:
${go} test ./...
.PHONY: acid-tests
acid-tests: yodk
./ci/run-acid-tests.sh
.PHONY: vsc-test
vsc-test: vscode-yolol.vsix
ifdef WSLENV
echo Skipping extension-tests on wsl
else
cd vscode-yolol && npm test --silent
endif
.PHONY: build
build: binaries vscode-yolol.vsix
.PHONY: binaries
binaries: yodk yodk.exe yodk-darwin
yodk: yodk-${VERSION}
cp yodk-${VERSION} yodk
yodk-${VERSION}: $(shell find pkg) $(shell find cmd) stdlib/bindata.go stdlib/generate.go
GOOS=linux ${go} build -o yodk-${VERSION} -ldflags "-X github.com/dbaumgarten/yodk/cmd.YodkVersion=${VERSION}"
yodk.exe: yodk-${VERSION}.exe
-cp yodk-${VERSION}.exe yodk.exe
yodk-${VERSION}.exe: $(shell find pkg) $(shell find cmd) stdlib/bindata.go stdlib/generate.go
GOOS=windows ${go} build -o yodk-${VERSION}.exe -ldflags "-X github.com/dbaumgarten/yodk/cmd.YodkVersion=${VERSION}"
yodk-darwin: yodk-darwin-${VERSION}
cp yodk-darwin-${VERSION} yodk-darwin
yodk-darwin-${VERSION}: $(shell find pkg) $(shell find cmd) stdlib/bindata.go stdlib/generate.go
GOOS=darwin ${go} build -o yodk-darwin-${VERSION} -ldflags "-X github.com/dbaumgarten/yodk/cmd.YodkVersion=${VERSION}"
.PHONY: stdlib
stdlib:
cd stdlib && ${go-bindata} -pkg stdlib -prefix src/ ./src
.PHONY: package
package: zips vscode-yolol.vsix
.PHONY: zips
zips: yodk-win.zip yodk-linux.zip yodk-darwin.zip
yodk-win.zip: yodk.exe
zip yodk-win.zip yodk.exe
yodk-linux.zip: yodk
zip yodk-linux.zip yodk
yodk-darwin.zip: yodk-darwin
zip yodk-darwin.zip yodk-darwin
vscode-yolol.vsix: vscode-yolol/vscode-yolol-${NPMVERSION}.vsix
cp vscode-yolol/vscode-yolol-${NPMVERSION}.vsix vscode-yolol.vsix
vscode-yolol/vscode-yolol-${NPMVERSION}.vsix: yodk yodk.exe yodk-darwin CHANGELOG.md $(shell find vscode-yolol/src) $(shell find vscode-yolol/syntaxes/) vscode-yolol/package.json
cd vscode-yolol && \
origtime=`stat -c %Y package.json` && \
npm version --no-git-tag-version ${NPMVERSION} --allow-same-version && \
vsce package && \
npm version 0.0.0 --allow-same-version && \
touch -m -d @$${origtime} package.json
CHANGELOG.md: .git/
./ci/build-changelog.sh
cp CHANGELOG.md vscode-yolol/
.PHONY: docs
docs: yodk yodk.exe
./ci/build-docs.sh
publish-vsix: vscode-yolol.vsix
vsce publish --packagePath vscode-yolol.vsix -p ${TOKEN}
.PHONY: clean
clean:
-rm -rf yodk* *.zip *.vsix CHANGELOG.md vscode-yolol/*.vsix vscode-yolol/CHANGELOG.md vscode-yolol/bin/win32/yo* vscode-yolol/bin/linux/yo* vscode-yolol/bin/darwin/yo* acid_test.yaml
-rm -rf docs/sitemap_new.xml docs/generated/* docs/vscode-yolol.md docs/README.md docs/nolol-stdlib.md