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
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
## [unreleased]
### Removed
- Removed ProGuard rule from ReadMe [#257](https://github.com/CanHub/Android-Image-Cropper/issues/257)
- Removed unused dependencies and settings from Gradle files [#265](https://github.com/CanHub/Android-Image-Cropper/issues/265)

## [3.3.6] - 05/11/21
### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Only need if you run on devices under OS10 (SDK 29)

- Go to app level `build.gradle` file

- Add this line inside ```android``` in build.gradle
- Add this line inside ```android``` in build.gradle (Android Gradle Plugin < 4.2)
```gradle
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ subprojects {
allprojects {
repositories {
mavenCentral()
maven { url "https://maven.google.com" }
google()
maven { url "https://jitpack.io" }
}
}
Expand Down
11 changes: 3 additions & 8 deletions cropper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ afterEvaluate {
}

android {
compileSdkVersion rootProject.compileSdkVersion
compileSdk rootProject.compileSdkVersion

defaultConfig {
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
minSdk rootProject.minSdkVersion
targetSdk rootProject.targetSdkVersion
versionCode 1
versionName rootProject.libVersion
}
Expand Down Expand Up @@ -61,17 +61,12 @@ dependencies {
implementation "androidx.exifinterface:exifinterface:$androidXExifVersion"
implementation "androidx.core:core-ktx:$androidXCoreKtxVersion"

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$androidXLifeCycleVersion"

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion"

testImplementation "junit:junit:$junitVersion"
testImplementation "androidx.test.ext:junit:$androidXJunitVersion"
testImplementation "androidx.test:core:$androidXTestVersion"
testImplementation "androidx.test:runner:$androidXTestVersion"
debugImplementation "androidx.fragment:fragment-testing:$androidXFragmentVersion"
testImplementation "org.robolectric:robolectric:$robolectricVersion"
testImplementation "io.mockk:mockk:$mockkVersion"
}
22 changes: 1 addition & 21 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,8 @@ org.gradle.configureondemand=true
# When set to true, Gradle will reuse task outputs from any previous build, when possible.
org.gradle.caching=true

# 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
Comment on lines -24 to -48
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)

android.useAndroidX=true
7 changes: 3 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'

android {
compileSdkVersion rootProject.compileSdkVersion
compileSdk rootProject.compileSdkVersion

defaultConfig {
minSdkVersion 24
targetSdkVersion rootProject.targetSdkVersion
minSdk 24
targetSdk rootProject.targetSdkVersion
versionCode 1
versionName '1.0'
}
Expand All @@ -31,6 +31,5 @@ dependencies {
api project(':cropper')
implementation "androidx.appcompat:appcompat:$androidXAppCompatVersion"
implementation "androidx.core:core-ktx:$androidXCoreKtxVersion"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation "com.google.android.material:material:$materialVersion"
}
5 changes: 0 additions & 5 deletions versions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,12 @@ ext {
androidXAppCompatVersion = '1.3.1'
androidXExifVersion = '1.3.3'
androidXCoreKtxVersion = '1.6.0'
androidXLifeCycleVersion = '2.3.1'
androidXJunitVersion = '1.1.3'
androidXFragmentVersion = '1.3.5'
androidXTestVersion = '1.4.0' // when update to android 12, please uncomment PickImageContractTest && CropImageContractTest

// JUnit
junitVersion = '4.13.2'

// Robolectric
robolectricVersion = '4.5.1'

// Mockk
mockkVersion = '1.12.0'
}