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

build(ci): ensure testlib is built #17531

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions AnkiDroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,11 @@ tasks.register('copyTestLibIntoAndroidTest', Copy) {
tasks.named('preBuild').configure { dependsOn('copyTestLibIntoAndroidTest') }
tasks.named('runKtlintCheckOverAndroidTestSourceSet').configure { mustRunAfter('copyTestLibIntoAndroidTest') }

// to run manually: `./gradlew :testlib:assemblePlayDebugAndroidTest`
tasks.named("assemblePlayDebugAndroidTest") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other task dependencies use .configure for a reason: it is done that way in order to work well with Gradle's ability to defer configuration, which can speed compilation for jobs that don't use some tasks and thus don't need to configure them

This was suggested as something to change via gradle lint rules in one of the recent gradle updates

68b1f68

Suggested change
tasks.named("assemblePlayDebugAndroidTest") {
tasks.named("assemblePlayDebugAndroidTest").configure {

dependsOn(":testlib:assemblePlayDebugAndroidTest")
}

// Issue 11078 - some emulators run, but run zero tests, and still report success
tasks.register('assertNonzeroAndroidTests') {
doLast {
Expand Down
Loading