|
4 | 4 |
|
5 | 5 | ## build - Builds the project for development
|
6 | 6 | build:
|
7 |
| - mvn clean install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true |
| 7 | + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true -Djacoco.skip=true |
8 | 8 |
|
9 | 9 | ## clean - Cleans the project
|
10 | 10 | clean:
|
11 | 11 | mvn clean
|
12 | 12 |
|
13 |
| -## coverage - Test the project and generate a coverage report |
| 13 | +## coverage - Test (and build) the project to generate a coverage report |
14 | 14 | coverage:
|
15 |
| - mvn --batch-mode install -Dgpg.skip=true -Dcheckstyle.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report |
| 15 | + mvn verify -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djavadoc.skip=true jacoco:report |
16 | 16 |
|
17 |
| -## install-checkstyle - Install CheckStyle |
18 |
| -install-checkstyle: |
| 17 | +## checkstyle - Check if project follows CheckStyle rules (must run install-checkstyle first) |
| 18 | +checkstyle: |
| 19 | + java -jar checkstyle.jar src -c examples/style_guides/java/easypost_java_style.xml -d |
| 20 | + |
| 21 | +## docs - Generates library documentation |
| 22 | +docs: |
| 23 | + mvn install -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Ddependency-check.skip=true -Djacoco.skip=true |
| 24 | + cp -R target/apidocs/ ./docs/ |
| 25 | + |
| 26 | +## install-checkstyle - Install the Checkstyle tool (Unix only) |
| 27 | +install-checkstyle: | install-styleguide |
19 | 28 | curl -LJs https://github.com/checkstyle/checkstyle/releases/download/checkstyle-10.3.1/checkstyle-10.3.1-all.jar -o checkstyle.jar
|
20 |
| - curl -LJs https://raw.githubusercontent.com/EasyPost/easypost-java/master/easypost_java_style.xml -o easypost_java_style.xml |
21 | 29 |
|
22 |
| -## install - Install requirements |
23 |
| -install: | install-checkstyle |
| 30 | +## install-styleguide - Install style guides |
| 31 | +install-styleguide: | init-examples-submodule |
| 32 | + sh examples/symlink_directory_files.sh examples/style_guides/java . |
| 33 | + |
| 34 | +## init-examples-submodule - Initialize the examples submodule |
| 35 | +init-examples-submodule: |
24 | 36 | git submodule init
|
25 | 37 | git submodule update
|
26 | 38 |
|
27 |
| -## lint - Check if project follows CheckStyle rules (must run install-checkstyle first) |
28 |
| -lint: |
29 |
| - java -jar checkstyle.jar src -c easypost_java_style.xml -d |
| 39 | +## install - Install requirements |
| 40 | +install: | install-checkstyle |
| 41 | + |
| 42 | +## lint - Lints the project |
| 43 | +lint: checkstyle scan |
30 | 44 |
|
31 |
| -## publish - Publish a release of the project |
| 45 | +## publish - Publish a release of the project (will build the project via the `mvn deploy` command) |
32 | 46 | # @parameters:
|
33 | 47 | # pass= - The GPG password to sign the release
|
34 | 48 | publish:
|
35 | 49 | mvn clean deploy -Dgpg.passphrase=${pass}
|
36 | 50 |
|
37 |
| -## publish-dry - Build the project as a dry run to publishing |
| 51 | +## publish-dry - Build the project as a dry run to publishing (will build the project via the `mvn install` command) |
38 | 52 | # @parameters:
|
39 | 53 | # pass= - The GPG password to sign the release
|
40 | 54 | publish-dry:
|
41 | 55 | mvn clean install -Dgpg.passphrase=${pass}
|
42 | 56 |
|
43 | 57 | ## release - Cuts a release for the project on GitHub (requires GitHub CLI)
|
44 | 58 | # tag = The associated tag title of the release
|
| 59 | +# target = Target branch or full commit SHA |
45 | 60 | release:
|
46 |
| - gh release create ${tag} target/*.jar target/*.asc target/*.pom |
| 61 | + gh release create ${tag} target/*.jar target/*.asc target/*.pom --target ${target} |
47 | 62 |
|
48 | 63 | ## scan - Scan the project for serious security issues
|
49 | 64 | scan:
|
50 |
| - mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 |
| 65 | + mvn verify -DskipTests=true -Dgpg.skip=true -Dcheckstyle.skip=true -Djavadoc.skip=true -Djacoco.skip=true -Ddependency-check.failBuildOnCVSS=0 -Ddependency-check.junitFailOnCVSS=0 |
51 | 66 |
|
52 | 67 | ## test - Test the project
|
53 | 68 | test:
|
54 | 69 | mvn surefire:test
|
55 | 70 |
|
56 |
| -.PHONY: help build clean coverage install-checkstyle install lint publish publish-dry release scan test |
| 71 | +## update-examples-submodule - Update the examples submodule |
| 72 | +update-examples-submodule: |
| 73 | + git submodule init |
| 74 | + git submodule update --remote |
| 75 | + |
| 76 | +.PHONY: help build clean coverage docs install-checkstyle install-styleguide install lint publish publish-dry release scan scan-strict test update-examples-submodule |
0 commit comments