Skip to content

Commit b34ded3

Browse files
authored
Merge pull request #6 from frogermcs/feature/androidx
Feature/androidx
2 parents 8d67d97 + af6dca0 commit b34ded3

File tree

16 files changed

+131
-54
lines changed

16 files changed

+131
-54
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: android
22

33
android:
44
components:
5-
- build-tools-28.0.2
5+
- build-tools-28.0.3
66
- android-28
77

88
- extra-google-m2repository

app/build.gradle

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ apply from: '../buildsystem/android_commons.gradle'
77
android {
88

99
defaultConfig {
10-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
10+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1111
}
1212

1313
buildTypes {
1414
debug {
1515
minifyEnabled true
1616
proguardFiles getDefaultProguardFile('proguard-android.txt'),
1717
'proguard-rules.pro'
18+
testProguardFile 'proguard-test-rules.pro'
1819
}
1920

2021
release {
2122
minifyEnabled true
22-
proguardFile 'proguard-rules.pro'
23-
proguardFile getDefaultProguardFile('proguard-android.txt')
23+
proguardFiles getDefaultProguardFile('proguard-android.txt') ,
24+
'proguard-rules.pro'
2425
}
2526
}
2627

app/proguard-rules.pro

+47-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# === General rules ===
2+
3+
-dontobfuscate # Only because of easy debugging
4+
15
# === RxJava ===
26

37
-dontwarn sun.misc.**
@@ -15,7 +19,7 @@
1519
rx.internal.util.atomic.LinkedQueueNode consumerNode;
1620
}
1721

18-
-dontnote rx.internal.util.PlatformDependent
22+
-dontnote rx.internal.util.**
1923

2024
# ===endof RxJava ===
2125

@@ -34,6 +38,8 @@
3438
# OkHttp platform used only on JVM and when Conscrypt dependency is available.
3539
-dontwarn okhttp3.internal.platform.ConscryptPlatform
3640

41+
-dontnote okhttp3.**
42+
3743
# ===endof OkHttp ===
3844

3945

@@ -77,4 +83,43 @@
7783
-dontwarn com.google.common.**
7884
-dontwarn com.google.auto.**
7985

80-
# ===endof Google autofactory ===
86+
-dontnote com.google.common.**
87+
-dontnote com.google.auto.**
88+
89+
# ===endof Google autofactory ===
90+
91+
# === GSON ===
92+
93+
# Gson uses generic type information stored in a class file when working with fields. Proguard
94+
# removes such information by default, so configure it to keep all of it.
95+
-keepattributes Signature
96+
97+
# For using GSON @Expose annotation
98+
-keepattributes *Annotation*
99+
100+
# Gson specific classes
101+
-dontwarn sun.misc.**
102+
#-keep class com.google.gson.stream.** { *; }
103+
104+
# Application classes that will be serialized/deserialized over Gson
105+
-keep class com.google.gson.examples.android.model.** { *; }
106+
107+
# Prevent proguard from stripping interface information from TypeAdapterFactory,
108+
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
109+
-keep class * implements com.google.gson.TypeAdapterFactory
110+
-keep class * implements com.google.gson.JsonSerializer
111+
-keep class * implements com.google.gson.JsonDeserializer
112+
113+
-dontnote com.google.gson.internal.**
114+
115+
# ===endof GSON ===
116+
117+
118+
119+
# === App UI ===
120+
-keep class androidx.recyclerview.widget.RecyclerView {
121+
public <methods>;
122+
}
123+
-keep class androidx.coordinatorlayout.widget.CoordinatorLayout$Behavior {*;}
124+
125+
# ===endof App UI ===

app/proguard-test-rules.pro

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-dontwarn org.xmlpull.v1.**
2+
3+
-dontwarn androidx.test.espresso.**
4+
5+
-dontwarn android.support.test.services.**
6+
-dontwarn android.support.test.runner.**
7+
-dontwarn android.support.test.orchestrator.**
8+
9+
-dontnote androidx.transition.**
10+
-dontnote androidx.test.runner.**
11+
-dontnote androidx.test.espresso.**
12+
-dontnote android.support.test.**
13+
-dontnote org.junit.**
14+
-dontnote junit.framework.**
15+
-dontnote junit.runner.**
16+
-dontnote org.xmlpull.**
17+
-dontnote java.lang.invoke.**
18+
-dontnote org.apache.**
19+
-dontnote android.net.**
20+

app/src/androidTest/java/com/frogermcs/multimodulegithubclient/endtoend/AppFlowTest.java

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
package com.frogermcs.multimodulegithubclient.endtoend;
22

3-
import android.support.test.espresso.UiController;
4-
import android.support.test.espresso.ViewAction;
5-
import android.support.test.espresso.contrib.RecyclerViewActions;
6-
import android.support.test.espresso.intent.rule.IntentsTestRule;
7-
import android.support.test.filters.LargeTest;
8-
import android.support.test.runner.AndroidJUnit4;
9-
import android.support.v7.widget.RecyclerView;
10-
import android.support.v7.widget.Toolbar;
113
import android.view.View;
124
import android.widget.TextView;
135

@@ -19,17 +11,26 @@
1911
import org.junit.Test;
2012
import org.junit.runner.RunWith;
2113

22-
import static android.support.test.espresso.Espresso.onView;
23-
import static android.support.test.espresso.action.ViewActions.click;
24-
import static android.support.test.espresso.action.ViewActions.typeText;
25-
import static android.support.test.espresso.assertion.ViewAssertions.matches;
26-
import static android.support.test.espresso.intent.Intents.intended;
27-
import static android.support.test.espresso.intent.matcher.IntentMatchers.hasComponent;
28-
import static android.support.test.espresso.matcher.ViewMatchers.isAssignableFrom;
29-
import static android.support.test.espresso.matcher.ViewMatchers.isRoot;
30-
import static android.support.test.espresso.matcher.ViewMatchers.withHint;
31-
import static android.support.test.espresso.matcher.ViewMatchers.withParent;
32-
import static android.support.test.espresso.matcher.ViewMatchers.withText;
14+
import androidx.appcompat.widget.Toolbar;
15+
import androidx.recyclerview.widget.RecyclerView;
16+
import androidx.test.espresso.UiController;
17+
import androidx.test.espresso.ViewAction;
18+
import androidx.test.espresso.contrib.RecyclerViewActions;
19+
import androidx.test.espresso.intent.rule.IntentsTestRule;
20+
import androidx.test.filters.LargeTest;
21+
import androidx.test.runner.AndroidJUnit4;
22+
23+
import static androidx.test.espresso.Espresso.onView;
24+
import static androidx.test.espresso.action.ViewActions.click;
25+
import static androidx.test.espresso.action.ViewActions.typeText;
26+
import static androidx.test.espresso.assertion.ViewAssertions.matches;
27+
import static androidx.test.espresso.intent.Intents.intended;
28+
import static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent;
29+
import static androidx.test.espresso.matcher.ViewMatchers.isAssignableFrom;
30+
import static androidx.test.espresso.matcher.ViewMatchers.isRoot;
31+
import static androidx.test.espresso.matcher.ViewMatchers.withHint;
32+
import static androidx.test.espresso.matcher.ViewMatchers.withParent;
33+
import static androidx.test.espresso.matcher.ViewMatchers.withText;
3334
import static org.hamcrest.CoreMatchers.allOf;
3435
import static org.hamcrest.CoreMatchers.instanceOf;
3536

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ buildscript {
66
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.2.0'
9+
classpath 'com.android.tools.build:gradle:3.2.1'
1010
classpath 'org.jacoco:org.jacoco.core:0.8.1'
1111
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
1212
}

buildsystem/dependencies.gradle

