Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/rohitjakhar/chucker into sh…
Browse files Browse the repository at this point in the history
…are_multiple_request

# Conflicts:
#	library/src/main/kotlin/com/chuckerteam/chucker/internal/ui/MainActivity.kt
#	library/src/main/kotlin/com/chuckerteam/chucker/internal/ui/transaction/TransactionAdapter.kt
  • Loading branch information
rohitjakhar committed Dec 16, 2023
2 parents 9e41073 + 7c3537b commit 5b58ed1
Show file tree
Hide file tree
Showing 125 changed files with 2,446 additions and 1,918 deletions.
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
ktlint_disabled_rules=function-start-of-body-spacing

[*.yml]
indent_size = 2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-and-release-repository.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/pre-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -63,7 +63,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -82,7 +82,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -101,7 +101,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand All @@ -120,7 +120,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17'
Expand Down
22 changes: 11 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
buildscript {
ext {
kotlinVersion = '1.9.10'
androidGradleVersion = '8.1.2'
kotlinVersion = '1.9.21'
androidGradleVersion = '8.2.0'
coroutineVersion = '1.7.3'

// Google libraries
activityVersion = '1.8.0'
activityVersion = '1.8.1'
appCompatVersion = '1.6.1'
constraintLayoutVersion = '2.1.4'
materialComponentsVersion = '1.10.0'
fragmentVersion = '1.6.1'
roomVersion = '2.5.2'
fragmentVersion = '1.6.2'
roomVersion = '2.6.1'
lifecycleVersion = '2.6.2'
androidXCoreVersion = '2.2.0'
paletteKtxVersion = '1.0.0'
kspVersion = '1.9.10-1.0.13'
kspVersion = '1.9.21-1.0.15'

// Networking
brotliVersion = '0.1.2'
gsonVersion = '2.10.1'
okhttpVersion = '4.11.0'
retrofitVersion = '2.9.0'
wireVersion = '4.9.1'
wireVersion = '4.9.3'

// Debug and quality control
binaryCompatibilityValidator = '0.13.2'
detektVersion = '1.23.1'
ktLintGradleVersion = '11.6.1'
detektVersion = '1.23.4'
ktLintGradleVersion = '12.0.2'
leakcanaryVersion = '2.12'

// Apollo
apolloVersion = '3.8.2'

// Testing
androidxTestCoreVersion = '1.5.0'
junitGradlePluignVersion = '1.9.3.0'
junitVersion = '5.10.0'
junitGradlePluignVersion = '1.10.0.0'
junitVersion = '5.10.1'
junit4Version = '4.13.2'
mockkVersion = '1.13.8'
robolectricVersion = '4.11'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
29 changes: 17 additions & 12 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ import okio.IOException
*/
public interface BodyDecoder {
@Throws(IOException::class)
public fun decodeRequest(request: Request, body: ByteString): String?
public fun decodeRequest(
request: Request,
body: ByteString,
): String?

@Throws(IOException::class)
public fun decodeResponse(response: Response, body: ByteString): String?
public fun decodeResponse(
response: Response,
body: ByteString,
): String?
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import android.content.Intent
*/
@Suppress("UnusedPrivateMember", "UNUSED_PARAMETER")
public object Chucker {

@Suppress("MayBeConst ") // https://github.com/ChuckerTeam/chucker/pull/169#discussion_r362341353
public val isOp: Boolean = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ import android.net.Uri
* No-op implementation.
*/
@Suppress("UnusedPrivateMember", "UNUSED_PARAMETER")
public class ChuckerCollector @JvmOverloads constructor(
context: Context,
public var showNotification: Boolean = true,
retentionPeriod: RetentionManager.Period = RetentionManager.Period.ONE_WEEK
) {
@Suppress("FunctionOnlyReturningConstant")
public fun writeTransactions(
public class ChuckerCollector
@JvmOverloads
constructor(
context: Context,
startTimestamp: Long?,
exportFormat: ExportFormat = ExportFormat.LOG
): Uri? = null
}
public var showNotification: Boolean = true,
retentionPeriod: RetentionManager.Period = RetentionManager.Period.ONE_WEEK,
) {
@Suppress("FunctionOnlyReturningConstant")
public fun writeTransactions(
context: Context,
startTimestamp: Long?,
exportFormat: ExportFormat = ExportFormat.LOG,
): Uri? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import java.io.IOException
*/
@Suppress("UnusedPrivateMember", "UNUSED_PARAMETER")
public class ChuckerInterceptor private constructor(
builder: Builder
builder: Builder,
) : Interceptor {

/**
* No-op implementation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ public enum class ExportFormat(public val extension: String) {
LOG("txt"),

/** HAR format with har extension */
HAR("har")
HAR("har"),
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ import android.content.Context
* No-op implementation.
*/
@Suppress("UnusedPrivateMember", "UNUSED_PARAMETER")
public class RetentionManager @JvmOverloads constructor(
context: Context,
retentionPeriod: Any? = null
) {
public class RetentionManager
@JvmOverloads
constructor(
context: Context,
retentionPeriod: Any? = null,
) {
@Synchronized
public fun doMaintenance() {
// Empty method for the library-no-op artifact
}

@Synchronized
public fun doMaintenance() {
// Empty method for the library-no-op artifact
public enum class Period {
ONE_HOUR,
ONE_DAY,
ONE_WEEK,
FOREVER,
}
}

public enum class Period {
ONE_HOUR,
ONE_DAY,
ONE_WEEK,
FOREVER
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ public interface BodyDecoder {
* uncompressed even if [request] has gzip or br header.
*/
@Throws(IOException::class)
public fun decodeRequest(request: Request, body: ByteString): String?
public fun decodeRequest(
request: Request,
body: ByteString,
): String?

/**
* Returns a text representation of [body] that will be displayed in Chucker UI transaction,
Expand All @@ -25,5 +28,8 @@ public interface BodyDecoder {
* uncompressed even if [response] has gzip or br header.
*/
@Throws(IOException::class)
public fun decodeResponse(response: Response, body: ByteString): String?
public fun decodeResponse(
response: Response,
body: ByteString,
): String?
}
Loading

0 comments on commit 5b58ed1

Please sign in to comment.