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

Enh/gradle cleaning #266

Merged
merged 5 commits into from
Nov 16, 2021
Merged

Conversation

Alireza-Farahani
Copy link
Contributor

close #265

Template 1 [New Feature]

Description:

I have an obsession for cleanup and I noticed there are some things in Gradle related files which can be removed or changed from deprecated ones to newer ones. Source for first three bullet here.

  • Since Kotlin 1.4.0, there's no need to add standard library as a dependency
  • Since AGP 4.1 compileSdkVersion, targetSdkVersion and minSdkVersion are deprecated in favor of shorter properties of compileSdk, targetSdk and minSdk
  • Since AGP 4.2 java 1.8 support is enabled by default. We could mention this in ReadMe.
  • Jetifer could be removed, since all the dependencies are fully migrated to androidx.
  • Since Gradle 7.0 "file system watching" is enabled by default. source
  • The Gradle Daemon is enabled by default. source
  • kapt properties could be removed, since kapt is not applied anywhere.
  • androidx lifeCycle, fragment-testing and robolectric are unused and could be removed.

Check list for the Code Reviewer:

  • CHANGELOG
  • README
  • Wiki
  • Version Number

@Alireza-Farahani Alireza-Farahani requested a review from a team as a code owner November 15, 2021 17:31
Copy link
Member

@Canato Canato left a comment

Choose a reason for hiding this comment

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

Amazing PR, just a small question

Comment on lines -24 to -48
# Enable Kapt Incremental annotation processing requeste
kapt.incremental.apt=true

# Decrease gradle builds time
kapt.use.worker.api=true

# turn off AP discovery in compile path, and therefore turn on Compile Avoidance
kapt.include.compile.classpath=false

# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
# Android plugin uses the appropriate AndroidX library instead of a Support Library.
android.useAndroidX=true

# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Once you have globally enabled the Daemon in this way, all your builds will take advantage of the
# speed boost, regardless of the version of Gradle a particular build uses.
org.gradle.daemon=true

# Run with file system watching enabled
# https://docs.gradle.org/current/userguide/gradle_daemon.html#sec:daemon_watch_fs
org.gradle.vfs.watch=true
Copy link
Member

Choose a reason for hiding this comment

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

Could you explain why we don't need this anymore or why was not been used? Thanks!

Copy link
Contributor Author

@Alireza-Farahani Alireza-Farahani Nov 15, 2021

Choose a reason for hiding this comment

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

For "file system watching" we don't need it because it's enabled by default from Gradle 7.0 and later and we are using Gradle 7.0.2.

For Gradle daemon it's too is enabled by default.

For Jetifire, we don't need it anymore, because there's no old support library dependency in project classpath (either from explicit dependencies or transitive dependencies). So there's nothing for Jetifier to do. (In fact next Android Studio warns about using Jetifire)

@Canato Canato merged commit 2b3be06 into CanHub:main Nov 16, 2021
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.

[Feat] - Gradle cleanup
2 participants