Skip to content

Commit

Permalink
Merge pull request #2519 from square/py/update_deps
Browse files Browse the repository at this point in the history
Update AGP
  • Loading branch information
pyricau committed May 19, 2023
2 parents b4677b2 + 133c259 commit f5ac30f
Show file tree
Hide file tree
Showing 74 changed files with 287 additions and 198 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'zulu'
- uses: gradle/gradle-build-action@v2
- name: Build project
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'zulu'
- uses: gradle/gradle-build-action@v2
- name: AVD cache
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 11
java-version: 17
distribution: 'zulu'
- uses: gradle/gradle-build-action@v2
- name: Deploy snapshot
Expand Down
18 changes: 11 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ subprojects {
}
}

// Config shared for subprojects except leakcanary-deobfuscation-gradle-plugin
configure(subprojects.findAll {
!(["leakcanary-deobfuscation-gradle-plugin"].contains(it.name))
}) {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = '1.8'
}
}
}

// Config shared for subprojects except apps
configure(subprojects.findAll {
!(["leakcanary-app", "leakcanary-android-sample"].contains(it.name))
Expand Down Expand Up @@ -135,13 +146,6 @@ configure(subprojects.findAll {
sonatypeHost = "S01"
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
// Avoid warnings of using older stdlib version 1.3 than compiler version 1.4
apiVersion = "1.3"
}
}
}

//Copies git hooks from /hooks folder into .git; currently used to run Detekt during push
Expand Down
9 changes: 8 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

Please thank our [contributors](https://github.com/square/leakcanary/graphs/contributors) 🙏 🙏 🙏.

## Version 3.0 (TBD)

### Bumped dependencies

* Kotlin: updated to 1.8.21
*

## Version 2.11 (2023-05-17)

This is most likely the last release before the work starts on LeakCanary 3.0.
Expand All @@ -20,7 +27,7 @@ This is most likely the last release before the work starts on LeakCanary 3.0.
```
brew install leakcanary-shark
shark-cli --process com.example.app.debug neo4j
shark-cli --process com.example.app.debug neo4j
```

![Neo4J heap dump](https://user-images.githubusercontent.com/557033/200693468-aa783bb4-9a5a-4a41-8b92-582d44b31b92.png)
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ org.gradle.caching=true
org.gradle.configureondemand=true
org.gradle.jvmargs=-XX:+UseParallelGC -Dfile.encoding=UTF-8
org.gradle.parallel=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false
17 changes: 8 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,23 @@
[versions]
# We would like to use Kotlin recent language features but keep Kotlin 1.3 library APIs
# The benefit is that depending clients do not have to upgrade to Kotlin 1.4
kotlinCompiler = "1.6.10"
kotlinLib = "1.3.72"
kotlin = "1.8.21"
androidXTest = "1.1.0"
androidXJunit = "1.1.3"
workManager = "2.7.0"

[libraries]
gradlePlugin-android = { module = "com.android.tools.build:gradle", version = "7.3.0-rc01" }
gradlePlugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlinCompiler" }
gradlePlugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.6.20" }
gradlePlugin-binaryCompatibility = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version = "0.8.0" }
gradlePlugin-android = { module = "com.android.tools.build:gradle", version = "8.0.0" }
gradlePlugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
gradlePlugin-dokka = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version = "1.8.10" }
gradlePlugin-binaryCompatibility = { module = "org.jetbrains.kotlinx:binary-compatibility-validator", version = "0.13.1" }
gradlePlugin-mavenPublish = { module = "com.vanniktech:gradle-maven-publish-plugin", version = "0.18.0" }
gradlePlugin-detekt = { module = "io.gitlab.arturbosch.detekt:detekt-gradle-plugin", version = "1.6.0" }
gradlePlugin-keeper = { module = "com.slack.keeper:keeper", version = "0.7.0" }
gradlePlugin-sqldelight = { module = "com.squareup.sqldelight:gradle-plugin", version = "1.5.3" }
gradlePlugin-sqldelight = { module = "app.cash.sqldelight:gradle-plugin", version = "2.0.0-alpha05" }

kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlinLib" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlinLib" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }

