forked from vctfence/scrapbee
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
makefile
81 lines (66 loc) · 2.82 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
# uses git shell
test:
cd addon; cmd //c start web-ext run -p "${FIREFOX_PROFILES}/debug.scrapyard" --keep-profile-changes
test-nightly:
cd addon; cmd //c start web-ext run -p "${FIREFOX_PROFILES}/debug.scrapyard.nightly" --firefox=nightly --keep-profile-changes
.PHONY: set-version
set-version:
echo $(filter-out $@,$(MAKECMDGOALS)) > ./addon/version.txt
.PHONY: get-version
get-version:
@cat ./addon/version.txt
.PHONY: build
build:
cd addon; python ../scripts/mkmanifest.py manifest.json.mv2 manifest.json `cat version.txt` --public
cd addon; web-ext build -a ../build -i web-ext-artifacts .web-extension-id _metadata version.txt
make firefox-mv2
.PHONY: build-chrome
build-chrome:
make chrome-mv3
rm -f build/scrapyard-chrome-*.zip
7za a build/scrapyard-chrome-`cat ./addon/version.txt`.zip ./addon/* -xr!web-ext-artifacts -xr!.web-extension-id -xr!_metadata -xr!*.mv2* -xr!*.mv3*
sign:
make firefox-mv2
cd addon; web-ext sign -a ../build -i web-ext-artifacts .web-extension-id _metadata version.txt `cat $(HOME)/.amo/creds`
.PHONY: firefox-mv2
firefox-mv2:
cd addon; python ../scripts/mkmanifest.py manifest.json.mv2 manifest.json `cat version.txt`
.PHONY: firefox-mv3
firefox-mv3:
cd addon; python ../scripts/mkmanifest.py manifest.json.mv3 manifest.json `cat version.txt`
.PHONY: chrome-mv3
chrome-mv3:
cd addon; python ../scripts/mkmanifest.py manifest.json.mv3.chrome manifest.json `cat version.txt`
.PHONY: helper-clean
backend-clean:
cd backend; rm -r -f dist
# to create .local/dist
# 1. download embeddable Python zip
# 2. add pip with get-pip.py
# 3. install the scrapyard package specifying the ./backend as the package directory
# 4. delete pip-related packages at Lib/site-packages
.PHONY: backend-win
backend-win:
make backend-clean
cd backend; rm -f *.exe
echo "DEBUG = False" > ./backend/scrapyard/server_debug.py
cp -r ./.local/dist ./backend/
rm -r -f ./backend/dist/Lib/site-packages/scrapyard
cp -r ./backend/scrapyard ./backend/dist/Lib/site-packages/
cd backend; makensis setup.nsi
make backend-clean
echo "DEBUG = True" > ./backend/scrapyard/server_debug.py
.PHONY: backend-cli
backend-cli:
cd backend; cp -r ./scrapyard ./cli-installer/scrapyard_backend/
echo "DEBUG = False" > ./backend/cli-installer/scrapyard_backend/scrapyard/server_debug.py
cd backend; cp -r ./manifests ./cli-installer/scrapyard_backend/
cd backend; rm -r -f ./cli-installer/scrapyard_backend/manifests/debug_manifest*
cd backend; cp -r ./pyproject.toml ./cli-installer/scrapyard_backend/
cd backend; rm -f scrapyard-backend.tgz
cd backend; 7za.exe a -ttar -so -an ./cli-installer/* -xr!__pycache__ | 7za.exe a -si scrapyard-backend.tgz
cd backend; rm ./cli-installer/scrapyard_backend/pyproject.toml
cd backend; rm -r -f ./cli-installer/scrapyard_backend/scrapyard
cd backend; rm -r -f ./cli-installer/scrapyard_backend/manifests
%:
@: