-
Notifications
You must be signed in to change notification settings - Fork 38
/
Makefile
76 lines (59 loc) · 2.91 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
## help - Display help about make targets for this Makefile
help:
@cat Makefile | grep '^## ' --color=never | cut -c4- | sed -e "`printf 's/ - /\t- /;'`" | column -s "`printf '\t'`" -t
## build - Builds the project for development
build:
mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true
## clean - Cleans the project
clean:
mvn clean
## coverage - Test (and build) the project to generate a coverage report
coverage:
mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report
## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first)
checkstyle:
java -jar checkstyle.jar src -c examples/style_guides/java/easypost_java_style.xml -d
## docs - Generates library documentation
docs:
mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true
cp -R target/apidocs/ ./docs/
## install-checkstyle - Install the Checkstyle tool (Unix only)
install-checkstyle: | install-styleguide
curl -LJs https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.1/checkstyle-10.3.1-all.jar -o checkstyle.jar
## install-styleguide - Install style guides
install-styleguide: | init-examples-submodule
sh examples/symlink_directory_files.sh examples/style_guides/java .
## init-examples-submodule - Initialize the examples submodule
init-examples-submodule:
git submodule init
git submodule update
## install - Install requirements
install: | install-checkstyle
## lint - Lints the project
lint: checkstyle scan
## publish - Publish a release of the project (will build the project via the `mvn deploy` command)
# @parameters:
# pass= - The GPG password to sign the release
publish:
mvn clean deploy -Dgpg.passphrase=${pass}
## publish-dry - Build the project as a dry run to publishing (will build the project via the `mvn install` command)
# @parameters:
# pass= - The GPG password to sign the release
publish-dry:
mvn clean install -Dgpg.passphrase=${pass}
## release - Cuts a release for the project on GitHub (requires GitHub CLI)
# tag = The associated tag title of the release
# target = Target branch or full commit SHA
release:
gh release create ${tag} target/*.jar target/*.asc target/*.pom --target ${target}
## scan - Scan the project for serious security issues
scan:
mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0
## test - Test the project
test:
mvn surefire:test
## update-examples-submodule - Update the examples submodule
update-examples-submodule:
git submodule init
git submodule update --remote
.PHONY: help build clean coverage docs install-checkstyle install-styleguide install lint publish publish-dry release scan scan-strict test update-examples-submodule