Skip to content

Commit

Permalink
Simplify gradle commands to increase efficiency (getodk#2530)
Browse files Browse the repository at this point in the history
  • Loading branch information
huangyz0918 authored and grzesiek2010 committed Sep 14, 2018
1 parent ddba5ac commit 90bd6ae
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
# This implies building the release and test flavors as well, which are out of scope for this job.
# Instead, using lintDebug it's running only once, for the 'debug' flavor that we are building here
# This means ~3x faster for the lint task.
command: ./gradlew pmd checkstyle lintDebug spotbugsDebug
command: ./gradlew checkCode
- store_artifacts:
path: collect_app/build/reports
destination: reports
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ https://github.com/opendatakit/collect/blob/master/CONTRIBUTING.md
#### Does this change require updates to documentation? If so, please file an issue [here]( https://github.com/opendatakit/docs/issues/new) and include the link below.

#### Before submitting this PR, please make sure you have:
- [ ] run `./gradlew pmd checkstyle lintDebug spotbugsDebug testDebugUnitTest connectedDebugAndroidTest` and confirmed all checks still pass OR confirm CircleCI build passes and run `./gradlew connectedDebugAndroidTest` locally
- [ ] run `./gradlew checkAll` and confirmed all checks still pass OR confirm CircleCI build passes and run `./gradlew connectedDebugAndroidTest` locally.
- [ ] verified that any code or assets from external sources are properly credited in comments and/or in the [about file](https://github.com/opendatakit/collect/blob/master/collect_app/src/main/assets/open_source_licenses.html).
- [ ] verified that any new UI elements use theme colors. [UI Components Style guidelines](https://github.com/opendatakit/collect/blob/master/CONTRIBUTING.md#ui-components-style-guidelines)
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ To contribute code to ODK Collect, you will need to open a [pull request](https:

1. Keep your pull request focused on one narrow goal. This could mean addressing an issue with multiple, smaller pull requests. Small pull requests are easier to review and less likely to introduce bugs. If you would like to make stylistic changes to the code, create a separate pull request.

1. Run `./gradlew pmd checkstyle lintDebug spotbugsDebug` and fix any errors.
1. Run `./gradlew checkCode` and fix any errors.

1. Write clear code. Use descriptive names and create meaningful abstractions (methods, classes).

Expand Down
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ configurations.all {
transitive = true
}

task checkAll(type: GradleBuild) {
tasks = ['checkCode', 'checkTests']
}

task checkCode(type: GradleBuild) {
tasks = ['pmd', 'checkstyle', 'lintDebug', 'spotbugsDebug']
}

task checkTests(type: GradleBuild) {
tasks = ['testDebugUnitTest', 'connectedDebugAndroidTest']
}

ext {
// Play Services is a big download so it should only be upgraded if necessary and after
// community discussion and a warning period.
Expand Down

0 comments on commit 90bd6ae

Please sign in to comment.