Skip to content

Migrate all tests to kotlin, remove groovy plugin from buildSrc. #1532

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

Merged
merged 3 commits into from
May 13, 2020

Conversation

vkryachko
Copy link
Member

No description provided.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented May 7, 2020

Coverage Report

Affected SDKs

  • firebase-database

    SDK overall coverage changed from 51.16% (9d75839) to 51.20% (98cebade) by +0.05%.

    Filename Base (9d75839) Head (98cebade) Diff
    ChildChangeAccumulator.java 83.87% 96.77% +12.90%
  • firebase-storage

    SDK overall coverage changed from 85.98% (9d75839) to 85.48% (98cebade) by -0.49%.

    Filename Base (9d75839) Head (98cebade) Diff
    NetworkRequest.java 89.80% 89.29% -0.51%
    StorageException.java 69.09% 65.45% -3.64%
    StorageTask.java 84.89% 84.29% -0.60%
    UploadTask.java 82.42% 80.22% -2.20%

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (98cebade) is created by Prow via merging commits: 9d75839 1d179a3.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented May 7, 2020

Binary Size Report

Affected SDKs

  • firebase-abt

    Type Base (9d75839) Head (98cebade) Diff
    apk (debug) 894 kB 894 kB +9 B (+0.0%)
  • firebase-common

    Type Base (9d75839) Head (98cebade) Diff
    apk (debug) 770 kB 770 kB +8 B (+0.0%)
  • firebase-common-ktx

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 272 kB 272 kB -17 B (-0.0%)
    apk (debug) 1.56 MB 1.56 MB -4 B (-0.0%)
  • firebase-components

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 11.0 kB 10.9 kB -11 B (-0.1%)
    apk (debug) 35.9 kB 35.9 kB -7 B (-0.0%)
  • firebase-config

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 403 kB 403 kB -2 B (-0.0%)
    apk (debug) 1.34 MB 1.34 MB +56 B (+0.0%)
  • firebase-config-ktx

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 593 kB 593 kB -2 B (-0.0%)
    apk (debug) 2.13 MB 2.13 MB -17 B (-0.0%)
  • firebase-crashlytics

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 598 kB 598 kB +15 B (+0.0%)
    apk (debug) 1.60 MB 1.60 MB +45 B (+0.0%)
  • firebase-crashlytics-ndk

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 1.19 MB 1.19 MB +14 B (+0.0%)
    apk (debug) 2.23 MB 2.23 MB +32 B (+0.0%)
  • firebase-database

    Type Base (9d75839) Head (98cebade) Diff
    apk (debug) 1.29 MB 1.29 MB -21 B (-0.0%)
  • firebase-database-collection

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 314 kB 314 kB -11 B (-0.0%)
    apk (debug) 1.07 MB 1.07 MB -58 B (-0.0%)
  • firebase-database-ktx

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 515 kB 515 kB -1 B (-0.0%)
    apk (debug) 2.08 MB 2.08 MB -84 B (-0.0%)
  • firebase-datatransport

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 117 kB 117 kB +17 B (+0.0%)
    apk (debug) 846 kB 846 kB -3 B (-0.0%)
  • firebase-dynamic-links

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 327 kB 327 kB -10 B (-0.0%)
    apk (debug) 1.10 MB 1.10 MB -87 B (-0.0%)
  • firebase-dynamic-links-ktx

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 517 kB 517 kB +5 B (+0.0%)
    apk (debug) 1.89 MB 1.89 MB +11 B (+0.0%)
  • firebase-encoders-json

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 11.0 kB 10.9 kB -11 B (-0.1%)
    apk (debug) 27.4 kB 27.4 kB +2 B (+0.0%)
  • firebase-encoders-reflective

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 11.0 kB 10.9 kB -11 B (-0.1%)
    apk (debug) 30.0 kB 30.0 kB -5 B (-0.0%)
  • firebase-firestore

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 443 kB 443 kB -10 B (-0.0%)
    apk (debug) 3.74 MB 3.74 MB -27 B (-0.0%)
  • firebase-firestore-ktx

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 633 kB 633 kB -1 B (-0.0%)
    apk (debug) 4.53 MB 4.53 MB +63 B (+0.0%)
  • firebase-functions

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 394 kB 393 kB -17 B (-0.0%)
    apk (debug) 1.37 MB 1.37 MB +62 B (+0.0%)
  • firebase-functions-ktx

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 583 kB 583 kB -17 B (-0.0%)
    apk (debug) 2.16 MB 2.16 MB +230 B (+0.0%)
  • firebase-inappmessaging

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 610 kB 610 kB -14 B (-0.0%)
    apk (debug) 4.01 MB 4.01 MB +54 B (+0.0%)
  • firebase-inappmessaging-ktx

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 800 kB 800 kB -17 B (-0.0%)
    apk (debug) 4.81 MB 4.81 MB -112 B (-0.0%)
  • firebase-installations

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 84.2 kB 84.3 kB +7 B (+0.0%)
    apk (debug) 794 kB 794 kB -52 B (-0.0%)
  • firebase-installations-interop

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 61.7 kB 61.7 kB -10 B (-0.0%)
    apk (debug) 744 kB 744 kB -12 B (-0.0%)
  • firebase-segmentation

    Type Base (9d75839) Head (98cebade) Diff
    apk (debug) 1.61 MB 1.61 MB -16 B (-0.0%)
  • firebase-storage

    Type Base (9d75839) Head (98cebade) Diff
    apk (debug) 1.13 MB 1.13 MB +43 B (+0.0%)
  • firebase-storage-ktx

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 515 kB 515 kB +14 B (+0.0%)
    apk (debug) 1.92 MB 1.92 MB +71 B (+0.0%)
  • protolite-well-known-types

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 122 kB 122 kB -10 B (-0.0%)
    apk (debug) 643 kB 643 kB +17 B (+0.0%)
  • transport-api

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 11.0 kB 10.9 kB -11 B (-0.1%)
    apk (debug) 23.0 kB 23.0 kB -14 B (-0.1%)
  • transport-backend-cct

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 47.8 kB 47.9 kB +14 B (+0.0%)
    apk (debug) 101 kB 101 kB -31 B (-0.0%)
  • transport-runtime

    Type Base (9d75839) Head (98cebade) Diff
    apk (aggressive) 35.6 kB 35.5 kB -17 B (-0.0%)

