-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (59 loc) · 1.67 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
PROJECT_ROOT ?= $(shell git rev-parse --show-toplevel)
include ${PROJECT_ROOT}/.makefiles/Makefile
#
# variables
#
CI ?=
CI_PULL_REQUEST ?=
CIRCLE_BRANCH ?=
CIRCLE_TAG ?=
ExtensionId ?= BoostSecurityScan
DEV_EXTENSION ?= BoostSecurityScanDev
DEV_UUID := 7c8bbeb5-90f9-4abe-98f9-a5c4b028222b
SRCDIR ?= source
DSTDIR ?= ${ExtensionId}
build: ## build release package
build: .phony clean
mkdir -p ${DSTDIR}
pushd ${SRCDIR} > /dev/null && npx tsc
mkdir -p ${DSTDIR}/dist
cp -r ${SRCDIR}/dist/src ${DSTDIR}/dist/
cp -r ${SRCDIR}/task.json ${DSTDIR}/
cp -r ${SRCDIR}/package* ${DSTDIR}/
pushd ${DSTDIR} > /dev/null && npm install --omit=dev
ifeq (${DSTDIR},${DEV_EXTENSION})
make patch.dev
endif
build.dev: ## build dev release package
build.dev: DSTDIR=BoostSecurityScanDev
build.dev: build
patch.dev: ## patch dev release package
patch.dev:
cat source/task.json | \
jq --arg id "$(DEV_UUID)" --arg name "$(DSTDIR)" \
'. | .id = $$id | .name = $$name' \
> $(DSTDIR)/task.json
package.dev: ## package dev release
package.dev:
npx tfx-cli extension create --manifest-globs vss-extension.dev.json --rev-version
package.prod: ## package prod release
package.prod:
npx tfx-cli extension create --manifest-globs vss-extension.json --rev-version
test: ## run tests
test:
pushd ${SRCDIR} > /dev/null && npm run test
test.ci: ## run tests in ci
test.ci:
pushd ${SRCDIR} > /dev/null && npm run test-ci
clean: ## clean dist
clean: .phony
rm -rf ${SRCDIR}/dist
rm -rf ${DSTDIR}
rm -rf ${DSTDIR}Dev
rm -rf tmp
rm -rf *.vsix
unpack: ## unpack package
unpack: clean
mkdir -p tmp
mv BoostSecurity.BoostSecurityScan-*.vsix tmp/data.zip
cd tmp && unzip data.zip