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

Update Android Gradle Plugin to v3.2.1 #388

Merged
merged 3 commits into from Dec 5, 2018
Merged

Conversation

fractalwrench
Copy link
Contributor

Goal

Update the AGP to v3.2+, to enable the SyntheticAccessor lint check. Synthetic accessors are generated when an inner class accesses a private method or field in its enclosing class, for example:

class Foo {
    private Bar bar;
    
    class Baz {
        Baz() {
            bar.toString(); // creates a synthetic accessor method to access bar
        }
    }
}

Changeset

  • Update AGP to v3.2.1 (latest stable)
  • Update Kotlin version to v1.3.10 (latest stable), as AGP v3.2.1 only supports Kotlin 1.2.71+
  • Migrate to kotlin-stdlib dependency, as the deprecated kotlin-stdlib-jre artefact is not available in 1.3.10
  • Adds baseline lint file to suppress existing issues for UnknownNullness and KotlinPropertyAccess.
  • Relax visibility of methods/fields identified in SyntheticAccessor lint check to package-private, which removes 8 unnecessary methods 🎉

Tests

Ran existing test suites on CI

Discussion

Internal tickets have been created for addressing the pre-existing KotlinPropertyAccess and UnknownNullness checks in a separate PR.

Update the Android Gradle Plugin to 3.2.1 to gain access to new Lint checks. This version of AGP
only supports Kotlin 1.2.7+, so Kotlin has also been updated to the latest version, and to use the
stdlib rather than the deprecated jre artefact. See
https://kotlinlang.org/docs/reference/using-gradle.html#configuring-dependencies
The synthetic accessor lint check detected access of private fields from inner classes, which
generates a method to access this value. The visibility of the appropriate methods/fields has been
adjusted to prevent this, removing 8 unnecessary methods.
Copy link
Contributor

@bengourley bengourley left a comment

Choose a reason for hiding this comment

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

LGTM!

@fractalwrench fractalwrench merged commit ef4b255 into next Dec 5, 2018
@fractalwrench fractalwrench deleted the update-agp-version branch December 5, 2018 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants