-
Notifications
You must be signed in to change notification settings - Fork 515
Migrate to androix #47
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
Changes from all commits
1288aee
5d2bef6
06ad857
f698320
94e8ad1
973e2eb
1537ebe
7f6ea11
443b995
de2bb01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,26 @@ | ||
|
|
||
| ext { | ||
| //Android | ||
| androidBuildToolsVersion = "26.0.0" | ||
| androidMinSdkVersion = 15 | ||
| androidTargetSdkVersion = 26 | ||
| androidCompileSdkVersion = 26 | ||
| androidTargetSdkVersion = 28 | ||
| androidCompileSdkVersion = 28 | ||
|
|
||
| //Libraries | ||
| kotlinVersion = '1.1.3-2' | ||
| rxKotlinVersion = '2.1.0' | ||
| rxAndroidVersion = '2.0.1' | ||
| kotlinVersion = '1.2.71' | ||
| rxKotlinVersion = '2.3.0' | ||
| rxAndroidVersion = '2.1.0' | ||
| javaxAnnotationVersion = '1.0' | ||
| javaxInjectVersion = '1' | ||
| gsonVersion = '2.8.1' | ||
| okHttpVersion = '3.8.1' | ||
| androidAnnotationsVersion = '21.0.3' | ||
| retrofitVersion = '2.3.0' | ||
| roomVersion = '1.0.0-alpha6' | ||
| supportLibraryVersion = '26.0.1' | ||
| timberVersion = '4.5.1' | ||
| glideVersion = '4.0.0' | ||
| daggerVersion = '2.11' | ||
| timberVersion = '4.7.1' | ||
| glideVersion = '4.8.0' | ||
| daggerVersion = '2.16' // As of today, 2.17 does not work. See https://issuetracker.google.com/issues/115738511 | ||
| glassfishAnnotationVersion = '10.0-b28' | ||
| appCompatVersion = '1.0.0' | ||
|
|
||
| //Testing | ||
| robolectricVersion = '3.4.2' | ||
|
|
@@ -32,7 +31,7 @@ ext { | |
| espressoVersion = '3.0.0' | ||
| testingSupportLibVersion = '0.1' | ||
| mockitoKotlinVersion = '1.5.0' | ||
| mockitoAndroidVersion = '2.8.47' | ||
| mockitoAndroidVersion = '2.8.9' // As of today, 2.23.0 does not work | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. downgraded library? |
||
| androidSupportRunnerVersion = '1.0.0' | ||
| androidSupportRulesVersion = '1.0.0' | ||
| dexmakerMockitoversion = '2.2.0' | ||
|
|
@@ -42,12 +41,13 @@ ext { | |
| javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}", | ||
| javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}", | ||
| rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}" | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}" | ||
| ] | ||
|
|
||
| domainTestDependencies = [ | ||
| junit: "junit:junit:${jUnitVersion}", | ||
| mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}", | ||
| kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}", | ||
| assertj: "org.assertj:assertj-core:${assertJVersion}" | ||
| ] | ||
|
|
||
|
|
@@ -58,7 +58,7 @@ ext { | |
| okHttpLogger: "com.squareup.okhttp3:logging-interceptor:${okHttpVersion}", | ||
| gson: "com.google.code.gson:gson:${gsonVersion}", | ||
| rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}", | ||
| rxAndroid: "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}", | ||
| javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}", | ||
| javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}", | ||
|
|
@@ -73,6 +73,7 @@ ext { | |
| kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}", | ||
| assertj: "org.assertj:assertj-core:${assertJVersion}", | ||
| mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}", | ||
| kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}", | ||
| robolectric: "org.robolectric:robolectric:${robolectricVersion}" | ||
| ] | ||
|
|
||
|
|
@@ -83,7 +84,7 @@ ext { | |
| okHttpLogger: "com.squareup.okhttp3:logging-interceptor:${okHttpVersion}", | ||
| gson: "com.google.code.gson:gson:${gsonVersion}", | ||
| rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}", | ||
| rxAndroid: "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}", | ||
| javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}", | ||
| javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}", | ||
|
|
@@ -98,6 +99,7 @@ ext { | |
| kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}", | ||
| assertj: "org.assertj:assertj-core:${assertJVersion}", | ||
| mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}", | ||
| kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}", | ||
| robolectric: "org.robolectric:robolectric:${robolectricVersion}" | ||
| ] | ||
|
|
||
|
|
@@ -106,7 +108,7 @@ ext { | |
| dagger: "com.google.dagger:dagger:${daggerVersion}", | ||
| gson: "com.google.code.gson:gson:${gsonVersion}", | ||
| rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}", | ||
| javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}", | ||
| javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}", | ||
| androidAnnotations: "com.android.support:support-annotations:${androidAnnotationsVersion}", | ||
|
|
@@ -120,6 +122,7 @@ ext { | |
| kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}", | ||
| assertj: "org.assertj:assertj-core:${assertJVersion}", | ||
| mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}", | ||
| kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}", | ||
| robolectric: "org.robolectric:robolectric:${robolectricVersion}", | ||
| roomTesting: "android.arch.persistence.room:testing:${roomVersion}", | ||
| archTesting: "android.arch.core:core-testing:${roomVersion}", | ||
|
|
@@ -132,7 +135,7 @@ ext { | |
| dagger: "com.google.dagger:dagger:${daggerVersion}", | ||
| gson: "com.google.code.gson:gson:${gsonVersion}", | ||
| rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}", | ||
| javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}", | ||
| javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}", | ||
| androidAnnotations: "com.android.support:support-annotations:${androidAnnotationsVersion}", | ||
|
|
@@ -148,6 +151,7 @@ ext { | |
| kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}", | ||
| assertj: "org.assertj:assertj-core:${assertJVersion}", | ||
| mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}", | ||
| kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}", | ||
| supportRunner: "com.android.support.test:runner:${androidSupportRunnerVersion}", | ||
| supportRules: "com.android.support.test:rules:${androidSupportRulesVersion}" | ||
| ] | ||
|
|
@@ -158,15 +162,13 @@ ext { | |
| rxKotlin: "io.reactivex.rxjava2:rxkotlin:${rxKotlinVersion}", | ||
| rxAndroid: "io.reactivex.rxjava2:rxandroid:${rxAndroidVersion}", | ||
| glide: "com.github.bumptech.glide:glide:${glideVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}", | ||
| kotlin: "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}", | ||
| javaxAnnotation: "javax.annotation:jsr250-api:${javaxAnnotationVersion}", | ||
| javaxInject: "javax.inject:javax.inject:${javaxInjectVersion}", | ||
| androidAnnotations: "com.android.support:support-annotations:${supportLibraryVersion}", | ||
| androidSupportV4: "com.android.support:support-v4:${supportLibraryVersion}", | ||
| androidSupportV13: "com.android.support:support-v13:${supportLibraryVersion}", | ||
| appCompatV7: "com.android.support:appcompat-v7:${supportLibraryVersion}", | ||
| supportRecyclerView:"com.android.support:recyclerview-v7:${supportLibraryVersion}", | ||
| supportDesign: "com.android.support:design:${supportLibraryVersion}", | ||
| androidAnnotations: "androidx.annotation:annotation:1.0.0", | ||
| appCompat: "androidx.appcompat:appcompat:${appCompatVersion}", | ||
| supportRecyclerView:"androidx.recyclerview:recyclerview:1.0.0", | ||
| supportDesign: "com.google.android.material:material:1.0.0-rc01", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am pretty sure that when you use |
||
| timber: "com.jakewharton.timber:timber:${timberVersion}", | ||
| daggerSupport: "com.google.dagger:dagger-android-support:${daggerVersion}", | ||
| daggerProcessor: "com.google.dagger:dagger-android-processor:${daggerVersion}", | ||
|
|
@@ -178,12 +180,14 @@ ext { | |
| kotlinJUnit: "org.jetbrains.kotlin:kotlin-test-junit:${kotlin_version}", | ||
| assertj: "org.assertj:assertj-core:${assertJVersion}", | ||
| mockito: "com.nhaarman:mockito-kotlin:${mockitoKotlinVersion}", | ||
| kotlinReflect: "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}", | ||
| supportRunner: "com.android.support.test:runner:${androidSupportRunnerVersion}", | ||
| supportRules: "com.android.support.test:rules:${androidSupportRulesVersion}", | ||
| mockitoAndroid: "org.mockito:mockito-android:${mockitoAndroidVersion}", | ||
| espressoCore: "com.android.support.test.espresso:espresso-core:${espressoVersion}", | ||
| espressoIntents: "com.android.support.test.espresso:espresso-intents:${espressoVersion}", | ||
| espressoContrib: "com.android.support.test.espresso:espresso-contrib:${espressoVersion}", | ||
| appCompat: "androidx.appcompat:appcompat:${appCompatVersion}", | ||
| androidRunner: "com.android.support.test:runner:${runnerVersion}", | ||
| androidRules: "com.android.support.test:rules:${runnerVersion}" | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| android.enableJetifier=true | ||
| android.useAndroidX=true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,7 @@ | ||
| plugins { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is purpose of this plugin? Is it related to
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used to check if new versions of libraries are available. No needed for androidx. You can skip it. |
||
| id 'com.github.ben-manes.versions' version '0.20.0' | ||
| } | ||
|
|
||
| apply plugin: 'com.android.application' | ||
| apply plugin: 'kotlin-android' | ||
| apply plugin: 'kotlin-android-extensions' | ||
|
|
@@ -8,7 +12,6 @@ android { | |
| def globalConfiguration = rootProject.extensions.getByName("ext") | ||
|
|
||
| compileSdkVersion globalConfiguration["androidCompileSdkVersion"] | ||
| buildToolsVersion globalConfiguration["androidBuildToolsVersion"] | ||
|
|
||
| defaultConfig { | ||
| minSdkVersion globalConfiguration["androidMinSdkVersion"] | ||
|
|
@@ -74,11 +77,9 @@ dependencies { | |
| implementation mobileUiDependencies.kotlin | ||
| implementation mobileUiDependencies.javaxInject | ||
| implementation mobileUiDependencies.rxKotlin | ||
| implementation mobileUiDependencies.androidAnnotations | ||
| implementation mobileUiDependencies.androidSupportV4 | ||
| implementation mobileUiDependencies.androidSupportV13 | ||
| implementation mobileUiDependencies.appCompatV7 | ||
| implementation mobileUiDependencies.supportRecyclerView | ||
| implementation mobileUiDependencies.androidAnnotations | ||
| implementation mobileUiDependencies.appCompat | ||
| implementation mobileUiDependencies.supportDesign | ||
| implementation mobileUiDependencies.timber | ||
| implementation mobileUiDependencies.rxAndroid | ||
|
|
@@ -95,29 +96,29 @@ dependencies { | |
| // Instrumentation test dependencies | ||
| androidTestImplementation mobileUiTestDependencies.junit | ||
| androidTestImplementation mobileUiTestDependencies.mockito | ||
| androidTestImplementation mobileUiTestDependencies.kotlinReflect | ||
| androidTestImplementation mobileUiTestDependencies.mockitoAndroid | ||
| androidTestImplementation (mobileUiTestDependencies.espressoCore) { | ||
| exclude group: 'com.android.support', module: 'support-annotations' | ||
| } | ||
| androidTestImplementation (mobileUiTestDependencies.androidRunner) { | ||
| exclude group: 'com.android.support', module: 'support-annotations' | ||
| } | ||
| androidTestImplementation (mobileUiTestDependencies.androidRules) { | ||
| exclude group: 'com.android.support', module: 'support-annotations' | ||
| } | ||
| androidTestImplementation (mobileUiTestDependencies.espressoIntents) { | ||
| exclude group: 'com.android.support', module: 'support-annotations' | ||
| } | ||
| androidTestImplementation(mobileUiTestDependencies.espressoContrib) { | ||
| exclude module: 'appcompat' | ||
| exclude module: 'appcompat-v7' | ||
| exclude module: 'support-v4' | ||
| exclude module: 'support-v13' | ||
| exclude module: 'support-annotations' | ||
| exclude module: 'recyclerview-v7' | ||
| exclude module: 'design' | ||
| } | ||
| androidTestImplementation mobileUiTestDependencies.espressoCore | ||
| androidTestImplementation mobileUiTestDependencies.androidRunner | ||
| androidTestImplementation mobileUiTestDependencies.androidRules | ||
| androidTestImplementation mobileUiTestDependencies.espressoIntents | ||
| androidTestImplementation mobileUiTestDependencies.espressoContrib | ||
| androidTestImplementation mobileUiTestDependencies.appCompat | ||
|
|
||
| kaptTest mobileUiDependencies.daggerCompiler | ||
| kaptAndroidTest mobileUiDependencies.daggerCompiler | ||
| } | ||
|
|
||
|
|
||
| dependencyUpdates.resolutionStrategy = { | ||
| componentSelection { rules -> | ||
| rules.all { ComponentSelection selection -> | ||
| boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm'].any { qualifier -> | ||
| selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/ | ||
| } | ||
| if (rejected) { | ||
| selection.reject('Release candidate') | ||
| } | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think that this library is necessary. Just curious - why did you add it in every module?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is so long ago, I'm not sure any more... Maybe it has to do with a gradle warning saying that different versions of a lib were found on the classpath. Maybe it's something else. Feel free to remove it. If it works well then I guess it's not needed !