Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gnag tasks should take build variant into account #123

Open
btkelly opened this issue Oct 13, 2016 · 6 comments
Open

Gnag tasks should take build variant into account #123

btkelly opened this issue Oct 13, 2016 · 6 comments

Comments

@btkelly
Copy link
Owner

btkelly commented Oct 13, 2016

Currently there are two Gnag tasks, gnagCheck and gnagReport. 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 and gnagReport should remain allowing the consumer to run Gnag for all variants and flavors.

@stkent
Copy link
Collaborator

stkent commented Oct 15, 2016

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.

@stkent
Copy link
Collaborator

stkent commented Oct 15, 2016

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.

@stkent
Copy link
Collaborator

stkent commented Oct 15, 2016

Here's some reference code that might be helpful:

https://github.com/x2on/gradle-hockeyapp-plugin/blob/master/src/main/groovy/de/felixschulze/gradle/HockeyAppPlugin.groovy#L52-L74

Obviously we would need to update the README to indicate that the gnag plugin must be applied after the Android plugin.

@stkent
Copy link
Collaborator

stkent commented Oct 15, 2016

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? 🤔

@stkent
Copy link
Collaborator

stkent commented Oct 16, 2016

Taking a poke at this now.

@stkent
Copy link
Collaborator

stkent commented Oct 16, 2016

See #126.

@stkent stkent self-assigned this Oct 17, 2016
@stkent stkent changed the title Gnag tasks should take build variant and flavor into account Gnag tasks should take build variant into account Jun 11, 2017
@stkent stkent removed their assignment Jun 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants