Open btkelly opened 8 years ago
Maybe this is controversial, but: should the gnag
tasks maybe depend on lint
tasks rather than the check
task? It's not obvious to me that we should be coupling static code analysis with running the test suite.
The check
task is also not separable by build variant, whereas the lint
tasks are:
$ ./gradlew app:tasks --all | grep "check"
build - Assembles and tests this project. [assemble, check]
checkApiaryManifest
checkApiaryManifest
checkDebugManifest
checkDebugManifest
checkDebugManifest
checkReleaseManifest
checkReleaseManifest
checkSitManifest
checkSitManifest
check - Runs all checks. [lint, test]
connectedCheck - Runs all device checks on currently connected devices. [connectedAndroidTest]
deviceCheck - Runs all device checks using Device Providers and Test Servers. [deviceAndroidTest]
gnagCheck - Runs Gnag checks and generates an HTML report [check]
gnagReport - Runs Gnag and generates a report to publish to GitHub and set the status of a PR [check, gnagCheck]
checkApiaryManifest
checkDebugManifest
checkReleaseManifest
checkSitManifest
checkApiaryManifest
checkDebugManifest
checkReleaseManifest
checkSitManifest
checkApiaryManifest
checkDebugManifest
checkReleaseManifest
checkSitManifest
$ ./gradlew app:tasks --all | grep "lint"
lintVitalRelease - Runs lint on just the fatal issues in the release build.
check - Runs all checks. [lint, test]
lint - Runs lint on all variants. [:wearable:packageRelease]
lintApiary - Runs lint on the Apiary build.
lintDebug - Runs lint on the Debug build.
lintRelease - Runs lint on the Release build. [:wearable:packageRelease]
lintSit - Runs lint on the Sit build.
Here's some reference code that might be helpful:
Obviously we would need to update the README to indicate that the gnag plugin must be applied after the Android plugin.
Also interesting to note:
$ ./gradlew app:tasks --all | grep "test"
build - Assembles and tests this project. [assemble, check]
buildDependents - Assembles and tests this project and all projects that depend on it. [build]
buildNeeded - Assembles and tests this project and all projects it depends on. [build]
mockableAndroidJar - Creates a version of android.jar that's suitable for unit tests.
installDebugAndroidTest - Installs the android (on device) tests for the Debug build. [compileDebugAndroidTestSources]
uninstallDebugAndroidTest - Uninstalls the android (on device) tests for the Debug build.
check - Runs all checks. [lint, test]
connectedAndroidTest - Installs and runs instrumentation tests for all flavors on connected devices. [connectedDebugAndroidTest]
connectedDebugAndroidTest - Installs and runs the tests for debug on connected devices. [assembleDebug, compileDebugAndroidTestSources]
deviceAndroidTest - Installs and runs instrumentation tests using all Device Providers.
test - Run unit tests for all variants. [testApiaryUnitTest, testDebugUnitTest, testReleaseUnitTest, testSitUnitTest]
testApiaryUnitTest - Run unit tests for the apiary build. [compileApiaryUnitTestSources, mockableAndroidJar]
testDebugUnitTest - Run unit tests for the debug build. [compileDebugUnitTestSources, mockableAndroidJar]
testReleaseUnitTest - Run unit tests for the release build. [compileReleaseUnitTestSources, mockableAndroidJar]
testSitUnitTest - Run unit tests for the sit build. [compileSitUnitTestSources, mockableAndroidJar]
Does this imply that check
only runs unit test tasks, not connected device test tasks? 🤔
Taking a poke at this now.
See #126.
Currently there are two Gnag tasks,
gnagCheck
andgnagReport
. Both of these tasks should be generated for each combination of product flavor and build type.This would allow a consumer to only run the Gnag check / report on certain ones if required. The current
gnagCheck
andgnagReport
should remain allowing the consumer to run Gnag for all variants and flavors.