Skip to content

Commit 6f9b0c8

Browse files
switch to AndroidX
Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
1 parent 0ee0c65 commit 6f9b0c8

204 files changed

Lines changed: 932 additions & 818 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

build.gradle

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ android {
8585
minSdkVersion 14
8686
targetSdkVersion 28
8787

88-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
88+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
8989

9090
// arguments to be passed to functional tests
9191
testInstrumentationRunnerArgument "TEST_USER", "\"$System.env.OCTEST_APP_USERNAME\""
@@ -210,18 +210,18 @@ android {
210210

211211
dependencies {
212212
// dependencies for app building
213-
implementation 'com.android.support:multidex:1.0.3'
213+
implementation 'androidx.multidex:multidex:2.0.0'
214214
// implementation project('nextcloud-android-library')
215215
genericImplementation "com.github.nextcloud:android-library:master-SNAPSHOT"
216216
gplayImplementation "com.github.nextcloud:android-library:master-SNAPSHOT"
217217
versionDevImplementation 'com.github.nextcloud:android-library:master-SNAPSHOT' // use always latest master
218-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
219-
implementation "com.android.support:support-v4:${supportLibraryVersion}"
220-
implementation "com.android.support:design:${supportLibraryVersion}"
218+
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
219+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
220+
implementation 'com.google.android.material:material:1.0.0'
221221
implementation 'com.jakewharton:disklrucache:2.0.2'
222-
implementation "com.android.support:appcompat-v7:${supportLibraryVersion}"
223-
implementation "com.android.support:cardview-v7:${supportLibraryVersion}"
224-
implementation "com.android.support:exifinterface:${supportLibraryVersion}"
222+
implementation 'androidx.appcompat:appcompat:1.0.0'
223+
implementation 'androidx.cardview:cardview:1.0.0'
224+
implementation 'androidx.exifinterface:exifinterface:1.0.0'
225225
implementation 'com.github.albfernandez:juniversalchardet:2.2.0'
226226
implementation 'com.google.code.findbugs:annotations:2.0.1'
227227
implementation 'commons-io:commons-io:2.6'
@@ -243,23 +243,23 @@ dependencies {
243243
exclude group: "com.android.support"
244244
}
245245
implementation 'com.caverock:androidsvg:1.3'
246-
implementation "com.android.support:support-annotations:${supportLibraryVersion}"
246+
implementation 'androidx.annotation:annotation:1.0.0'
247247
implementation 'com.google.code.gson:gson:2.8.5'
248248

249249
// dependencies for local unit tests
250250
testImplementation 'junit:junit:4.12'
251251
testImplementation 'org.mockito:mockito-core:2.22.0'
252252
// dependencies for instrumented tests
253253
// JUnit4 Rules
254-
androidTestImplementation 'com.android.support.test:rules:1.0.2'
254+
androidTestImplementation 'androidx.test:rules:1.1.0-alpha4'
255255
// Android JUnit Runner
256-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
256+
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
257257

258258
// Espresso core
259-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
260-
androidTestImplementation 'com.android.support.test.espresso:espresso-contrib:3.0.2'
259+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
260+
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0-alpha4'
261261
// UIAutomator - for cross-app UI tests, and to grant screen is turned on in Espresso tests
262-
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.3'
262+
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0-alpha4'
263263
// fix conflict in dependencies; see http://g.co/androidstudio/app-test-app-conflict for details
264264
//androidTestImplementation "com.android.support:support-annotations:${supportLibraryVersion}"
265265
implementation 'org.jetbrains:annotations:16.0.3'

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
android.enableJetifier=true
2+
android.useAndroidX=true

src/androidTest/disabledTests/screenshots/ScreenshotsIT.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package com.owncloud.android.screenshots;
22

33
import android.content.Intent;
4-
import android.support.test.espresso.Espresso;
5-
import android.support.test.espresso.action.ViewActions;
6-
import android.support.test.espresso.contrib.DrawerActions;
7-
import android.support.test.espresso.matcher.PreferenceMatchers;
8-
import android.support.test.rule.ActivityTestRule;
4+
import androidx.test.espresso.Espresso;
5+
import androidx.test.espresso.action.ViewActions;
6+
import androidx.test.espresso.contrib.DrawerActions;
7+
import androidx.test.espresso.matcher.PreferenceMatchers;
8+
import androidx.test.rule.ActivityTestRule;
99

1010
import com.owncloud.android.R;
1111
import com.owncloud.android.ui.activity.FileDisplayActivity;
@@ -24,11 +24,11 @@
2424
import tools.fastlane.screengrab.UiAutomatorScreenshotStrategy;
2525
import tools.fastlane.screengrab.locale.LocaleTestRule;
2626

27-
import static android.support.test.espresso.Espresso.onData;
28-
import static android.support.test.espresso.Espresso.onView;
29-
import static android.support.test.espresso.action.ViewActions.click;
30-
import static android.support.test.espresso.matcher.ViewMatchers.withId;
31-
import static android.support.test.espresso.matcher.ViewMatchers.withText;
27+
import static androidx.test.espresso.Espresso.onData;
28+
import static androidx.test.espresso.Espresso.onView;
29+
import static androidx.test.espresso.action.ViewActions.click;
30+
import static androidx.test.espresso.matcher.ViewMatchers.withId;
31+
import static androidx.test.espresso.matcher.ViewMatchers.withText;
3232
import static org.hamcrest.Matchers.anything;
3333
import static org.hamcrest.core.AnyOf.anyOf;
3434

src/androidTest/disabledTests/uiautomator/InitialTest.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
import android.content.Intent;
2222
import android.content.pm.PackageManager;
2323
import android.content.pm.ResolveInfo;
24-
import android.support.test.InstrumentationRegistry;
25-
import android.support.test.filters.SdkSuppress;
26-
import android.support.test.runner.AndroidJUnit4;
27-
import android.support.test.uiautomator.UiDevice;
28-
import android.support.test.uiautomator.UiObject;
29-
import android.support.test.uiautomator.UiObjectNotFoundException;
30-
import android.support.test.uiautomator.UiSelector;
24+
import androidx.test.InstrumentationRegistry;
25+
import androidx.test.filters.SdkSuppress;
26+
import androidx.test.runner.AndroidJUnit4;
27+
import androidx.test.uiautomator.UiDevice;
28+
import androidx.test.uiautomator.UiObject;
29+
import androidx.test.uiautomator.UiObjectNotFoundException;
30+
import androidx.test.uiautomator.UiSelector;
3131

3232
import org.junit.Before;
3333
import org.junit.Test;

src/androidTest/java/com/owncloud/android/AbstractIT.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
import android.accounts.OperationCanceledException;
77
import android.content.ActivityNotFoundException;
88
import android.content.Context;
9-
import android.support.test.InstrumentationRegistry;
10-
import android.support.test.runner.AndroidJUnit4;
119

1210
import com.owncloud.android.datamodel.FileDataStorageManager;
1311
import com.owncloud.android.lib.common.OwnCloudClient;
@@ -21,6 +19,9 @@
2119
import java.io.File;
2220
import java.io.IOException;
2321

22+
import androidx.test.InstrumentationRegistry;
23+
import androidx.test.runner.AndroidJUnit4;
24+
2425
/**
2526
* Common base for all integration tests
2627
*/

src/androidTest/java/com/owncloud/android/FileIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package com.owncloud.android;
22

3-
import android.support.test.runner.AndroidJUnit4;
4-
53
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
64
import com.owncloud.android.operations.CreateFolderOperation;
75
import com.owncloud.android.operations.common.SyncOperation;
86

97
import org.junit.Test;
108
import org.junit.runner.RunWith;
119

10+
import androidx.test.runner.AndroidJUnit4;
11+
1212
import static junit.framework.TestCase.assertTrue;
1313
import static org.junit.Assert.assertNull;
1414

src/androidTest/java/com/owncloud/android/UploadIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.owncloud.android;
22

3-
import android.support.test.runner.AndroidJUnit4;
4-
53
import com.owncloud.android.db.OCUpload;
64
import com.owncloud.android.files.services.FileUploader;
75
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
@@ -11,6 +9,8 @@
119
import org.junit.Test;
1210
import org.junit.runner.RunWith;
1311

12+
import androidx.test.runner.AndroidJUnit4;
13+
1414
import static junit.framework.TestCase.assertTrue;
1515

1616
/**

src/androidTest/java/com/owncloud/android/datamodel/OCFileUnitTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,14 @@
2121
package com.owncloud.android.datamodel;
2222

2323
import android.os.Parcel;
24-
import android.support.test.filters.SmallTest;
25-
import android.support.test.runner.AndroidJUnit4;
2624

2725
import org.junit.Before;
2826
import org.junit.Test;
2927
import org.junit.runner.RunWith;
3028

29+
import androidx.test.filters.SmallTest;
30+
import androidx.test.runner.AndroidJUnit4;
31+
3132
import static org.hamcrest.CoreMatchers.is;
3233
import static org.hamcrest.MatcherAssert.assertThat;
3334

src/androidTest/java/com/owncloud/android/datamodel/UploadStorageManagerTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import android.accounts.Account;
44
import android.content.ContentResolver;
55
import android.content.Context;
6-
import android.support.test.InstrumentationRegistry;
7-
import android.support.test.filters.SmallTest;
8-
import android.support.test.runner.AndroidJUnit4;
96

107
import com.owncloud.android.db.OCUpload;
118

@@ -17,6 +14,10 @@
1714

1815
import java.io.File;
1916

17+
import androidx.test.InstrumentationRegistry;
18+
import androidx.test.filters.SmallTest;
19+
import androidx.test.runner.AndroidJUnit4;
20+
2021
/**
2122
* Created by JARP on 6/7/17.
2223
*/

src/androidTest/java/com/owncloud/android/util/EncryptionTestIT.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
package com.owncloud.android.util;
2323

2424
import android.os.Build;
25-
import android.support.annotation.RequiresApi;
26-
import android.support.test.runner.AndroidJUnit4;
2725

2826
import com.google.gson.JsonElement;
2927
import com.google.gson.JsonParser;
@@ -50,7 +48,10 @@
5048
import java.util.HashSet;
5149
import java.util.Set;
5250

53-
import static android.support.test.InstrumentationRegistry.getInstrumentation;
51+
import androidx.annotation.RequiresApi;
52+
import androidx.test.runner.AndroidJUnit4;
53+
54+
import static androidx.test.InstrumentationRegistry.getInstrumentation;
5455
import static junit.framework.Assert.assertFalse;
5556
import static junit.framework.Assert.assertTrue;
5657
import static org.junit.Assert.assertEquals;

0 commit comments

Comments
 (0)