+24-17
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ext {
99
butterknifeVersion = '9.0.0-SNAPSHOT'
1010

1111
//Standard dependencies
12-
supportLibraryVersion = '28.0.0'
12+
supportLibraryVersion = '1.0.0'
1313
javaxAnnotationsVersion = '10.0-b28'
1414
autoFactoryVersion = '1.0-beta3'
1515
rxAndroidVersion = '1.2.1'
@@ -26,9 +26,9 @@ ext {
2626
mockitoVersion = '2.21.0'
2727

2828
//Functional/end-to-end testing dependencies
29-
espressoVersion = '3.0.2'
30-
testRunnerVersion = '1.0.2'
31-
testRulesVersion = '1.0.2'
29+
espressoVersion = '3.1.0-alpha3'
30+
testRunnerVersion = '1.1.0-alpha3'
31+
testRulesVersion = '1.1.0-alpha3'
3232

3333
//
3434
// ===== Libraries =====
@@ -40,8 +40,8 @@ ext {
4040
butterknifeCompiler = "com.jakewharton:butterknife-compiler:${butterknifeVersion}"
4141

4242
//Standard dependencies
43-
appCompatV7 = "com.android.support:appcompat-v7:${supportLibraryVersion}"
44-
recyclerViewV7 = "com.android.support:recyclerview-v7:${supportLibraryVersion}"
43+
appCompat = "androidx.appcompat:appcompat:${supportLibraryVersion}"
44+
recyclerView = "androidx.recyclerview:recyclerview:${supportLibraryVersion}"
4545

4646
butterknife = "com.jakewharton:butterknife:${butterknifeVersion}"
4747
dagger = "com.google.dagger:dagger:${daggerVersion}"
@@ -63,29 +63,36 @@ ext {
6363
mockito = "org.mockito:mockito-core:${mockitoVersion}"
6464

6565
//Functional/end-to-end testing dependencies
66-
espressoCore = "com.android.support.test.espresso:espresso-core:${espressoVersion}"
67-
espressoIntents = "com.android.support.test.espresso:espresso-intents:${espressoVersion}"
68-
espressoContrib = "com.android.support.test.espresso:espresso-contrib:${espressoVersion}"
69-
testRunner = "com.android.support.test:runner:${testRunnerVersion}"
70-
testRules = "com.android.support.test:rules:${testRulesVersion}"
66+
espressoCore = "androidx.test.espresso:espresso-core:${espressoVersion}"
67+
espressoIntents = "androidx.test.espresso:espresso-intents:${espressoVersion}"
68+
espressoContrib = "androidx.test.espresso:espresso-contrib:${espressoVersion}"
69+
testRunner = "androidx.test:runner:${testRunnerVersion}"
70+
testRules = "androidx.test:rules:${testRulesVersion}"
71+
72+
espressoExcludes = {
73+
exclude group: 'androidx.legacy', module: 'legacy-support-v4'
74+
exclude module: 'recyclerview'
75+
}
76+
7177

7278
//
7379
// ===== Modules =====
7480
//
7581
app = [
76-
[configuration: "implementation", dependency: appCompatV7],
82+
[configuration: "implementation", dependency: appCompat],
83+
[configuration: "implementation", dependency: recyclerView],
7784
]
7885

7986
repository = [
8087
]
8188

8289
repos = [
83-
[configuration: "implementation", dependency: recyclerViewV7],
90+
[configuration: "implementation", dependency: recyclerView],
8491
]
8592

8693
base = [
8794
[configuration: "api", dependency: butterknife],
88-
[configuration: "api", dependency: appCompatV7],
95+
[configuration: "api", dependency: appCompat],
8996
[configuration: "api", dependency: dagger],
9097
[configuration: "api", dependency: javaxAnnotations],
9198
[configuration: "api", dependency: autoFactory],
@@ -109,9 +116,9 @@ ext {
109116

110117
//Importend in app module only
111118
instrumentationTestsDependencies = [
112-
[configuration: "androidTestImplementation", dependency: espressoCore],
113-
[configuration: "androidTestImplementation", dependency: espressoIntents],
114-
[configuration: "androidTestImplementation", dependency: espressoContrib],
119+
[configuration: "androidTestImplementation", dependency: espressoCore, options: espressoExcludes],
120+
[configuration: "androidTestImplementation", dependency: espressoIntents, options: espressoExcludes],
121+
[configuration: "androidTestImplementation", dependency: espressoContrib, options: espressoExcludes],
115122
[configuration: "androidTestImplementation", dependency: testRunner],
116123
[configuration: "androidTestImplementation", dependency: testRules],
117124
]

features/base/src/main/java/com/frogermcs/multimodulegithubclient/base/BaseActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.frogermcs.multimodulegithubclient.base;
22

33
import android.os.Bundle;
4-
import android.support.v7.app.AppCompatActivity;
54

5+
import androidx.appcompat.app.AppCompatActivity;
66
import butterknife.ButterKnife;
77

88
public abstract class BaseActivity extends AppCompatActivity {

features/base/src/test/java/com/frogermcs/multimodulegithubclient/base/ExampleUnitTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.junit.Test;
44

5-
import static org.junit.Assert.*;
5+
import static org.junit.Assert.assertEquals;
66

77
/**
88
* Example local unit test, which will execute on the development machine (host).

features/repositories/src/main/java/com/frogermcs/multimodulegithubclient/repositories/RepositoriesListActivity.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import android.content.Context;
44
import android.content.Intent;
55
import android.os.Bundle;
6-
import android.support.v7.widget.LinearLayoutManager;
7-
import android.support.v7.widget.RecyclerView;
86
import android.view.View;
97
import android.widget.ProgressBar;
108

@@ -17,8 +15,9 @@
1715

1816
import javax.inject.Inject;
1917

18+
import androidx.recyclerview.widget.LinearLayoutManager;
19+
import androidx.recyclerview.widget.RecyclerView;
2020
import butterknife.BindView;
21-
import butterknife.ButterKnife;
2221

2322

2423
public class RepositoriesListActivity extends BaseActivity {

features/repositories/src/main/java/com/frogermcs/multimodulegithubclient/repositories/RepositoriesListActivityModule.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.frogermcs.multimodulegithubclient.repositories;
22

3-
import android.support.v7.widget.LinearLayoutManager;
4-
53
import com.frogermcs.multimodulegithubclient.base.ActivityScope;
64
import com.frogermcs.multimodulegithubclient.base.data.api.RepositoriesManager;
75
import com.frogermcs.multimodulegithubclient.base.data.model.Repository;
@@ -11,6 +9,7 @@
119

1210
import javax.inject.Named;
1311

12+
import androidx.recyclerview.widget.LinearLayoutManager;
1413
import dagger.Module;
1514
import dagger.Provides;
1615
import dagger.multibindings.IntKey;

features/repositories/src/main/java/com/frogermcs/multimodulegithubclient/repositories/RepositoriesListAdapter.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.frogermcs.multimodulegithubclient.repositories;
22

3-
import android.support.v7.widget.RecyclerView;
43
import android.view.ViewGroup;
54

65
import com.frogermcs.multimodulegithubclient.base.data.model.Repository;
@@ -9,6 +8,8 @@
98
import java.util.List;
109
import java.util.Map;
1110

11+
import androidx.recyclerview.widget.RecyclerView;
12+
1213
/**
1314
* Created by Miroslaw Stanek on 24.04.15.
1415
*/

features/repositories/src/main/java/com/frogermcs/multimodulegithubclient/repositories/RepositoriesListViewHolderFactory.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
package com.frogermcs.multimodulegithubclient.repositories;
22

3-
import android.support.v7.widget.RecyclerView;
43
import android.view.ViewGroup;
54

5+
import androidx.recyclerview.widget.RecyclerView;
6+
67
/**
78
* Created by Miroslaw Stanek on 11.06.2016.
89
*/

features/repositories/src/main/java/com/frogermcs/multimodulegithubclient/repositories/RepositoryViewHolder.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package com.frogermcs.multimodulegithubclient.repositories;
22

3-
import android.support.v7.widget.RecyclerView;
43
import android.view.View;
54

65
import com.frogermcs.multimodulegithubclient.base.data.model.Repository;
76

7+
import androidx.recyclerview.widget.RecyclerView;
8+
89
/**
910
* Created by Miroslaw Stanek on 11.06.2016.
1011
*/

features/repositories/src/main/res/layout/activity_repositories_list.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
android:gravity="center"
55
android:orientation="vertical">
66

7-
<android.support.v7.widget.RecyclerView
7+
<androidx.recyclerview.widget.RecyclerView
88
android:id="@+id/rvRepositories"
99
android:layout_width="match_parent"
1010
android:layout_height="match_parent" />

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# http://www.gradle.org/docs/current/userguide/build_environment.html
77
# Specifies the JVM arguments used for the daemon process.
88
# The setting is particularly useful for tweaking memory settings.
9+
android.enableJetifier=true
10+
android.useAndroidX=true
911
org.gradle.jvmargs=-Xmx1536m
1012
# When configured, Gradle will run in incubating parallel mode.
1113
# This option should only be used with decoupled projects. More details, visit

0 commit comments

Comments
 (0)