Skip to content

Commit

Permalink
AndroidX upgrade.
Browse files Browse the repository at this point in the history
Partially merge pull request #665.

Update to 1.6.0-SNAPSHOT
  • Loading branch information
mdzyuba committed Mar 9, 2021
1 parent 5cc93ec commit bdd2cfd
Show file tree
Hide file tree
Showing 42 changed files with 135 additions and 110 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:4.1.2'
}
}

Expand All @@ -16,6 +16,6 @@ allprojects {
}

ext {
compileSdkVersion = 28
targetSdkVersion = 28
compileSdkVersion = 30
targetSdkVersion = 30
}
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true

VERSION_NAME=1.5.2-SNAPSHOT
android.useAndroidX=true

VERSION_NAME=1.6.0-SNAPSHOT
GROUP=com.facebook.stetho
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Sun Sep 23 23:21:39 PDT 2018
#Mon Mar 08 22:57:34 PST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip
2 changes: 1 addition & 1 deletion stetho-js-rhino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This [Stetho](https://facebook.github.io/stetho) plugin adds a JavaScript consol
### Download
Download [the latest JARs](https://github.com/facebook/stetho/releases/latest) or grab via Gradle:
```groovy
compile 'com.facebook.stetho:stetho-js-rhino:1.4.2'
implementation 'com.facebook.stetho:stetho-js-rhino:1.4.2'
```
or Maven:
```xml
Expand Down
6 changes: 3 additions & 3 deletions stetho-js-rhino/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion 9
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand All @@ -19,9 +19,9 @@ android {

dependencies {
implementation project(':stetho')
implementation 'com.google.code.findbugs:jsr305:2.0.1'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'org.mozilla:rhino:1.7.6'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'androidx.annotation:annotation:1.1.0'

testImplementation 'junit:junit:4.12'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

package com.facebook.stetho.rhino;

import android.support.annotation.NonNull;

import java.util.Locale;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import androidx.annotation.NonNull;

/**
* <p>Formatter that tries to mimic <pre>console.log()</pre>'s format as close as possible.</p>
*
Expand Down Expand Up @@ -64,6 +64,7 @@ public char charAt(int index) {
return array[start + index];
}

@NonNull
@Override
public CharSequence subSequence(int start, int end) {
return new ArrayCharSequence(array, this.start + start, this.start + end);
Expand Down Expand Up @@ -124,7 +125,7 @@ public CharSequence subSequence(int start, int end) {
}

// Analyze the format. We don't have named captures in android yet so we will inspect
// the groups. They are each optional but we can find out which one is whic easily.
// the groups. They are each optional but we can find out which one is which easily.
// Remember that we want to parse: %[argument_index$][flags][width][.precision]conversion
//
// - `index` ends with '$'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@

package com.facebook.stetho.rhino;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.facebook.stetho.inspector.console.RuntimeRepl;

import org.mozilla.javascript.Context;
import org.mozilla.javascript.ScriptableObject;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

class JsRuntimeRepl implements RuntimeRepl {

private final @NonNull ScriptableObject mJsScope;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

package com.facebook.stetho.rhino;

import android.support.annotation.NonNull;
import android.util.Log;

import com.facebook.stetho.common.LogUtil;
import com.facebook.stetho.inspector.console.CLog;
import com.facebook.stetho.inspector.console.RuntimeRepl;
import com.facebook.stetho.inspector.console.RuntimeReplFactory;
import com.facebook.stetho.inspector.protocol.module.Console;

import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.ImporterTopLevel;
Expand All @@ -26,6 +27,8 @@
import java.util.Map;
import java.util.Set;

import androidx.annotation.NonNull;

/**
* <p>Builder used to setup the javascript runtime to be used by stetho.</p>
*
Expand Down
12 changes: 6 additions & 6 deletions stetho-okhttp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion 9
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand All @@ -21,20 +21,20 @@ android {

dependencies {
implementation project(':stetho')
implementation 'com.google.code.findbugs:jsr305:2.0.1'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.squareup.okhttp:okhttp:2.7.2'

testImplementation 'junit:junit:4.12'
testImplementation('org.robolectric:robolectric:2.4') {
exclude module: 'commons-logging'
exclude module: 'httpclient'
}
testImplementation 'org.powermock:powermock-api-mockito:1.6.1'
testImplementation 'org.powermock:powermock-module-junit4:1.6.1'
testImplementation 'org.powermock:powermock-api-mockito:1.6.6'
testImplementation 'org.powermock:powermock-module-junit4:1.6.6'

// Needed for Robolectric and PowerMock to be combined in a single test.
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.1'
testImplementation 'org.powermock:powermock-classloading-xstream:1.6.1'
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.6'
testImplementation 'org.powermock:powermock-classloading-xstream:1.6.6'

testImplementation 'com.squareup.okhttp:mockwebserver:2.7.2'
}
Expand Down
12 changes: 6 additions & 6 deletions stetho-okhttp3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion 9
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand All @@ -21,20 +21,20 @@ android {

dependencies {
implementation project(':stetho')
implementation 'com.google.code.findbugs:jsr305:2.0.1'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'com.squareup.okhttp3:okhttp:3.4.2'

testImplementation 'junit:junit:4.12'
testImplementation('org.robolectric:robolectric:2.4') {
exclude module: 'commons-logging'
exclude module: 'httpclient'
}
testImplementation 'org.powermock:powermock-api-mockito:1.6.1'
testImplementation 'org.powermock:powermock-module-junit4:1.6.1'
testImplementation 'org.powermock:powermock-api-mockito:1.6.6'
testImplementation 'org.powermock:powermock-module-junit4:1.6.6'

// Needed for Robolectric and PowerMock to be combined in a single test.
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.1'
testImplementation 'org.powermock:powermock-classloading-xstream:1.6.1'
testImplementation 'org.powermock:powermock-module-junit4-rule:1.6.6'
testImplementation 'org.powermock:powermock-classloading-xstream:1.6.6'

testImplementation 'com.squareup.okhttp3:mockwebserver:3.4.2'
}
Expand Down
10 changes: 5 additions & 5 deletions stetho-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ android {

defaultConfig {
applicationId "com.facebook.stetho.sample"
minSdkVersion 11
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand Down Expand Up @@ -43,8 +43,8 @@ dependencies {
// way to express this is:
//
// dependencies {
// debugCompile 'com.facebook.stetho:stetho:<VERSION>'
// compile 'com.facebook.stetho:stetho-urlconnection:<VERSION>'
// debugImplementation 'com.facebook.stetho:stetho:<VERSION>'
// implementation 'com.facebook.stetho:stetho-urlconnection:<VERSION>'
// }
//
// For Stetho developers, to verify locally that things are working
Expand All @@ -54,8 +54,8 @@ dependencies {
// ./gradlew installArchives
//
// Then uncomment the Maven style dependency and comment the project one:
//releaseCompile "com.facebook.stetho:stetho-urlconnection:${VERSION_NAME}"
//releaseImplementation "com.facebook.stetho:stetho-urlconnection:${VERSION_NAME}"
releaseImplementation project(':stetho-urlconnection')

implementation 'com.google.code.findbugs:jsr305:2.0.1'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import android.os.SystemClock;
import android.provider.CalendarContract;
import android.util.Log;

import com.facebook.stetho.DumperPluginsProvider;
import com.facebook.stetho.InspectorModulesProvider;
import com.facebook.stetho.Stetho;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

package com.facebook.stetho.sample;

import java.util.ArrayList;

import android.content.ContentProvider;
import android.content.ContentProviderOperation;
import android.content.ContentProviderResult;
Expand All @@ -20,6 +18,8 @@
import android.database.sqlite.SQLiteOpenHelper;
import android.net.Uri;

import java.util.ArrayList;

public class APODContentProvider extends ContentProvider {
private APODSQLiteOpenHelper mOpenHelper;

Expand Down
2 changes: 1 addition & 1 deletion stetho-timber/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion 11
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand Down
4 changes: 2 additions & 2 deletions stetho-urlconnection/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion 9
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand All @@ -13,7 +13,7 @@ android {

dependencies {
implementation project(':stetho')
implementation 'com.google.code.findbugs:jsr305:2.0.1'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
}

apply from: rootProject.file('release.gradle')
13 changes: 7 additions & 6 deletions stetho/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ android {
compileSdkVersion rootProject.ext.compileSdkVersion

defaultConfig {
minSdkVersion 9
minSdkVersion 14
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
Expand All @@ -15,18 +15,19 @@ android {

dependencies {
implementation 'commons-cli:commons-cli:1.2'
implementation 'com.google.code.findbugs:jsr305:2.0.1'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.google.code.findbugs:jsr305:3.0.2'
implementation 'androidx.annotation:annotation:1.1.0'

implementation 'com.android.support:appcompat-v7:23.0.1' // optional
// Optional: reflection is used to test whether Fragment (and the transient AndroidX Core) are actually present.
implementation 'androidx.appcompat:appcompat:1.2.0' // optional

testImplementation 'junit:junit:4.12'
testImplementation('org.robolectric:robolectric:2.4') {
exclude module: 'commons-logging'
exclude module: 'httpclient'
}
testImplementation 'org.powermock:powermock-api-mockito:1.6.1'
testImplementation 'org.powermock:powermock-module-junit4:1.6.1'
testImplementation 'org.powermock:powermock-api-mockito:1.6.6'
testImplementation 'org.powermock:powermock-module-junit4:1.6.6'
}

apply from: rootProject.file('release.gradle')
Expand Down
1 change: 0 additions & 1 deletion stetho/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
POM_NAME=Stetho
POM_ARTIFACT_ID=stetho
POM_OPTIONAL_DEPS=com.android.support:appcompat-v7
POM_PACKAGING=aar
7 changes: 4 additions & 3 deletions stetho/src/main/java/com/facebook/stetho/Stetho.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;

import com.facebook.stetho.common.LogUtil;
import com.facebook.stetho.common.Util;
import com.facebook.stetho.dumpapp.DumpappHttpSocketLikeHandler;
Expand Down Expand Up @@ -55,19 +56,19 @@
import com.facebook.stetho.server.AddressNameHelper;
import com.facebook.stetho.server.LazySocketHandler;
import com.facebook.stetho.server.LocalSocketServer;
import com.facebook.stetho.server.ServerManager;
import com.facebook.stetho.server.ProtocolDetectingSocketHandler;
import com.facebook.stetho.server.ServerManager;
import com.facebook.stetho.server.SocketHandler;
import com.facebook.stetho.server.SocketHandlerFactory;

import javax.annotation.Nullable;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.annotation.Nullable;

/**
* Initialization and configuration entry point for the Stetho debugging system. Simple usage with
* default plugins and features enabled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@

package com.facebook.stetho.common.android;

import android.support.annotation.Nullable;
import android.support.v4.view.ViewCompat;
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
Expand All @@ -21,6 +18,10 @@

import java.util.List;

import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import androidx.core.view.accessibility.AccessibilityNodeInfoCompat;

/**
* This class provides utility methods for determining certain accessibility properties of
* {@link View}s and {@link AccessibilityNodeInfoCompat}s. It is porting some of the checks from
Expand Down
Loading

0 comments on commit bdd2cfd

Please sign in to comment.