# We don't need the latest version of AndroidX (there are no bugs that impact what LeakCanary
# relies on), we're sticking a bit older because most apps will be using a more recent version
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 4 additions & 2 deletions leakcanary/leakcanary-android-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ android {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
}
lintOptions {
namespace 'com.squareup.leakcanary.core'
testNamespace 'com.squareup.leakcanary.core.test'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
checkOnly 'Interoperability'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest package="com.squareup.leakcanary.core.test" />
<manifest />
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@
~ limitations under the License.
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.squareup.leakcanary.core"
>
xmlns:android="http://schemas.android.com/apk/res/android">

<!-- To store the heap dumps and leak analysis results. -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ object LogcatEventListener : EventListener {
is HeapAnalysisDone<*> -> {
SharkLog.d { "\u200B\n${LeakTraceWrapper.wrap(event.heapAnalysis.toString(), 120)}" }
}
else -> {}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ object ToastEventListener : EventListener {
toastCurrentlyShown = null
}
}
else -> {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ object TvEventListener : EventListener {
showToast(event.heapAnalysis)
printIntentInfo()
}
else -> {}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ internal object HeapDumpRenderer {
is LoadClassRecord -> {
classNames[record.id] = record.classNameStringId
}
else -> {}
}
val localCurrentRecord = currentRecord
when {
Expand Down
7 changes: 4 additions & 3 deletions leakcanary/leakcanary-android-instrumentation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures.buildConfig = false
lintOptions {
namespace 'com.squareup.leakcanary.instrumentation'
testNamespace 'com.squareup.leakcanary.instrumentation.test'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
checkOnly 'Interoperability'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.squareup.leakcanary.instrumentation.test">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<activity android:name="leakcanary.TestActivity"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest package="com.squareup.leakcanary.instrumentation">
<manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ class InstrumentationLeakDetector {
@Suppress("ReturnCount")
fun detectLeaks(): Result {
val retainedObjectsChecker = AndroidDetectLeaksInterceptor()
when(val yesNo = retainedObjectsChecker.waitUntilReadyForHeapAnalysis()) {
is NoHeapAnalysis -> {
return NoAnalysis(yesNo.reason)
}
val yesNo = retainedObjectsChecker.waitUntilReadyForHeapAnalysis()
if (yesNo is NoHeapAnalysis) {
return NoAnalysis(yesNo.reason)
}

val heapDumpFile = InstrumentationHeapDumpFileProvider().newHeapDumpFile()
Expand Down
6 changes: 3 additions & 3 deletions leakcanary/leakcanary-android-process/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ android {
minSdk versions.minSdk
}
buildFeatures.buildConfig = false
lintOptions {
namespace 'com.squareup.leakcanary'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
checkOnly 'Interoperability'
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.squareup.leakcanary">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<service
Expand Down
5 changes: 3 additions & 2 deletions leakcanary/leakcanary-android-release/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ android {
buildConfigField "String", "GIT_SHA", "\"${gitSha()}\""
consumerProguardFiles 'consumer-proguard-rules.pro'
}
lintOptions {
namespace 'com.squareup.leakcanary.release'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
checkOnly 'Interoperability'
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.squareup.leakcanary.release" />
<manifest />
6 changes: 3 additions & 3 deletions leakcanary/leakcanary-android-startup/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ android {
minSdk versions.minSdk
}
buildFeatures.buildConfig = false
lintOptions {
namespace 'com.squareup.leakcanary.startup'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
checkOnly 'Interoperability'
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.squareup.leakcanary.startup" />
<manifest />
5 changes: 3 additions & 2 deletions leakcanary/leakcanary-android-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ android {
minSdk versions.minSdk
}
buildFeatures.buildConfig = false
lintOptions {
namespace 'com.squareup.leakcanary.utils'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
error 'ObsoleteSdkInt'
checkOnly 'Interoperability'
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.squareup.leakcanary.utils" />
<manifest />
6 changes: 3 additions & 3 deletions leakcanary/leakcanary-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildFeatures.buildConfig = false
lintOptions {
namespace 'com.squareup.leakcanary'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
checkOnly 'Interoperability'
}
}
2 changes: 1 addition & 1 deletion leakcanary/leakcanary-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest package="com.squareup.leakcanary" />
<manifest />
9 changes: 6 additions & 3 deletions leakcanary/leakcanary-app-aidl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ android {
defaultConfig {
minSdk versions.minSdk
}
buildFeatures {
aidl true
}
buildFeatures.buildConfig = false
lintOptions {
namespace 'com.squareup.leakcanary.app.aidl'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
checkOnly 'Interoperability'
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.squareup.leakcanary.app.aidl" />
<manifest />
6 changes: 3 additions & 3 deletions leakcanary/leakcanary-app-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ android {
minSdk versions.minSdk
}
buildFeatures.buildConfig = false
lintOptions {
namespace 'com.squareup.leakcanary.app.service'
lint {
checkOnly 'Interoperability'
disable 'GoogleAppIndexingWarning'
// junit references java.lang.management
ignore 'InvalidPackage'
checkOnly 'Interoperability'
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.squareup.leakcanary.app.service">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>
<service
Expand Down
Loading

0 comments on commit f5ac30f

Please sign in to comment.