forked from yoavst/Graffiti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
102 lines (74 loc) · 3.04 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
# Load version
FILE := version.txt
ifeq ($(wildcard $(FILE)),)
$(error File $(FILE) does not exist)
else
VERSION := $(shell cat $(FILE))
export VERSION
endif
.PHONY: *
all: pre-package web-collect
pre-package: init server backends frontends web
clean:
rm -rf out
init:
mkdir -p out
backends: jeb intellij clion ida vscode opengrok jadx
frontends: web visio
ida:
@echo "Building Graffiti for IDA"
echo "# Graffiti for IDA, Version: $(VERSION)" | cat - backends/ida/graffiti.py > out/graffiti_v$(VERSION)_for_ida.py
jadx:
@echo "Building Graffiti for Jadx"
cp backends/jadx/graffiti.jadx.kts out/graffiti_v$(VERSION).jadx.kts
jeb:
@echo "Building Graffiti for JEB"
# We cannot add the beginning of the files, as JEB parses them.
echo $(VERSION) > .graffiti_version
zip -j out/graffiti_v$(VERSION)_for_jeb.zip backends/jeb/*.py .graffiti_version
rm .graffiti_version
vscode:
@echo "Building Graffiti for VSCode"
@echo "Updating the version in package.json"
cd backends/vscode && npm pkg set version=$(VERSION)
@echo "Compiling the extension"
cd backends/vscode && vsce package
@echo "Moving the file"
mv backends/vscode/graffiti-$(VERSION).vsix out/graffiti_v$(VERSION)_for_vscode.vsix
intellij:
@echo "Building Graffiti for Intellij"
@echo "Updating the version in build.gradle.kts"
sed -i 's/version = "[^"]*"/version = "$(VERSION)"/' backends/intellij/build.gradle.kts
@echo "Compiling the extension"
cd backends/intellij && ./gradlew jar
@echo "Copying the file"
cp backends/intellij/build/libs/intellij-$(VERSION).jar out/graffiti_v$(VERSION)_for_intellij.jar
clion:
@echo "Building Graffiti for CLion"
@echo "Updating the version in build.gradle.kts"
sed -i 's/version = "[^"]*"/version = "$(VERSION)"/' backends/clion/build.gradle.kts
@echo "Compiling the extension"
cd backends/clion && ./gradlew jar
@echo "Copying the file"
cp backends/clion/build/libs/clion-$(VERSION).jar out/graffiti_v$(VERSION)_for_clion.jar
opengrok:
@echo "Building Graffiti for OpenGrok"
@echo "Updating the version in manifest.json"
sed -i 's/"version": "[^"]*",/"version": "$(VERSION)",/' backends/opengrok/manifest.json
@echo "Since chrome dropped support for CRXs not from store, just zipping the folder"
cd backends/opengrok && zip -r ../../out/graffiti_v$(VERSION)_for_opengrok.zip *
web:
@echo "Building Graffiti for Web"
sed -i.bak "s/_VERSION_/$(VERSION)/g" frontends/web/index.html
cd frontends/web; find -L . -type f ! -name '*.bak' ! -path './out/*' -exec zip --symlinks ../../out/graffiti_v$(VERSION)_frontend_web.zip {} +
mv frontends/web/index.html.bak frontends/web/index.html
web-collect:
@echo "Building Graffiti for Web again"
sed -i.bak "s/_VERSION_/$(VERSION)/g" frontends/web/index.html
cd frontends/web; find -L . -type f ! -name '*.bak' -exec zip ../../out/graffiti_v$(VERSION)_frontend_web_with_deps.zip {} +
mv frontends/web/index.html.bak frontends/web/index.html
visio:
@echo "Building visio via makefile is not yet supported"
server:
@echo "Building the graffiti Server"
cp server/main.py out/graffiti_v$(VERSION)_server.py