forked from kklisura/chrome-devtools-java-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (57 loc) · 2.65 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
MVN=mvn
RM=rm
JAVA=java
CP=cp
RUN_JAR=$(JAVA) -jar
PROTOCOL_PARSER_DIR=cdt-protocol-parser
JAVA_PROTOCOL_BUILDER_DIR=cdt-java-protocol-builder
JAVA_PROTOCOL_BUILDER_JAR="$(JAVA_PROTOCOL_BUILDER_DIR)/target/cdt-java-protocol-builder.jar"
PROTOCOL_PARSER=cdt-protocol-parser
JAVA_CLIENT_DIR=cdt-java-client
JAVA_CLIENT_PACKAGE=com/github/kklisura/cdt/protocol
PACKAGE_NAME=com.github.kklisura.cdt.protocol
JS_PROTOCOL_JSON_FILE=./js_protocol.json
BROWSER_PROTOCOL_JSON_FILE=./browser_protocol.json
EXAMPLES_DIR=cdt-examples
install-cdt-java-protocol-parser:
# Building and install cdt-protocol-parser project...
$(CP) $(JS_PROTOCOL_JSON_FILE) "./$(PROTOCOL_PARSER)/src/test/resources/js_protocol.json"
$(CP) $(BROWSER_PROTOCOL_JSON_FILE) "./$(PROTOCOL_PARSER)/src/test/resources/browser_protocol.json"
$(MVN) --file "$(PROTOCOL_PARSER_DIR)/" clean install
build-cdt-java-protocol-builder: install-cdt-java-protocol-parser
# Building cdt-java-protocol-builder project...
$(MVN) --file "$(JAVA_PROTOCOL_BUILDER_DIR)/" clean package
compile-cdt-java-client:
# Compiling cdt-java-client project...
$(MVN) --file "$(JAVA_CLIENT_DIR)/" clean compile
clean-cdt-java-protocol-builder:
# Cleaning cdt-java-protocol-builder project...
$(MVN) --file "$(JAVA_PROTOCOL_BUILDER_DIR)/" clean
clean-cdt-java-client:
# Cleaning cdt-java-client project...
$(MVN) --file "$(JAVA_CLIENT_DIR)/" clean
clean-previous-protocol:
# Cleaning previous protocol...
$(RM) -rf $(JAVA_CLIENT_DIR)/src/main/java/$(JAVA_CLIENT_PACKAGE)/types
$(RM) -rf $(JAVA_CLIENT_DIR)/src/main/java/$(JAVA_CLIENT_PACKAGE)/events
$(RM) -rf $(JAVA_CLIENT_DIR)/src/main/java/$(JAVA_CLIENT_PACKAGE)/commands
upgrade-protocol: build-cdt-java-protocol-builder clean-previous-protocol
$(RUN_JAR) $(JAVA_PROTOCOL_BUILDER_JAR) --base-package="$(PACKAGE_NAME)" \
--output=./$(JAVA_CLIENT_DIR)/ \
--js-protocol=$(JS_PROTOCOL_JSON_FILE) \
--browser-protocol=$(BROWSER_PROTOCOL_JSON_FILE) \
update-protocol: upgrade-protocol compile-cdt-java-client
# Updated protocol on cdt-java-client
sonar-analysis:
# Running sonar analysis
cd $(JAVA_PROTOCOL_BUILDER_DIR)/ && make sonar-analysis
cd $(JAVA_CLIENT_DIR)/ && make sonar-analysis
verify:
# Running unit tests
cd $(JAVA_PROTOCOL_BUILDER_DIR)/ && make verify
cd $(JAVA_CLIENT_DIR)/ && make verify
$(MVN) --file "$(JAVA_CLIENT_DIR)/" clean install && \
$(MVN) --file "$(EXAMPLES_DIR)/" clean compile
download-latest-protocol:
curl -o browser_protocol.json https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/master/json/browser_protocol.json
curl -o js_protocol.json https://raw.githubusercontent.com/ChromeDevTools/devtools-protocol/master/json/js_protocol.json