Test Logs

Notes

Head commit (98cebade) is created by Prow via merging commits: 9d75839 1d179a3.

@vkryachko vkryachko requested a review from rlazo May 7, 2020 15:34
Copy link
Collaborator

@rlazo rlazo left a comment

Choose a reason for hiding this comment

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

Impressive!

@googlebot googlebot added cla: no and removed cla: yes Override cla labels May 7, 2020
@googlebot googlebot added cla: yes Override cla and removed cla: no labels May 7, 2020
@vkryachko
Copy link
Member Author

/retest

@vkryachko
Copy link
Member Author

/retest

@vkryachko vkryachko changed the title WIP Migrate all tests to kotlin, remove groovy plugin from buildSrc. Migrate all tests to kotlin, remove groovy plugin from buildSrc. May 13, 2020
@vkryachko vkryachko merged commit 631484a into master May 13, 2020
@thatfiredev
Copy link
Member

@vkryachko If I may ask, what's the reason for this change? (besides the fact that Kotlin is more pleasant to read and write 😉)

@vkryachko
Copy link
Member Author

hey @rosariopfernandes , this work is an intermediate step towards Kotlin in buildSrc. The motivation is

  1. Maintaining groovy has been a pain for us, due to it's dynamic typing, i.e. you're never sure if what you write will actually work
  2. So we started migrating logic to java, but it is really verbose to write and has so many nested lambdas, i.e.
    android
    .getLibraryVariants()
    .all(
    v -> {
    if (v.getName().equals("release")) {
    project.afterEvaluate(
    p -> {
    FileCollection artifactFiles =
    v.getRuntimeConfiguration()
    .getIncoming()
    .artifactView(
    view -> {
    view.attributes(
    attrs ->
    attrs.attribute(
    Attribute.of(
    "artifactType", String.class),
    "jar"));
    view.componentFilter(
    c ->
    !c.getDisplayName()
    .startsWith(
    "androidx.annotation:annotation:"));
    })
    .getArtifacts()
    .getArtifactFiles()
    .plus(project.files(android.getBootClasspath()));
    dokka.setClasspath(artifactFiles);

So our goal is to end up with code in Kotlin, for that we had to remove the groovy plugin as it causes issues when the kotlin plugin is enabled(at least in the version of gradle we are currently stuck with).

So now that groovy is gone, we can start writing concise(like we did in groovy) and type-safe(like we did in Java) code :)

@thatfiredev
Copy link
Member

@vkryachko Thanks for the detailed explanation :)

ashwinraghav pushed a commit that referenced this pull request May 18, 2020
* Migrate all tests to kotlin, remove groovy plugin from buildSrc.

* Remove unused deps.
@firebase firebase locked and limited conversation to collaborators Jun 13, 2020
@vkryachko vkryachko deleted the vk.kotlin_tests branch October 20, 2020 21:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants