Skip to content

Commit 7ab57a5

Browse files
committed
chore: add style lint and format task
Add style lint to release and debug's dependency. Refactor the Makefile for style tasks.
1 parent b12dddb commit 7ab57a5

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

Makefile

+21-8
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,40 @@ mainDir=app/src/main
22
resDir=$(mainDir)/res
33
jniDir=$(mainDir)/jni
44

5-
.PHONY: all clean build debug spotless release install opencc-data translate ndk android
5+
.PHONY: all clean build debug spotlessCheck spotlessApply clang-format-lint clang-format style-lint style-apply release install opencc-data translate ndk android
66

77
all: release
88

99
clean:
1010
rm -rf build app/build app/.cxx/
1111
./gradlew clean
1212

13-
build:
13+
build: style-lint
1414
./gradlew build
1515

16-
TRANSLATE=$(resDir)/values-zh-rCN/strings.xml
17-
release: opencc-data spotless
18-
./gradlew assembleRelease
19-
20-
spotless:
16+
spotlessCheck:
2117
./gradlew spotlessCheck
2218

23-
debug:
19+
spotlessApply:
20+
./gradlew spotlessApply
21+
22+
clang-format-lint:
23+
./script/clang-format.sh -n
24+
25+
clang-format:
26+
./script/clang-format.sh -i
27+
28+
style-lint: spotlessCheck clang-format-lint
29+
30+
style-apply: spotlessApply clang-format
31+
32+
debug: style-lint
2433
./gradlew assembleDebug
2534

35+
TRANSLATE=$(resDir)/values-zh-rCN/strings.xml
36+
release: opencc-data style-lint
37+
./gradlew assembleRelease
38+
2639
install: release
2740
./gradlew installRelease
2841

0 commit comments

Comments
 (0)