From a66983d5c306b78592d7ae8134e5026b137cae8a Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 1 Dec 2022 15:18:10 +0000 Subject: [PATCH 01/91] Update README Summary: Test Plan: --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4f88415fe21..727eed42337 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@

- Flipper (formerly Sonar) is a platform for debugging mobile apps on iOS and Android and, recently, even JS apps in your browser or in Node.js. Visualize, inspect, and control your apps from a simple desktop interface. Use Flipper as is or extend it using the plugin API. + Flipper (formerly Sonar) is a platform for debugging mobile apps on iOS and Android and JS apps in your browser or in Node.js. Visualize, inspect, and control your apps from a simple desktop interface. Use Flipper as is or extend it using the plugin API.

![Flipper](website/static/img/inspector.png) From 0b4e4e77f9121d7f438c46f459b1c18dd69a6c52 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 10:42:35 +0100 Subject: [PATCH 02/91] [android] Remove deprecated kotlin plugin Summary: See https://goo.gle/kotlin-android-extensions-deprecation. We don't seem to be making use of the extension. Test Plan: ``` ./gradlew :android:assembleDebug ``` CI --- android/plugins/leakcanary2/build.gradle | 1 - android/plugins/retrofit2-protobuf/build.gradle | 1 - android/tutorial/build.gradle | 1 - 3 files changed, 3 deletions(-) diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index 32193b02c1c..c4a17c37b1b 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -7,7 +7,6 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index 6e772bfd838..e48ac8ec529 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -7,7 +7,6 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 4710cd52231..2ee7e9ee02a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -7,7 +7,6 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' -apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' android { From 63899dbd53c4a641d92ee366eec43dde2e256e85 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:24:15 +0100 Subject: [PATCH 03/91] [android] Upgrade GitHub workflow java version --- .github/workflows/android-sample.yml | 2 +- .github/workflows/publish-android.yml | 2 +- .github/workflows/react-native-example.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android-sample.yml b/.github/workflows/android-sample.yml index 3b12b5744e7..98751227809 100644 --- a/.github/workflows/android-sample.yml +++ b/.github/workflows/android-sample.yml @@ -11,7 +11,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ./scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index ce9f9794a6b..c9bb9035115 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -21,7 +21,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Write GPG Sec Ring run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - name: Update gradle.properties diff --git a/.github/workflows/react-native-example.yml b/.github/workflows/react-native-example.yml index f16f4c4690a..6d9a87e6ac4 100644 --- a/.github/workflows/react-native-example.yml +++ b/.github/workflows/react-native-example.yml @@ -41,7 +41,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ${GITHUB_WORKSPACE}/scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 From ba709f7f38c6512f607be13f7a18016ce6ddf906 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:24:16 +0100 Subject: [PATCH 04/91] [android] Upgrade gradle project Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: --- android/build.gradle | 1 + android/no-op/build.gradle | 8 +------- android/plugins/leakcanary/build.gradle | 1 + android/plugins/leakcanary2/build.gradle | 1 + android/plugins/litho/build.gradle | 1 + android/plugins/network/build.gradle | 1 + android/plugins/retrofit2-protobuf/build.gradle | 1 + android/sample/build.gradle | 1 + android/third-party/build.gradle | 1 + android/tutorial/build.gradle | 1 + build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 3 +-- xplat/build.gradle | 1 + 14 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 13bc5f8dc94..e656d0ae61a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index 7301ca4187a..ac84a9a4199 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -30,10 +31,3 @@ android { } apply plugin: 'com.vanniktech.maven.publish' - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts.add('archives', sourcesJar) diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle index 0c6388fb3e9..12bd4693353 100644 --- a/android/plugins/leakcanary/build.gradle +++ b/android/plugins/leakcanary/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.leakcanary' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index c4a17c37b1b..d141f408df3 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.leakcanary2' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 33b61a525ea..9b8494679ba 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.facebook.flipper.plugins.litho' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/network/build.gradle b/android/plugins/network/build.gradle index c4a3cd27a3f..f2e02bdd7da 100644 --- a/android/plugins/network/build.gradle +++ b/android/plugins/network/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.network' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index e48ac8ec529..b807c0de83c 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.retrofit2protobuf' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 123203b200f..ea77a1b5edc 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.application' android { + namespace 'com.facebook.flipper.sample' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/build.gradle b/android/third-party/build.gradle index 8edd35ffaae..6773963e359 100644 --- a/android/third-party/build.gradle +++ b/android/third-party/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply from: 'native.gradle' android { + namespace 'com.facebook.flipper.thirdparty' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2ee7e9ee02a..4f55e38b88a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.sample.tutorial' defaultConfig { applicationId "com.facebook.flipper.sample.tutorial" diff --git a/build.gradle b/build.gradle index 209e119462c..0155e1ac040 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.0' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" diff --git a/gradle.properties b/gradle.properties index 9b93fa895fc..5b81e897f52 100644 --- a/gradle.properties +++ b/gradle.properties @@ -32,3 +32,6 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d040d74f09..bd5c569f737 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xplat/build.gradle b/xplat/build.gradle index 71e3e2fa150..450908e6ecf 100644 --- a/xplat/build.gradle +++ b/xplat/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.xplat.sonar' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion From d01d263290c64b0636f1c1d0698601a7142db04e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:27:29 +0100 Subject: [PATCH 05/91] [android] Upgrade GitHub workflow java version --- .github/workflows/android-sample.yml | 2 +- .github/workflows/publish-android.yml | 2 +- .github/workflows/react-native-example.yml | 2 +- gradle.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android-sample.yml b/.github/workflows/android-sample.yml index 3b12b5744e7..98751227809 100644 --- a/.github/workflows/android-sample.yml +++ b/.github/workflows/android-sample.yml @@ -11,7 +11,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ./scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index ce9f9794a6b..c9bb9035115 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -21,7 +21,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Write GPG Sec Ring run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - name: Update gradle.properties diff --git a/.github/workflows/react-native-example.yml b/.github/workflows/react-native-example.yml index f16f4c4690a..6d9a87e6ac4 100644 --- a/.github/workflows/react-native-example.yml +++ b/.github/workflows/react-native-example.yml @@ -41,7 +41,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ${GITHUB_WORKSPACE}/scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/gradle.properties b/gradle.properties index 9b93fa895fc..7e8284e3dae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 -org.gradle.jvmargs=-Xmx2g -Xms512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled +org.gradle.jvmargs=-Xmx2g -Xms512m -XX:+CMSClassUnloadingEnabled systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true From dd67170a8baac1731730e2b438d785b05a2a7817 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:24:16 +0100 Subject: [PATCH 06/91] [android] Upgrade gradle project Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: --- android/build.gradle | 1 + android/no-op/build.gradle | 8 +------- android/plugins/leakcanary/build.gradle | 1 + android/plugins/leakcanary2/build.gradle | 1 + android/plugins/litho/build.gradle | 1 + android/plugins/network/build.gradle | 1 + android/plugins/retrofit2-protobuf/build.gradle | 1 + android/sample/build.gradle | 1 + android/third-party/build.gradle | 1 + android/tutorial/build.gradle | 1 + build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 3 +-- xplat/build.gradle | 1 + 14 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 13bc5f8dc94..e656d0ae61a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index 7301ca4187a..ac84a9a4199 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -30,10 +31,3 @@ android { } apply plugin: 'com.vanniktech.maven.publish' - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts.add('archives', sourcesJar) diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle index 0c6388fb3e9..12bd4693353 100644 --- a/android/plugins/leakcanary/build.gradle +++ b/android/plugins/leakcanary/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.leakcanary' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index c4a17c37b1b..d141f408df3 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.leakcanary2' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 33b61a525ea..9b8494679ba 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.facebook.flipper.plugins.litho' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/network/build.gradle b/android/plugins/network/build.gradle index c4a3cd27a3f..f2e02bdd7da 100644 --- a/android/plugins/network/build.gradle +++ b/android/plugins/network/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.network' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index e48ac8ec529..b807c0de83c 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.retrofit2protobuf' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 123203b200f..ea77a1b5edc 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.application' android { + namespace 'com.facebook.flipper.sample' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/build.gradle b/android/third-party/build.gradle index 8edd35ffaae..6773963e359 100644 --- a/android/third-party/build.gradle +++ b/android/third-party/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply from: 'native.gradle' android { + namespace 'com.facebook.flipper.thirdparty' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2ee7e9ee02a..4f55e38b88a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.sample.tutorial' defaultConfig { applicationId "com.facebook.flipper.sample.tutorial" diff --git a/build.gradle b/build.gradle index 209e119462c..0155e1ac040 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.0' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" diff --git a/gradle.properties b/gradle.properties index 7e8284e3dae..1e97c3ff2a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -32,3 +32,6 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d040d74f09..bd5c569f737 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xplat/build.gradle b/xplat/build.gradle index 71e3e2fa150..450908e6ecf 100644 --- a/xplat/build.gradle +++ b/xplat/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.xplat.sonar' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion From 89f36d87c55cd92909dff5bd593cda85994bc83e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:28:26 +0100 Subject: [PATCH 07/91] [android] Upgrade GitHub workflow java version Summary: Version 8 of AGP requires Java 17+. Let's upgrade it here. There are some flags that are no longer supported, hence the update to gradle.properties. Test Plan: - CI --- .github/workflows/android-sample.yml | 2 +- .github/workflows/publish-android.yml | 2 +- .github/workflows/react-native-example.yml | 2 +- gradle.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android-sample.yml b/.github/workflows/android-sample.yml index 3b12b5744e7..98751227809 100644 --- a/.github/workflows/android-sample.yml +++ b/.github/workflows/android-sample.yml @@ -11,7 +11,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ./scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index ce9f9794a6b..c9bb9035115 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -21,7 +21,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Write GPG Sec Ring run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - name: Update gradle.properties diff --git a/.github/workflows/react-native-example.yml b/.github/workflows/react-native-example.yml index f16f4c4690a..6d9a87e6ac4 100644 --- a/.github/workflows/react-native-example.yml +++ b/.github/workflows/react-native-example.yml @@ -41,7 +41,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ${GITHUB_WORKSPACE}/scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/gradle.properties b/gradle.properties index 9b93fa895fc..7e8284e3dae 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 -org.gradle.jvmargs=-Xmx2g -Xms512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled +org.gradle.jvmargs=-Xmx2g -Xms512m -XX:+CMSClassUnloadingEnabled systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true From c65a6ac079324d03883aa6c48b445def4c8faeb3 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:29:06 +0100 Subject: [PATCH 08/91] [android] Upgrade gradle project Summary: Makes us compatible with Android Studio Flamingo and unlocks upgrades to Kotlin (which we need to be in sync with fbsource). Test Plan: - ./gradlew :android:assembleDebug - Android Studio Sync - CI Tasks: T153938450 Tags: --- android/build.gradle | 1 + android/no-op/build.gradle | 8 +------- android/plugins/leakcanary/build.gradle | 1 + android/plugins/leakcanary2/build.gradle | 1 + android/plugins/litho/build.gradle | 1 + android/plugins/network/build.gradle | 1 + android/plugins/retrofit2-protobuf/build.gradle | 1 + android/sample/build.gradle | 1 + android/third-party/build.gradle | 1 + android/tutorial/build.gradle | 1 + build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 3 +-- xplat/build.gradle | 1 + 14 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 13bc5f8dc94..e656d0ae61a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index 7301ca4187a..ac84a9a4199 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -30,10 +31,3 @@ android { } apply plugin: 'com.vanniktech.maven.publish' - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts.add('archives', sourcesJar) diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle index 0c6388fb3e9..12bd4693353 100644 --- a/android/plugins/leakcanary/build.gradle +++ b/android/plugins/leakcanary/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.leakcanary' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index c4a17c37b1b..d141f408df3 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.leakcanary2' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 33b61a525ea..9b8494679ba 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.facebook.flipper.plugins.litho' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/network/build.gradle b/android/plugins/network/build.gradle index c4a3cd27a3f..f2e02bdd7da 100644 --- a/android/plugins/network/build.gradle +++ b/android/plugins/network/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.network' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index e48ac8ec529..b807c0de83c 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.retrofit2protobuf' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 123203b200f..ea77a1b5edc 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.application' android { + namespace 'com.facebook.flipper.sample' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/build.gradle b/android/third-party/build.gradle index 8edd35ffaae..6773963e359 100644 --- a/android/third-party/build.gradle +++ b/android/third-party/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply from: 'native.gradle' android { + namespace 'com.facebook.flipper.thirdparty' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2ee7e9ee02a..4f55e38b88a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.sample.tutorial' defaultConfig { applicationId "com.facebook.flipper.sample.tutorial" diff --git a/build.gradle b/build.gradle index 209e119462c..0155e1ac040 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.0' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" diff --git a/gradle.properties b/gradle.properties index 7e8284e3dae..1e97c3ff2a3 100644 --- a/gradle.properties +++ b/gradle.properties @@ -32,3 +32,6 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d040d74f09..bd5c569f737 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xplat/build.gradle b/xplat/build.gradle index 71e3e2fa150..450908e6ecf 100644 --- a/xplat/build.gradle +++ b/xplat/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.xplat.sonar' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion From 3e0d2df75894bc52012c42337ce938a0f98d6d1e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:33:22 +0100 Subject: [PATCH 09/91] [android] Upgrade GitHub workflow java version Summary: Version 8 of AGP requires Java 17+. Let's upgrade it here. There are some flags that are no longer supported, hence the update to gradle.properties. Test Plan: - CI --- .github/workflows/android-sample.yml | 2 +- .github/workflows/publish-android.yml | 2 +- .github/workflows/react-native-example.yml | 2 +- gradle.properties | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android-sample.yml b/.github/workflows/android-sample.yml index 3b12b5744e7..98751227809 100644 --- a/.github/workflows/android-sample.yml +++ b/.github/workflows/android-sample.yml @@ -11,7 +11,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ./scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index ce9f9794a6b..c9bb9035115 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -21,7 +21,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Write GPG Sec Ring run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - name: Update gradle.properties diff --git a/.github/workflows/react-native-example.yml b/.github/workflows/react-native-example.yml index f16f4c4690a..6d9a87e6ac4 100644 --- a/.github/workflows/react-native-example.yml +++ b/.github/workflows/react-native-example.yml @@ -41,7 +41,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ${GITHUB_WORKSPACE}/scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/gradle.properties b/gradle.properties index 9b93fa895fc..9c534e24b31 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 -org.gradle.jvmargs=-Xmx2g -Xms512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled +org.gradle.jvmargs=-Xmx2g -Xms512m systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true From 0006237bd4ba485b25a155eeaa68d1afc0ad40f6 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:29:06 +0100 Subject: [PATCH 10/91] [android] Upgrade gradle project Summary: Makes us compatible with Android Studio Flamingo and unlocks upgrades to Kotlin (which we need to be in sync with fbsource). Test Plan: - ./gradlew :android:assembleDebug - Android Studio Sync - CI Tasks: T153938450 Tags: --- android/build.gradle | 1 + android/no-op/build.gradle | 8 +------- android/plugins/leakcanary/build.gradle | 1 + android/plugins/leakcanary2/build.gradle | 1 + android/plugins/litho/build.gradle | 1 + android/plugins/network/build.gradle | 1 + android/plugins/retrofit2-protobuf/build.gradle | 1 + android/sample/build.gradle | 1 + android/third-party/build.gradle | 1 + android/tutorial/build.gradle | 1 + build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 3 +-- xplat/build.gradle | 1 + 14 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 13bc5f8dc94..e656d0ae61a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index 7301ca4187a..ac84a9a4199 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -30,10 +31,3 @@ android { } apply plugin: 'com.vanniktech.maven.publish' - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts.add('archives', sourcesJar) diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle index 0c6388fb3e9..12bd4693353 100644 --- a/android/plugins/leakcanary/build.gradle +++ b/android/plugins/leakcanary/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.leakcanary' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index c4a17c37b1b..d141f408df3 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.leakcanary2' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 33b61a525ea..9b8494679ba 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.facebook.flipper.plugins.litho' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/network/build.gradle b/android/plugins/network/build.gradle index c4a3cd27a3f..f2e02bdd7da 100644 --- a/android/plugins/network/build.gradle +++ b/android/plugins/network/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.network' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index e48ac8ec529..b807c0de83c 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.retrofit2protobuf' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 123203b200f..ea77a1b5edc 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.application' android { + namespace 'com.facebook.flipper.sample' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/build.gradle b/android/third-party/build.gradle index 8edd35ffaae..6773963e359 100644 --- a/android/third-party/build.gradle +++ b/android/third-party/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply from: 'native.gradle' android { + namespace 'com.facebook.flipper.thirdparty' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2ee7e9ee02a..4f55e38b88a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.sample.tutorial' defaultConfig { applicationId "com.facebook.flipper.sample.tutorial" diff --git a/build.gradle b/build.gradle index 209e119462c..0155e1ac040 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.0' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" diff --git a/gradle.properties b/gradle.properties index 9c534e24b31..74590f30f0f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -32,3 +32,6 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d040d74f09..bd5c569f737 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xplat/build.gradle b/xplat/build.gradle index 71e3e2fa150..450908e6ecf 100644 --- a/xplat/build.gradle +++ b/xplat/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.xplat.sonar' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion From ef6b5cac573d76e6fd020b9dd90e6b1bf0cc7c55 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:40:48 +0100 Subject: [PATCH 11/91] [android] Get rid of deprecated package XML attribute Summary: We use the namespace everywhere now. Test Plan: See if this also works with Buck by importing. Tags: --- android/no-op/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary2/src/main/AndroidManifest.xml | 3 +-- android/plugins/litho/src/main/AndroidManifest.xml | 3 +-- android/plugins/network/src/main/AndroidManifest.xml | 3 +-- .../plugins/retrofit2-protobuf/src/main/AndroidManifest.xml | 3 +-- android/sample/AndroidManifest.xml | 5 +---- android/sample/build.gradle | 2 +- android/third-party/AndroidManifest.xml | 2 +- android/tutorial/src/main/AndroidManifest.xml | 3 +-- xplat/AndroidManifest.xml | 3 +-- 11 files changed, 11 insertions(+), 22 deletions(-) diff --git a/android/no-op/src/main/AndroidManifest.xml b/android/no-op/src/main/AndroidManifest.xml index 674594014c7..d0b0517be55 100644 --- a/android/no-op/src/main/AndroidManifest.xml +++ b/android/no-op/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary/src/main/AndroidManifest.xml b/android/plugins/leakcanary/src/main/AndroidManifest.xml index d39834f9f36..d0b0517be55 100644 --- a/android/plugins/leakcanary/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary2/src/main/AndroidManifest.xml b/android/plugins/leakcanary2/src/main/AndroidManifest.xml index bce194dc9aa..d0b0517be55 100644 --- a/android/plugins/leakcanary2/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary2/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/litho/src/main/AndroidManifest.xml b/android/plugins/litho/src/main/AndroidManifest.xml index 08eb3bb8336..d0b0517be55 100644 --- a/android/plugins/litho/src/main/AndroidManifest.xml +++ b/android/plugins/litho/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/network/src/main/AndroidManifest.xml b/android/plugins/network/src/main/AndroidManifest.xml index c43201fd374..d0b0517be55 100644 --- a/android/plugins/network/src/main/AndroidManifest.xml +++ b/android/plugins/network/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml index b6b9516aeac..d0b0517be55 100644 --- a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml +++ b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml index 5b6b0df3e45..1200d888842 100644 --- a/android/sample/AndroidManifest.xml +++ b/android/sample/AndroidManifest.xml @@ -8,11 +8,8 @@ --> + xmlns:tools="http://schemas.android.com/tools"> - - + diff --git a/android/tutorial/src/main/AndroidManifest.xml b/android/tutorial/src/main/AndroidManifest.xml index 99393e1dfed..7d88f54cbe7 100644 --- a/android/tutorial/src/main/AndroidManifest.xml +++ b/android/tutorial/src/main/AndroidManifest.xml @@ -5,8 +5,7 @@ ~ file in the root directory of this source tree. --> - + diff --git a/xplat/AndroidManifest.xml b/xplat/AndroidManifest.xml index d9fc4e52004..d0b0517be55 100644 --- a/xplat/AndroidManifest.xml +++ b/xplat/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + From db8350335d2d019efeef1274be57c0653b7572d2 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:49:35 +0100 Subject: [PATCH 12/91] [android] Upgrade GitHub workflow java version Summary: Version 8 of AGP requires Java 17+. Let's upgrade it here. There are some flags that are no longer supported, hence the update to gradle.properties. Test Plan: - CI --- .github/workflows/android-sample.yml | 2 +- .github/workflows/publish-android.yml | 2 +- .github/workflows/react-native-example.yml | 2 +- gradle.properties | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android-sample.yml b/.github/workflows/android-sample.yml index 3b12b5744e7..98751227809 100644 --- a/.github/workflows/android-sample.yml +++ b/.github/workflows/android-sample.yml @@ -11,7 +11,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ./scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index ce9f9794a6b..c9bb9035115 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -21,7 +21,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Write GPG Sec Ring run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - name: Update gradle.properties diff --git a/.github/workflows/react-native-example.yml b/.github/workflows/react-native-example.yml index f16f4c4690a..6d9a87e6ac4 100644 --- a/.github/workflows/react-native-example.yml +++ b/.github/workflows/react-native-example.yml @@ -41,7 +41,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ${GITHUB_WORKSPACE}/scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/gradle.properties b/gradle.properties index 9b93fa895fc..157db801a56 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,8 @@ NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 -org.gradle.jvmargs=-Xmx2g -Xms512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled +# The --add-opens is required for Litho's annotation processor on JDK 17 +org.gradle.jvmargs=-Xmx2g -Xms512m --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true From 6c6b8f593fd896f6474e427b6b6064df2685bf7c Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:29:06 +0100 Subject: [PATCH 13/91] [android] Upgrade gradle project Summary: Makes us compatible with Android Studio Flamingo and unlocks upgrades to Kotlin (which we need to be in sync with fbsource). Test Plan: - ./gradlew :android:assembleDebug - Android Studio Sync - CI Tasks: T153938450 Tags: --- android/build.gradle | 1 + android/no-op/build.gradle | 8 +------- android/plugins/leakcanary/build.gradle | 1 + android/plugins/leakcanary2/build.gradle | 1 + android/plugins/litho/build.gradle | 1 + android/plugins/network/build.gradle | 1 + android/plugins/retrofit2-protobuf/build.gradle | 1 + android/sample/build.gradle | 1 + android/third-party/build.gradle | 1 + android/tutorial/build.gradle | 1 + build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 3 +-- xplat/build.gradle | 1 + 14 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 13bc5f8dc94..e656d0ae61a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index 7301ca4187a..ac84a9a4199 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -30,10 +31,3 @@ android { } apply plugin: 'com.vanniktech.maven.publish' - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts.add('archives', sourcesJar) diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle index 0c6388fb3e9..12bd4693353 100644 --- a/android/plugins/leakcanary/build.gradle +++ b/android/plugins/leakcanary/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.leakcanary' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index c4a17c37b1b..d141f408df3 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.leakcanary2' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 33b61a525ea..9b8494679ba 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.facebook.flipper.plugins.litho' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/network/build.gradle b/android/plugins/network/build.gradle index c4a3cd27a3f..f2e02bdd7da 100644 --- a/android/plugins/network/build.gradle +++ b/android/plugins/network/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.network' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index e48ac8ec529..b807c0de83c 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.retrofit2protobuf' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 123203b200f..ea77a1b5edc 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.application' android { + namespace 'com.facebook.flipper.sample' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/build.gradle b/android/third-party/build.gradle index 8edd35ffaae..6773963e359 100644 --- a/android/third-party/build.gradle +++ b/android/third-party/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply from: 'native.gradle' android { + namespace 'com.facebook.flipper.thirdparty' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2ee7e9ee02a..4f55e38b88a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.sample.tutorial' defaultConfig { applicationId "com.facebook.flipper.sample.tutorial" diff --git a/build.gradle b/build.gradle index 209e119462c..0155e1ac040 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.0' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" diff --git a/gradle.properties b/gradle.properties index 157db801a56..92340ba69cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,3 +33,6 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d040d74f09..bd5c569f737 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xplat/build.gradle b/xplat/build.gradle index 71e3e2fa150..450908e6ecf 100644 --- a/xplat/build.gradle +++ b/xplat/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.xplat.sonar' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion From a1b21226bf113ea7c7fe867a9aacc3b654e5684f Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:40:48 +0100 Subject: [PATCH 14/91] [android] Get rid of deprecated package XML attribute Summary: We use the namespace everywhere now. Test Plan: See if this also works with Buck by importing. Tags: --- android/no-op/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary2/src/main/AndroidManifest.xml | 3 +-- android/plugins/litho/src/main/AndroidManifest.xml | 3 +-- android/plugins/network/src/main/AndroidManifest.xml | 3 +-- .../plugins/retrofit2-protobuf/src/main/AndroidManifest.xml | 3 +-- android/sample/AndroidManifest.xml | 5 +---- android/sample/build.gradle | 2 +- android/third-party/AndroidManifest.xml | 2 +- android/tutorial/src/main/AndroidManifest.xml | 3 +-- xplat/AndroidManifest.xml | 3 +-- 11 files changed, 11 insertions(+), 22 deletions(-) diff --git a/android/no-op/src/main/AndroidManifest.xml b/android/no-op/src/main/AndroidManifest.xml index 674594014c7..d0b0517be55 100644 --- a/android/no-op/src/main/AndroidManifest.xml +++ b/android/no-op/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary/src/main/AndroidManifest.xml b/android/plugins/leakcanary/src/main/AndroidManifest.xml index d39834f9f36..d0b0517be55 100644 --- a/android/plugins/leakcanary/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary2/src/main/AndroidManifest.xml b/android/plugins/leakcanary2/src/main/AndroidManifest.xml index bce194dc9aa..d0b0517be55 100644 --- a/android/plugins/leakcanary2/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary2/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/litho/src/main/AndroidManifest.xml b/android/plugins/litho/src/main/AndroidManifest.xml index 08eb3bb8336..d0b0517be55 100644 --- a/android/plugins/litho/src/main/AndroidManifest.xml +++ b/android/plugins/litho/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/network/src/main/AndroidManifest.xml b/android/plugins/network/src/main/AndroidManifest.xml index c43201fd374..d0b0517be55 100644 --- a/android/plugins/network/src/main/AndroidManifest.xml +++ b/android/plugins/network/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml index b6b9516aeac..d0b0517be55 100644 --- a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml +++ b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml index 5b6b0df3e45..1200d888842 100644 --- a/android/sample/AndroidManifest.xml +++ b/android/sample/AndroidManifest.xml @@ -8,11 +8,8 @@ --> + xmlns:tools="http://schemas.android.com/tools"> - - + diff --git a/android/tutorial/src/main/AndroidManifest.xml b/android/tutorial/src/main/AndroidManifest.xml index 99393e1dfed..7d88f54cbe7 100644 --- a/android/tutorial/src/main/AndroidManifest.xml +++ b/android/tutorial/src/main/AndroidManifest.xml @@ -5,8 +5,7 @@ ~ file in the root directory of this source tree. --> - + diff --git a/xplat/AndroidManifest.xml b/xplat/AndroidManifest.xml index d9fc4e52004..d0b0517be55 100644 --- a/xplat/AndroidManifest.xml +++ b/xplat/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + From dc80037b9e199ee70d588d9639fd7f58b86f9504 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:29:06 +0100 Subject: [PATCH 15/91] [android] Upgrade gradle project Summary: Makes us compatible with Android Studio Flamingo and unlocks upgrades to Kotlin (which we need to be in sync with fbsource). Test Plan: - ./gradlew :android:assembleDebug - Android Studio Sync - CI Tasks: T153938450 Tags: --- android/build.gradle | 1 + android/no-op/build.gradle | 8 +------- android/plugins/leakcanary/build.gradle | 1 + android/plugins/leakcanary2/build.gradle | 1 + android/plugins/litho/build.gradle | 1 + android/plugins/network/build.gradle | 1 + android/plugins/retrofit2-protobuf/build.gradle | 1 + android/sample/build.gradle | 1 + android/third-party/build.gradle | 1 + android/tutorial/build.gradle | 1 + build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 3 +-- xplat/build.gradle | 1 + 14 files changed, 16 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 13bc5f8dc94..e656d0ae61a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index 7301ca4187a..ac84a9a4199 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -30,10 +31,3 @@ android { } apply plugin: 'com.vanniktech.maven.publish' - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts.add('archives', sourcesJar) diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle index 0c6388fb3e9..12bd4693353 100644 --- a/android/plugins/leakcanary/build.gradle +++ b/android/plugins/leakcanary/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.leakcanary' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index c4a17c37b1b..d141f408df3 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.leakcanary2' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 33b61a525ea..9b8494679ba 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.facebook.flipper.plugins.litho' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/network/build.gradle b/android/plugins/network/build.gradle index c4a3cd27a3f..f2e02bdd7da 100644 --- a/android/plugins/network/build.gradle +++ b/android/plugins/network/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.network' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index e48ac8ec529..b807c0de83c 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.retrofit2protobuf' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 123203b200f..ea77a1b5edc 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.application' android { + namespace 'com.facebook.flipper.sample' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/build.gradle b/android/third-party/build.gradle index 8edd35ffaae..6773963e359 100644 --- a/android/third-party/build.gradle +++ b/android/third-party/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply from: 'native.gradle' android { + namespace 'com.facebook.flipper.thirdparty' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2ee7e9ee02a..4f55e38b88a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.sample.tutorial' defaultConfig { applicationId "com.facebook.flipper.sample.tutorial" diff --git a/build.gradle b/build.gradle index 209e119462c..0155e1ac040 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.0' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" diff --git a/gradle.properties b/gradle.properties index 157db801a56..92340ba69cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,3 +33,6 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d040d74f09..bd5c569f737 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xplat/build.gradle b/xplat/build.gradle index 71e3e2fa150..450908e6ecf 100644 --- a/xplat/build.gradle +++ b/xplat/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.xplat.sonar' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion From 2a0f63038be01f89560711c22b6be841309e7be8 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:07:04 +0100 Subject: [PATCH 16/91] [android] Upgrade GitHub workflow java version Summary: Version 8 of AGP requires Java 17+. Let's upgrade it here. There are some flags that are no longer supported, hence the update to gradle.properties. Test Plan: - CI --- .github/workflows/android-sample.yml | 2 +- .github/workflows/publish-android.yml | 2 +- gradle.properties | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/android-sample.yml b/.github/workflows/android-sample.yml index 3b12b5744e7..98751227809 100644 --- a/.github/workflows/android-sample.yml +++ b/.github/workflows/android-sample.yml @@ -11,7 +11,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Compute build cache run: ./scripts/checksum-android.sh checksum-android.txt - uses: actions/cache@v2 diff --git a/.github/workflows/publish-android.yml b/.github/workflows/publish-android.yml index ce9f9794a6b..c9bb9035115 100644 --- a/.github/workflows/publish-android.yml +++ b/.github/workflows/publish-android.yml @@ -21,7 +21,7 @@ jobs: - name: set up JDK uses: actions/setup-java@v1 with: - java-version: 11 + java-version: 17 - name: Write GPG Sec Ring run: echo '${{ secrets.GPG_KEY_CONTENTS }}' | base64 -d > /tmp/secring.gpg - name: Update gradle.properties diff --git a/gradle.properties b/gradle.properties index 9b93fa895fc..157db801a56 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,8 @@ NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 -org.gradle.jvmargs=-Xmx2g -Xms512m -XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled +# The --add-opens is required for Litho's annotation processor on JDK 17 +org.gradle.jvmargs=-Xmx2g -Xms512m --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true From f85ce38bfe1af7cb18df1cb179c132d48a087188 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:40:48 +0100 Subject: [PATCH 17/91] [android] Get rid of deprecated package XML attribute Summary: We use the namespace everywhere now. Test Plan: See if this also works with Buck by importing. Tags: --- android/no-op/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary2/src/main/AndroidManifest.xml | 3 +-- android/plugins/litho/src/main/AndroidManifest.xml | 3 +-- android/plugins/network/src/main/AndroidManifest.xml | 3 +-- .../plugins/retrofit2-protobuf/src/main/AndroidManifest.xml | 3 +-- android/sample/AndroidManifest.xml | 5 +---- android/sample/build.gradle | 2 +- android/third-party/AndroidManifest.xml | 2 +- android/tutorial/src/main/AndroidManifest.xml | 3 +-- xplat/AndroidManifest.xml | 3 +-- 11 files changed, 11 insertions(+), 22 deletions(-) diff --git a/android/no-op/src/main/AndroidManifest.xml b/android/no-op/src/main/AndroidManifest.xml index 674594014c7..d0b0517be55 100644 --- a/android/no-op/src/main/AndroidManifest.xml +++ b/android/no-op/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary/src/main/AndroidManifest.xml b/android/plugins/leakcanary/src/main/AndroidManifest.xml index d39834f9f36..d0b0517be55 100644 --- a/android/plugins/leakcanary/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary2/src/main/AndroidManifest.xml b/android/plugins/leakcanary2/src/main/AndroidManifest.xml index bce194dc9aa..d0b0517be55 100644 --- a/android/plugins/leakcanary2/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary2/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/litho/src/main/AndroidManifest.xml b/android/plugins/litho/src/main/AndroidManifest.xml index 08eb3bb8336..d0b0517be55 100644 --- a/android/plugins/litho/src/main/AndroidManifest.xml +++ b/android/plugins/litho/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/network/src/main/AndroidManifest.xml b/android/plugins/network/src/main/AndroidManifest.xml index c43201fd374..d0b0517be55 100644 --- a/android/plugins/network/src/main/AndroidManifest.xml +++ b/android/plugins/network/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml index b6b9516aeac..d0b0517be55 100644 --- a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml +++ b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml index 5b6b0df3e45..1200d888842 100644 --- a/android/sample/AndroidManifest.xml +++ b/android/sample/AndroidManifest.xml @@ -8,11 +8,8 @@ --> + xmlns:tools="http://schemas.android.com/tools"> - - + diff --git a/android/tutorial/src/main/AndroidManifest.xml b/android/tutorial/src/main/AndroidManifest.xml index 99393e1dfed..7d88f54cbe7 100644 --- a/android/tutorial/src/main/AndroidManifest.xml +++ b/android/tutorial/src/main/AndroidManifest.xml @@ -5,8 +5,7 @@ ~ file in the root directory of this source tree. --> - + diff --git a/xplat/AndroidManifest.xml b/xplat/AndroidManifest.xml index d9fc4e52004..d0b0517be55 100644 --- a/xplat/AndroidManifest.xml +++ b/xplat/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + From 4455f3cf3898d8d3957570d6118cdb957bda286a Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:07:07 +0100 Subject: [PATCH 18/91] [android] Upgrade Kotlin to 1.8.20 Summary: The additional source/target settings should hopefully no longer be necessary with AGP 8.1: https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support Test Plan: - CI - Build sample app - AS sync Tasks: T153533673 --- android/build.gradle | 5 +++++ android/plugins/litho/build.gradle | 5 +++++ android/sample/build.gradle | 4 ++-- android/tutorial/build.gradle | 6 +++--- gradle.properties | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e656d0ae61a..0b0ec68734e 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -48,6 +48,11 @@ android { } } + compileOptions { + targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_17 + } + buildFeatures { prefab true } diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 9b8494679ba..705094e953e 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -18,6 +18,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_17 + } + dependencies { compileOnly deps.lithoAnnotations implementation project(':android') diff --git a/android/sample/build.gradle b/android/sample/build.gradle index e17c59922c1..1f82bc12082 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -36,8 +36,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_17 } packagingOptions { diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 4f55e38b88a..e6a64eeeee1 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -22,8 +22,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility JavaVersion.VERSION_17 } buildTypes { @@ -34,7 +34,7 @@ android { } kotlinOptions { - jvmTarget = "1.8" + jvmTarget = "17" } packagingOptions { diff --git a/gradle.properties b/gradle.properties index 92340ba69cf..db061ec28ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers LITHO_VERSION=0.44.0 ANDROIDX_VERSION=1.3.0 -KOTLIN_VERSION=1.6.20 +KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 # NDK From 4776f082597f774109ecf914a8a9d3e20159f825 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:12:25 +0100 Subject: [PATCH 19/91] [android] Upgrade Kotlin to 1.8.20 Summary: The additional source/target settings should hopefully no longer be necessary with AGP 8.1: https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support Test Plan: - CI - Build sample app - AS sync Tasks: T153533673 --- android/build.gradle | 5 +++++ android/plugins/litho/build.gradle | 5 +++++ android/sample/build.gradle | 5 +++-- android/tutorial/build.gradle | 8 ++------ build.gradle | 1 + gradle.properties | 2 +- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e656d0ae61a..763ebccef18 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -48,6 +48,11 @@ android { } } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + buildFeatures { prefab true } diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 9b8494679ba..4ca8b0e4595 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -18,6 +18,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { compileOnly deps.lithoAnnotations implementation project(':android') diff --git a/android/sample/build.gradle b/android/sample/build.gradle index e17c59922c1..9c6d01a4160 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -12,6 +12,7 @@ android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion + defaultConfig { minSdkVersion 23 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -36,8 +37,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } packagingOptions { diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 4f55e38b88a..2526f95ec84 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -22,8 +22,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } buildTypes { @@ -33,10 +33,6 @@ android { } } - kotlinOptions { - jvmTarget = "1.8" - } - packagingOptions { pickFirst "**/libcrypto.so" pickFirst "**/libevent-2.1.so" diff --git a/build.gradle b/build.gradle index 0155e1ac040..abedec2ae16 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,7 @@ ext { compileSdkVersion = 31 buildToolsVersion = "30.0.3" ndkVersion = "$NDK_VERSION" + javaTargetVersion = JavaVersion.VERSION_17 } ext.deps = [ diff --git a/gradle.properties b/gradle.properties index 92340ba69cf..db061ec28ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers LITHO_VERSION=0.44.0 ANDROIDX_VERSION=1.3.0 -KOTLIN_VERSION=1.6.20 +KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 # NDK From 12d6a4c0d66950e1b12216bcd3fa594e28ed3eb4 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:12:44 +0100 Subject: [PATCH 20/91] [android] Rename no-op package namespace Summary: Shouldn't affect anything but otherwise you get a warning: ``` [:android] /Users/realpassy/Projects/java/flipper/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml Warning: Namespace 'com.facebook.flipper' used in: :android, com.facebook.flipper:flipper:0.182.0. ``` Test Plan: CI Build sample --- android/no-op/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index ac84a9a4199..3caf12b4c9d 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.android.library' android { - namespace 'com.facebook.flipper' + namespace 'com.facebook.flipper.noop' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion From 0cc339a1e4f70afb21b45d5ebb7e85080433dca8 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:20:27 +0100 Subject: [PATCH 21/91] [android] Remove unnecessary ndk version indirection Summary: The constant was only referenced in one place, the ext property everywhere else. Test Plan: CI --- build.gradle | 2 +- gradle.properties | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index abedec2ae16..5153655d50b 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ ext { targetSdkVersion = 31 compileSdkVersion = 31 buildToolsVersion = "30.0.3" - ndkVersion = "$NDK_VERSION" + ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } diff --git a/gradle.properties b/gradle.properties index db061ec28ab..8a6b5a34ce6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,8 +22,6 @@ ANDROIDX_VERSION=1.3.0 KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 -# NDK -NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 From 45b35cf70a5b7d29cf6bb921feaa2d7b2212d0c7 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:27:00 +0100 Subject: [PATCH 22/91] [android] Copy deprecation note Summary: Ran the Kotlin migration process. They recommend we carry forwards these warnings. Test Plan: - CI --- .../flipper/plugins/uidebugger/core/FragmentTracker.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt index 38d4a6d3403..65e040de880 100644 --- a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt +++ b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt @@ -228,6 +228,7 @@ object FragmentTracker { Class.forName("android.app.FragmentManager\$FragmentLifecycleCallbacks") != null) { frameworkLifecycleTracker = object : android.app.FragmentManager.FragmentLifecycleCallbacks() { + @Deprecated("Deprecated in Java") override fun onFragmentAttached( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -240,6 +241,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentViewCreated( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -253,6 +255,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentDetached( fm: android.app.FragmentManager?, f: android.app.Fragment? From f14a632be74bca8b8e255eae607087b9ddfb7f67 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:32:30 +0100 Subject: [PATCH 23/91] [android] Build Tools 33.0.2 Summary: Bump to latest version. In isolation to check build failures. Test Plan: Build sample, CI --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5153655d50b..32872eb9d87 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 - buildToolsVersion = "30.0.3" + buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } From 8f026d0a84bdd3b43fe8e10e80969d87067bb85d Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:33:11 +0100 Subject: [PATCH 24/91] [android] Bump target and compile SDK Summary: Latest and greatest. Test Plan: As before --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 32872eb9d87..db74f1da389 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,8 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 + targetSdkVersion = 33 + compileSdkVersion = 33 buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 From 24d52c31c3bcb5f30c52ba4921f016e7307d31d2 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:33:40 +0100 Subject: [PATCH 25/91] [android][tutorial] Centralise and bump deps Summary: Per title. Test Plan: As before. --- android/tutorial/build.gradle | 6 +++--- build.gradle | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2526f95ec84..8bf1a54e72e 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -44,9 +44,9 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" - implementation "androidx.appcompat:appcompat:1.4.1" - implementation "androidx.core:core-ktx:1.8.0" + implementation deps.kotlinStdLibrary + implementation deps.supportAppCompat + implementation deps.supportCoreKtx // Flipper // For simplicity, we use Flipper for both debug and release builds here. diff --git a/build.gradle b/build.gradle index db74f1da389..dd9dae2a7cc 100644 --- a/build.gradle +++ b/build.gradle @@ -46,8 +46,6 @@ subprojects { ext { minSdkVersion = 15 - targetSdkVersion = 31 - compileSdkVersion = 31 targetSdkVersion = 33 compileSdkVersion = 33 buildToolsVersion = "33.0.2" @@ -69,6 +67,7 @@ ext.deps = [ supportEspresso : 'androidx.test.espresso:espresso-core:3.5.1', supportEspressoIntents : 'androidx.test.espresso:espresso-intents:3.5.1', supportTestRunner : 'androidx.test:runner:1.5.2', + supportCoreKtx : 'androidx.core:core-ktx:1.10.1', // Arch archPaging : 'android.arch.paging:runtime:1.0.1', // First-party From d08a6a982f7c4c176d8201957c4116ab8d1be4be Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:41:41 +0100 Subject: [PATCH 26/91] [android] Upgrade gradle project Summary: Makes us compatible with Android Studio Flamingo and unlocks upgrades to Kotlin (which we need to be in sync with fbsource). Test Plan: - ./gradlew :android:assembleDebug - Android Studio Sync - CI Tasks: T153938450 Tags: --- android/build.gradle | 1 + android/no-op/build.gradle | 8 +------- android/plugins/leakcanary/build.gradle | 1 + android/plugins/leakcanary2/build.gradle | 1 + android/plugins/litho/build.gradle | 1 + android/plugins/network/build.gradle | 1 + android/plugins/retrofit2-protobuf/build.gradle | 1 + android/sample/build.gradle | 1 + android/third-party/build.gradle | 1 + .../third-party/overrides/DoubleConversion/build.gradle | 1 + android/third-party/overrides/Folly/build.gradle | 1 + android/third-party/overrides/LibEvent/build.gradle | 1 + android/third-party/overrides/glog/build.gradle | 1 + android/tutorial/build.gradle | 1 + build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 3 +-- xplat/build.gradle | 1 + 18 files changed, 20 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 13bc5f8dc94..e656d0ae61a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index 7301ca4187a..ac84a9a4199 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -30,10 +31,3 @@ android { } apply plugin: 'com.vanniktech.maven.publish' - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts.add('archives', sourcesJar) diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle index 0c6388fb3e9..12bd4693353 100644 --- a/android/plugins/leakcanary/build.gradle +++ b/android/plugins/leakcanary/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.leakcanary' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index c4a17c37b1b..d141f408df3 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.leakcanary2' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 33b61a525ea..9b8494679ba 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.facebook.flipper.plugins.litho' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/network/build.gradle b/android/plugins/network/build.gradle index c4a3cd27a3f..f2e02bdd7da 100644 --- a/android/plugins/network/build.gradle +++ b/android/plugins/network/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.network' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index e48ac8ec529..b807c0de83c 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.retrofit2protobuf' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 123203b200f..ea77a1b5edc 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.application' android { + namespace 'com.facebook.flipper.sample' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/build.gradle b/android/third-party/build.gradle index 8edd35ffaae..6773963e359 100644 --- a/android/third-party/build.gradle +++ b/android/third-party/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply from: 'native.gradle' android { + namespace 'com.facebook.flipper.thirdparty' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/third-party/overrides/DoubleConversion/build.gradle b/android/third-party/overrides/DoubleConversion/build.gradle index 14c0ecf3217..05f9e986c96 100644 --- a/android/third-party/overrides/DoubleConversion/build.gradle +++ b/android/third-party/overrides/DoubleConversion/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.doubleconversion' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/overrides/Folly/build.gradle b/android/third-party/overrides/Folly/build.gradle index 576ca74b30a..9f089864d51 100644 --- a/android/third-party/overrides/Folly/build.gradle +++ b/android/third-party/overrides/Folly/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.folly' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/overrides/LibEvent/build.gradle b/android/third-party/overrides/LibEvent/build.gradle index 8b58aed452c..7b0b9a184ff 100644 --- a/android/third-party/overrides/LibEvent/build.gradle +++ b/android/third-party/overrides/LibEvent/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.libevent' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/overrides/glog/build.gradle b/android/third-party/overrides/glog/build.gradle index 14c0ecf3217..1ce8c393a03 100644 --- a/android/third-party/overrides/glog/build.gradle +++ b/android/third-party/overrides/glog/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.glog' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2ee7e9ee02a..4f55e38b88a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.sample.tutorial' defaultConfig { applicationId "com.facebook.flipper.sample.tutorial" diff --git a/build.gradle b/build.gradle index 209e119462c..0155e1ac040 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.0' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" diff --git a/gradle.properties b/gradle.properties index 157db801a56..92340ba69cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,3 +33,6 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d040d74f09..bd5c569f737 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xplat/build.gradle b/xplat/build.gradle index 71e3e2fa150..450908e6ecf 100644 --- a/xplat/build.gradle +++ b/xplat/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.xplat.sonar' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion From 3ea3625ba5bd15bd7ff2c46df26be0cb3eed2d25 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:12:25 +0100 Subject: [PATCH 27/91] [android] Upgrade Kotlin to 1.8.20 Summary: The additional source/target settings should hopefully no longer be necessary with AGP 8.1: https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support Test Plan: - CI - Build sample app - AS sync Tasks: T153533673 --- android/build.gradle | 5 +++++ android/plugins/litho/build.gradle | 5 +++++ android/sample/build.gradle | 5 +++-- android/tutorial/build.gradle | 8 ++------ build.gradle | 1 + gradle.properties | 2 +- 6 files changed, 17 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e656d0ae61a..763ebccef18 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -48,6 +48,11 @@ android { } } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + buildFeatures { prefab true } diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 9b8494679ba..4ca8b0e4595 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -18,6 +18,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { compileOnly deps.lithoAnnotations implementation project(':android') diff --git a/android/sample/build.gradle b/android/sample/build.gradle index e17c59922c1..9c6d01a4160 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -12,6 +12,7 @@ android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion + defaultConfig { minSdkVersion 23 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -36,8 +37,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } packagingOptions { diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 4f55e38b88a..2526f95ec84 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -22,8 +22,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } buildTypes { @@ -33,10 +33,6 @@ android { } } - kotlinOptions { - jvmTarget = "1.8" - } - packagingOptions { pickFirst "**/libcrypto.so" pickFirst "**/libevent-2.1.so" diff --git a/build.gradle b/build.gradle index 0155e1ac040..abedec2ae16 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,7 @@ ext { compileSdkVersion = 31 buildToolsVersion = "30.0.3" ndkVersion = "$NDK_VERSION" + javaTargetVersion = JavaVersion.VERSION_17 } ext.deps = [ diff --git a/gradle.properties b/gradle.properties index 92340ba69cf..db061ec28ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers LITHO_VERSION=0.44.0 ANDROIDX_VERSION=1.3.0 -KOTLIN_VERSION=1.6.20 +KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 # NDK From 9a7e10ca081d2c1d56009721f0bd6069fbeb0530 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:12:44 +0100 Subject: [PATCH 28/91] [android] Rename no-op package namespace Summary: Shouldn't affect anything but otherwise you get a warning: ``` [:android] /Users/realpassy/Projects/java/flipper/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml Warning: Namespace 'com.facebook.flipper' used in: :android, com.facebook.flipper:flipper:0.182.0. ``` Test Plan: CI Build sample --- android/no-op/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index ac84a9a4199..3caf12b4c9d 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.android.library' android { - namespace 'com.facebook.flipper' + namespace 'com.facebook.flipper.noop' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion From b9a820627ae55c2d0c116c78e82325f8b1f98114 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 11:40:48 +0100 Subject: [PATCH 29/91] [android] Get rid of deprecated package XML attribute Summary: We use the namespace everywhere now. Test Plan: See if this also works with Buck by importing. Tags: --- android/no-op/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary2/src/main/AndroidManifest.xml | 3 +-- android/plugins/litho/src/main/AndroidManifest.xml | 3 +-- android/plugins/network/src/main/AndroidManifest.xml | 3 +-- .../plugins/retrofit2-protobuf/src/main/AndroidManifest.xml | 3 +-- android/sample/AndroidManifest.xml | 5 +---- android/sample/build.gradle | 2 +- android/third-party/AndroidManifest.xml | 2 +- android/tutorial/src/main/AndroidManifest.xml | 3 +-- xplat/AndroidManifest.xml | 3 +-- 11 files changed, 11 insertions(+), 22 deletions(-) diff --git a/android/no-op/src/main/AndroidManifest.xml b/android/no-op/src/main/AndroidManifest.xml index 674594014c7..d0b0517be55 100644 --- a/android/no-op/src/main/AndroidManifest.xml +++ b/android/no-op/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary/src/main/AndroidManifest.xml b/android/plugins/leakcanary/src/main/AndroidManifest.xml index d39834f9f36..d0b0517be55 100644 --- a/android/plugins/leakcanary/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary2/src/main/AndroidManifest.xml b/android/plugins/leakcanary2/src/main/AndroidManifest.xml index bce194dc9aa..d0b0517be55 100644 --- a/android/plugins/leakcanary2/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary2/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/litho/src/main/AndroidManifest.xml b/android/plugins/litho/src/main/AndroidManifest.xml index 08eb3bb8336..d0b0517be55 100644 --- a/android/plugins/litho/src/main/AndroidManifest.xml +++ b/android/plugins/litho/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/network/src/main/AndroidManifest.xml b/android/plugins/network/src/main/AndroidManifest.xml index c43201fd374..d0b0517be55 100644 --- a/android/plugins/network/src/main/AndroidManifest.xml +++ b/android/plugins/network/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml index b6b9516aeac..d0b0517be55 100644 --- a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml +++ b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml index 5b6b0df3e45..1200d888842 100644 --- a/android/sample/AndroidManifest.xml +++ b/android/sample/AndroidManifest.xml @@ -8,11 +8,8 @@ --> + xmlns:tools="http://schemas.android.com/tools"> - - + diff --git a/android/tutorial/src/main/AndroidManifest.xml b/android/tutorial/src/main/AndroidManifest.xml index 99393e1dfed..7d88f54cbe7 100644 --- a/android/tutorial/src/main/AndroidManifest.xml +++ b/android/tutorial/src/main/AndroidManifest.xml @@ -5,8 +5,7 @@ ~ file in the root directory of this source tree. --> - + diff --git a/xplat/AndroidManifest.xml b/xplat/AndroidManifest.xml index d9fc4e52004..d0b0517be55 100644 --- a/xplat/AndroidManifest.xml +++ b/xplat/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + From 3b3679b16ee8723c657d3c41086577853a3fef6b Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:20:27 +0100 Subject: [PATCH 30/91] [android] Remove unnecessary ndk version indirection Summary: The constant was only referenced in one place, the ext property everywhere else. Test Plan: CI --- build.gradle | 2 +- gradle.properties | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index abedec2ae16..5153655d50b 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ ext { targetSdkVersion = 31 compileSdkVersion = 31 buildToolsVersion = "30.0.3" - ndkVersion = "$NDK_VERSION" + ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } diff --git a/gradle.properties b/gradle.properties index db061ec28ab..8a6b5a34ce6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,8 +22,6 @@ ANDROIDX_VERSION=1.3.0 KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 -# NDK -NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 From b3ed4baa85d9ba3fcd77a11b9e414c9f6adfb131 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:27:00 +0100 Subject: [PATCH 31/91] [android] Copy deprecation note Summary: Ran the Kotlin migration process. They recommend we carry forwards these warnings. Test Plan: - CI --- .../flipper/plugins/uidebugger/core/FragmentTracker.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt index 38d4a6d3403..65e040de880 100644 --- a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt +++ b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt @@ -228,6 +228,7 @@ object FragmentTracker { Class.forName("android.app.FragmentManager\$FragmentLifecycleCallbacks") != null) { frameworkLifecycleTracker = object : android.app.FragmentManager.FragmentLifecycleCallbacks() { + @Deprecated("Deprecated in Java") override fun onFragmentAttached( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -240,6 +241,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentViewCreated( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -253,6 +255,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentDetached( fm: android.app.FragmentManager?, f: android.app.Fragment? From f8ae886ee3ea3faf0774b242aff5bd64ed66f009 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:32:30 +0100 Subject: [PATCH 32/91] [android] Build Tools 33.0.2 Summary: Bump to latest version. In isolation to check build failures. Test Plan: Build sample, CI --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5153655d50b..32872eb9d87 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 - buildToolsVersion = "30.0.3" + buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } From b6771382a5576756451dedc49e82ffc0a07ba330 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:33:11 +0100 Subject: [PATCH 33/91] [android] Bump target and compile SDK Summary: Latest and greatest. Test Plan: As before --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 32872eb9d87..db74f1da389 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,8 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 + targetSdkVersion = 33 + compileSdkVersion = 33 buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 From a0d8927c453433069d4fdce7e71c1806de9e2e97 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:33:40 +0100 Subject: [PATCH 34/91] [android][tutorial] Centralise and bump deps Summary: Per title. Test Plan: As before. --- android/tutorial/build.gradle | 6 +++--- build.gradle | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2526f95ec84..8bf1a54e72e 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -44,9 +44,9 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" - implementation "androidx.appcompat:appcompat:1.4.1" - implementation "androidx.core:core-ktx:1.8.0" + implementation deps.kotlinStdLibrary + implementation deps.supportAppCompat + implementation deps.supportCoreKtx // Flipper // For simplicity, we use Flipper for both debug and release builds here. diff --git a/build.gradle b/build.gradle index db74f1da389..dd9dae2a7cc 100644 --- a/build.gradle +++ b/build.gradle @@ -46,8 +46,6 @@ subprojects { ext { minSdkVersion = 15 - targetSdkVersion = 31 - compileSdkVersion = 31 targetSdkVersion = 33 compileSdkVersion = 33 buildToolsVersion = "33.0.2" @@ -69,6 +67,7 @@ ext.deps = [ supportEspresso : 'androidx.test.espresso:espresso-core:3.5.1', supportEspressoIntents : 'androidx.test.espresso:espresso-intents:3.5.1', supportTestRunner : 'androidx.test:runner:1.5.2', + supportCoreKtx : 'androidx.core:core-ktx:1.10.1', // Arch archPaging : 'android.arch.paging:runtime:1.0.1', // First-party From 2c46a4183a198283d5afb0f16fef1146c238bd10 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 13:15:05 +0100 Subject: [PATCH 35/91] [android] Upgrade Kotlin to 1.8.20 Summary: The additional source/target settings should hopefully no longer be necessary with AGP 8.1: https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support Test Plan: - CI - Build sample app - AS sync Tasks: T153533673 --- android/build.gradle | 5 +++++ android/plugins/leakcanary2/build.gradle | 5 +++++ android/plugins/litho/build.gradle | 5 +++++ android/sample/build.gradle | 5 +++-- android/tutorial/build.gradle | 8 ++------ build.gradle | 1 + gradle.properties | 2 +- 7 files changed, 22 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e656d0ae61a..763ebccef18 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -48,6 +48,11 @@ android { } } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + buildFeatures { prefab true } diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index d141f408df3..def2cf57d21 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -19,6 +19,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" implementation project(':android') diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 9b8494679ba..4ca8b0e4595 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -18,6 +18,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { compileOnly deps.lithoAnnotations implementation project(':android') diff --git a/android/sample/build.gradle b/android/sample/build.gradle index e17c59922c1..9c6d01a4160 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -12,6 +12,7 @@ android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion + defaultConfig { minSdkVersion 23 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -36,8 +37,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } packagingOptions { diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 4f55e38b88a..2526f95ec84 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -22,8 +22,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } buildTypes { @@ -33,10 +33,6 @@ android { } } - kotlinOptions { - jvmTarget = "1.8" - } - packagingOptions { pickFirst "**/libcrypto.so" pickFirst "**/libevent-2.1.so" diff --git a/build.gradle b/build.gradle index 0155e1ac040..abedec2ae16 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,7 @@ ext { compileSdkVersion = 31 buildToolsVersion = "30.0.3" ndkVersion = "$NDK_VERSION" + javaTargetVersion = JavaVersion.VERSION_17 } ext.deps = [ diff --git a/gradle.properties b/gradle.properties index 92340ba69cf..db061ec28ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers LITHO_VERSION=0.44.0 ANDROIDX_VERSION=1.3.0 -KOTLIN_VERSION=1.6.20 +KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 # NDK From e8e594885a4ccf64fd75a439cff364c0f88f8a59 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:12:44 +0100 Subject: [PATCH 36/91] [android] Rename no-op package namespace Summary: Shouldn't affect anything but otherwise you get a warning: ``` [:android] /Users/realpassy/Projects/java/flipper/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml Warning: Namespace 'com.facebook.flipper' used in: :android, com.facebook.flipper:flipper:0.182.0. ``` Test Plan: CI Build sample --- android/no-op/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index ac84a9a4199..3caf12b4c9d 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.android.library' android { - namespace 'com.facebook.flipper' + namespace 'com.facebook.flipper.noop' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion From 515cc1bcefd5fdbdde10f22076bae74a4b01ea93 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:20:27 +0100 Subject: [PATCH 37/91] [android] Remove unnecessary ndk version indirection Summary: The constant was only referenced in one place, the ext property everywhere else. Test Plan: CI --- build.gradle | 2 +- gradle.properties | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index abedec2ae16..5153655d50b 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ ext { targetSdkVersion = 31 compileSdkVersion = 31 buildToolsVersion = "30.0.3" - ndkVersion = "$NDK_VERSION" + ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } diff --git a/gradle.properties b/gradle.properties index db061ec28ab..8a6b5a34ce6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,8 +22,6 @@ ANDROIDX_VERSION=1.3.0 KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 -# NDK -NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 From 8cf5e6a18a4d4bfbb7451bf8d92dac2cd862b2ce Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:27:00 +0100 Subject: [PATCH 38/91] [android] Copy deprecation note Summary: Ran the Kotlin migration process. They recommend we carry forwards these warnings. Test Plan: - CI --- .../flipper/plugins/uidebugger/core/FragmentTracker.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt index 38d4a6d3403..65e040de880 100644 --- a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt +++ b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt @@ -228,6 +228,7 @@ object FragmentTracker { Class.forName("android.app.FragmentManager\$FragmentLifecycleCallbacks") != null) { frameworkLifecycleTracker = object : android.app.FragmentManager.FragmentLifecycleCallbacks() { + @Deprecated("Deprecated in Java") override fun onFragmentAttached( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -240,6 +241,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentViewCreated( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -253,6 +255,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentDetached( fm: android.app.FragmentManager?, f: android.app.Fragment? From b034b098b0c99f3497e1344cbaa5bf9ed3ef52b8 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:32:30 +0100 Subject: [PATCH 39/91] [android] Build Tools 33.0.2 Summary: Bump to latest version. In isolation to check build failures. Test Plan: Build sample, CI --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5153655d50b..32872eb9d87 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 - buildToolsVersion = "30.0.3" + buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } From 10629172601c39b3bfe33359cb08c5681840a639 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:33:11 +0100 Subject: [PATCH 40/91] [android] Bump target and compile SDK Summary: Latest and greatest. Test Plan: As before --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 32872eb9d87..db74f1da389 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,8 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 + targetSdkVersion = 33 + compileSdkVersion = 33 buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 From 953e1500a4f0aaf6aafe3cca176478a6558ee423 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:33:40 +0100 Subject: [PATCH 41/91] [android][tutorial] Centralise and bump deps Summary: Per title. Test Plan: As before. --- android/tutorial/build.gradle | 6 +++--- build.gradle | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2526f95ec84..8bf1a54e72e 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -44,9 +44,9 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" - implementation "androidx.appcompat:appcompat:1.4.1" - implementation "androidx.core:core-ktx:1.8.0" + implementation deps.kotlinStdLibrary + implementation deps.supportAppCompat + implementation deps.supportCoreKtx // Flipper // For simplicity, we use Flipper for both debug and release builds here. diff --git a/build.gradle b/build.gradle index db74f1da389..dd9dae2a7cc 100644 --- a/build.gradle +++ b/build.gradle @@ -46,8 +46,6 @@ subprojects { ext { minSdkVersion = 15 - targetSdkVersion = 31 - compileSdkVersion = 31 targetSdkVersion = 33 compileSdkVersion = 33 buildToolsVersion = "33.0.2" @@ -69,6 +67,7 @@ ext.deps = [ supportEspresso : 'androidx.test.espresso:espresso-core:3.5.1', supportEspressoIntents : 'androidx.test.espresso:espresso-intents:3.5.1', supportTestRunner : 'androidx.test:runner:1.5.2', + supportCoreKtx : 'androidx.core:core-ktx:1.10.1', // Arch archPaging : 'android.arch.paging:runtime:1.0.1', // First-party From ae92410deb82b273d65892546bd86f3bfda0df67 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 13:15:05 +0100 Subject: [PATCH 42/91] [android] Upgrade Kotlin to 1.8.20 Summary: The additional source/target settings should hopefully no longer be necessary with AGP 8.1: https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support Test Plan: - CI - Build sample app - AS sync Tasks: T153533673 --- android/build.gradle | 5 +++++ android/plugins/leakcanary2/build.gradle | 5 +++++ android/plugins/litho/build.gradle | 5 +++++ android/plugins/retrofit2-protobuf/build.gradle | 5 +++++ android/sample/build.gradle | 5 +++-- android/tutorial/build.gradle | 8 ++------ build.gradle | 1 + gradle.properties | 2 +- 8 files changed, 27 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e656d0ae61a..763ebccef18 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -48,6 +48,11 @@ android { } } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + buildFeatures { prefab true } diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index d141f408df3..def2cf57d21 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -19,6 +19,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" implementation project(':android') diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 9b8494679ba..4ca8b0e4595 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -18,6 +18,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { compileOnly deps.lithoAnnotations implementation project(':android') diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index b807c0de83c..4a4c383e282 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -19,6 +19,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" implementation project(':android') diff --git a/android/sample/build.gradle b/android/sample/build.gradle index e17c59922c1..9c6d01a4160 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -12,6 +12,7 @@ android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion + defaultConfig { minSdkVersion 23 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -36,8 +37,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } packagingOptions { diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 4f55e38b88a..2526f95ec84 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -22,8 +22,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } buildTypes { @@ -33,10 +33,6 @@ android { } } - kotlinOptions { - jvmTarget = "1.8" - } - packagingOptions { pickFirst "**/libcrypto.so" pickFirst "**/libevent-2.1.so" diff --git a/build.gradle b/build.gradle index 0155e1ac040..abedec2ae16 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,7 @@ ext { compileSdkVersion = 31 buildToolsVersion = "30.0.3" ndkVersion = "$NDK_VERSION" + javaTargetVersion = JavaVersion.VERSION_17 } ext.deps = [ diff --git a/gradle.properties b/gradle.properties index 92340ba69cf..db061ec28ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers LITHO_VERSION=0.44.0 ANDROIDX_VERSION=1.3.0 -KOTLIN_VERSION=1.6.20 +KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 # NDK From efb81daa0101c07f99cf5eec39f66f2f3aae5e0e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:12:44 +0100 Subject: [PATCH 43/91] [android] Rename no-op package namespace Summary: Shouldn't affect anything but otherwise you get a warning: ``` [:android] /Users/realpassy/Projects/java/flipper/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml Warning: Namespace 'com.facebook.flipper' used in: :android, com.facebook.flipper:flipper:0.182.0. ``` Test Plan: CI Build sample --- android/no-op/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index ac84a9a4199..3caf12b4c9d 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.android.library' android { - namespace 'com.facebook.flipper' + namespace 'com.facebook.flipper.noop' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion From d809cf5866b2a3dc389cf30cbea0db6527150f3c Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:20:27 +0100 Subject: [PATCH 44/91] [android] Remove unnecessary ndk version indirection Summary: The constant was only referenced in one place, the ext property everywhere else. Test Plan: CI --- build.gradle | 2 +- gradle.properties | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index abedec2ae16..5153655d50b 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ ext { targetSdkVersion = 31 compileSdkVersion = 31 buildToolsVersion = "30.0.3" - ndkVersion = "$NDK_VERSION" + ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } diff --git a/gradle.properties b/gradle.properties index db061ec28ab..8a6b5a34ce6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,8 +22,6 @@ ANDROIDX_VERSION=1.3.0 KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 -# NDK -NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 From 32c1465adfe13abb8722b8378a3f06d0f5a1737e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:27:00 +0100 Subject: [PATCH 45/91] [android] Copy deprecation note Summary: Ran the Kotlin migration process. They recommend we carry forwards these warnings. Test Plan: - CI --- .../flipper/plugins/uidebugger/core/FragmentTracker.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt index 38d4a6d3403..65e040de880 100644 --- a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt +++ b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt @@ -228,6 +228,7 @@ object FragmentTracker { Class.forName("android.app.FragmentManager\$FragmentLifecycleCallbacks") != null) { frameworkLifecycleTracker = object : android.app.FragmentManager.FragmentLifecycleCallbacks() { + @Deprecated("Deprecated in Java") override fun onFragmentAttached( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -240,6 +241,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentViewCreated( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -253,6 +255,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentDetached( fm: android.app.FragmentManager?, f: android.app.Fragment? From 5e8a815f7b7be9a343eb740e132a49444c9008da Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:32:30 +0100 Subject: [PATCH 46/91] [android] Build Tools 33.0.2 Summary: Bump to latest version. In isolation to check build failures. Test Plan: Build sample, CI --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5153655d50b..32872eb9d87 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 - buildToolsVersion = "30.0.3" + buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } From b85e77877af83a32d3036fbdb1d984265a17cb21 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:33:11 +0100 Subject: [PATCH 47/91] [android] Bump target and compile SDK Summary: Latest and greatest. Test Plan: As before --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 32872eb9d87..db74f1da389 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,8 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 + targetSdkVersion = 33 + compileSdkVersion = 33 buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 From d9105e423c8a7be7f3b069b2046211b0f17df020 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 12:33:40 +0100 Subject: [PATCH 48/91] [android][tutorial] Centralise and bump deps Summary: Per title. Test Plan: As before. --- android/tutorial/build.gradle | 6 +++--- build.gradle | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2526f95ec84..8bf1a54e72e 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -44,9 +44,9 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" - implementation "androidx.appcompat:appcompat:1.4.1" - implementation "androidx.core:core-ktx:1.8.0" + implementation deps.kotlinStdLibrary + implementation deps.supportAppCompat + implementation deps.supportCoreKtx // Flipper // For simplicity, we use Flipper for both debug and release builds here. diff --git a/build.gradle b/build.gradle index db74f1da389..dd9dae2a7cc 100644 --- a/build.gradle +++ b/build.gradle @@ -46,8 +46,6 @@ subprojects { ext { minSdkVersion = 15 - targetSdkVersion = 31 - compileSdkVersion = 31 targetSdkVersion = 33 compileSdkVersion = 33 buildToolsVersion = "33.0.2" @@ -69,6 +67,7 @@ ext.deps = [ supportEspresso : 'androidx.test.espresso:espresso-core:3.5.1', supportEspressoIntents : 'androidx.test.espresso:espresso-intents:3.5.1', supportTestRunner : 'androidx.test:runner:1.5.2', + supportCoreKtx : 'androidx.core:core-ktx:1.10.1', // Arch archPaging : 'android.arch.paging:runtime:1.0.1', // First-party From 445b5f1a7dd1dc93a0903728dfbacdd235cc97fd Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 49/91] [android] Upgrade gradle project Summary: Makes us compatible with Android Studio Flamingo and unlocks upgrades to Kotlin (which we need to be in sync with fbsource). Test Plan: - ./gradlew :android:assembleDebug - Android Studio Sync - CI Tasks: T153938450 Tags: --- android/build.gradle | 1 + android/no-op/build.gradle | 8 +------- android/plugins/leakcanary/build.gradle | 1 + android/plugins/leakcanary2/build.gradle | 1 + android/plugins/litho/build.gradle | 1 + android/plugins/network/build.gradle | 1 + android/plugins/retrofit2-protobuf/build.gradle | 1 + android/sample/build.gradle | 1 + android/third-party/build.gradle | 1 + .../third-party/overrides/DoubleConversion/build.gradle | 1 + android/third-party/overrides/Folly/build.gradle | 1 + android/third-party/overrides/LibEvent/build.gradle | 1 + android/third-party/overrides/glog/build.gradle | 1 + android/tutorial/build.gradle | 1 + build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 3 +-- xplat/build.gradle | 1 + 18 files changed, 20 insertions(+), 10 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 13bc5f8dc94..e656d0ae61a 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlinx-serialization' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index 7301ca4187a..ac84a9a4199 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion @@ -30,10 +31,3 @@ android { } apply plugin: 'com.vanniktech.maven.publish' - -task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' -} - -artifacts.add('archives', sourcesJar) diff --git a/android/plugins/leakcanary/build.gradle b/android/plugins/leakcanary/build.gradle index 0c6388fb3e9..12bd4693353 100644 --- a/android/plugins/leakcanary/build.gradle +++ b/android/plugins/leakcanary/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.leakcanary' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index c4a17c37b1b..d141f408df3 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.leakcanary2' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 33b61a525ea..9b8494679ba 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { + namespace 'com.facebook.flipper.plugins.litho' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/network/build.gradle b/android/plugins/network/build.gradle index c4a3cd27a3f..f2e02bdd7da 100644 --- a/android/plugins/network/build.gradle +++ b/android/plugins/network/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.plugins.network' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index e48ac8ec529..b807c0de83c 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.plugins.retrofit2protobuf' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 123203b200f..ea77a1b5edc 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.application' android { + namespace 'com.facebook.flipper.sample' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/build.gradle b/android/third-party/build.gradle index 8edd35ffaae..6773963e359 100644 --- a/android/third-party/build.gradle +++ b/android/third-party/build.gradle @@ -9,6 +9,7 @@ apply plugin: 'com.android.library' apply from: 'native.gradle' android { + namespace 'com.facebook.flipper.thirdparty' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion diff --git a/android/third-party/overrides/DoubleConversion/build.gradle b/android/third-party/overrides/DoubleConversion/build.gradle index 14c0ecf3217..05f9e986c96 100644 --- a/android/third-party/overrides/DoubleConversion/build.gradle +++ b/android/third-party/overrides/DoubleConversion/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.doubleconversion' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/overrides/Folly/build.gradle b/android/third-party/overrides/Folly/build.gradle index 576ca74b30a..9f089864d51 100644 --- a/android/third-party/overrides/Folly/build.gradle +++ b/android/third-party/overrides/Folly/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.folly' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/overrides/LibEvent/build.gradle b/android/third-party/overrides/LibEvent/build.gradle index 8b58aed452c..7b0b9a184ff 100644 --- a/android/third-party/overrides/LibEvent/build.gradle +++ b/android/third-party/overrides/LibEvent/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.libevent' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/third-party/overrides/glog/build.gradle b/android/third-party/overrides/glog/build.gradle index 14c0ecf3217..1ce8c393a03 100644 --- a/android/third-party/overrides/glog/build.gradle +++ b/android/third-party/overrides/glog/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.glog' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2ee7e9ee02a..4f55e38b88a 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -10,6 +10,7 @@ apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' android { + namespace 'com.facebook.flipper.sample.tutorial' defaultConfig { applicationId "com.facebook.flipper.sample.tutorial" diff --git a/build.gradle b/build.gradle index 209e119462c..0155e1ac040 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.4.0' + classpath 'com.android.tools.build:gradle:8.0.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.10" diff --git a/gradle.properties b/gradle.properties index 157db801a56..92340ba69cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -33,3 +33,6 @@ systemProp.org.gradle.internal.http.connectionTimeout=120000 systemProp.org.gradle.internal.http.socketTimeout=120000 android.useAndroidX=true android.enableJetifier=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4d040d74f09..bd5c569f737 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip -distributionSha256Sum=cb87f222c5585bd46838ad4db78463a5c5f3d336e5e2b98dc7c0c586527351c2 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/xplat/build.gradle b/xplat/build.gradle index 71e3e2fa150..450908e6ecf 100644 --- a/xplat/build.gradle +++ b/xplat/build.gradle @@ -8,6 +8,7 @@ apply plugin: 'com.android.library' android { + namespace 'com.facebook.xplat.sonar' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion From 9b015bf2678ee5e2ee17d1314dcf256ccb9fc77d Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 50/91] [android] Get rid of deprecated package XML attribute Summary: We use the namespace everywhere now. Test Plan: See if this also works with Buck by importing. Tags: --- android/no-op/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary/src/main/AndroidManifest.xml | 3 +-- android/plugins/leakcanary2/src/main/AndroidManifest.xml | 3 +-- android/plugins/litho/src/main/AndroidManifest.xml | 3 +-- android/plugins/network/src/main/AndroidManifest.xml | 3 +-- .../plugins/retrofit2-protobuf/src/main/AndroidManifest.xml | 3 +-- android/sample/AndroidManifest.xml | 5 +---- android/sample/build.gradle | 2 +- android/third-party/AndroidManifest.xml | 2 +- android/tutorial/src/main/AndroidManifest.xml | 3 +-- xplat/AndroidManifest.xml | 3 +-- 11 files changed, 11 insertions(+), 22 deletions(-) diff --git a/android/no-op/src/main/AndroidManifest.xml b/android/no-op/src/main/AndroidManifest.xml index 674594014c7..d0b0517be55 100644 --- a/android/no-op/src/main/AndroidManifest.xml +++ b/android/no-op/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary/src/main/AndroidManifest.xml b/android/plugins/leakcanary/src/main/AndroidManifest.xml index d39834f9f36..d0b0517be55 100644 --- a/android/plugins/leakcanary/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/leakcanary2/src/main/AndroidManifest.xml b/android/plugins/leakcanary2/src/main/AndroidManifest.xml index bce194dc9aa..d0b0517be55 100644 --- a/android/plugins/leakcanary2/src/main/AndroidManifest.xml +++ b/android/plugins/leakcanary2/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/litho/src/main/AndroidManifest.xml b/android/plugins/litho/src/main/AndroidManifest.xml index 08eb3bb8336..d0b0517be55 100644 --- a/android/plugins/litho/src/main/AndroidManifest.xml +++ b/android/plugins/litho/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/network/src/main/AndroidManifest.xml b/android/plugins/network/src/main/AndroidManifest.xml index c43201fd374..d0b0517be55 100644 --- a/android/plugins/network/src/main/AndroidManifest.xml +++ b/android/plugins/network/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml index b6b9516aeac..d0b0517be55 100644 --- a/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml +++ b/android/plugins/retrofit2-protobuf/src/main/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + diff --git a/android/sample/AndroidManifest.xml b/android/sample/AndroidManifest.xml index 5b6b0df3e45..1200d888842 100644 --- a/android/sample/AndroidManifest.xml +++ b/android/sample/AndroidManifest.xml @@ -8,11 +8,8 @@ --> + xmlns:tools="http://schemas.android.com/tools"> - - + diff --git a/android/tutorial/src/main/AndroidManifest.xml b/android/tutorial/src/main/AndroidManifest.xml index 99393e1dfed..7d88f54cbe7 100644 --- a/android/tutorial/src/main/AndroidManifest.xml +++ b/android/tutorial/src/main/AndroidManifest.xml @@ -5,8 +5,7 @@ ~ file in the root directory of this source tree. --> - + diff --git a/xplat/AndroidManifest.xml b/xplat/AndroidManifest.xml index d9fc4e52004..d0b0517be55 100644 --- a/xplat/AndroidManifest.xml +++ b/xplat/AndroidManifest.xml @@ -6,6 +6,5 @@ ~ file in the root directory of this source tree. --> - + From 7895e58bcb6ca23278eca0209860f8ae8b2b5eec Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 51/91] [android] Upgrade Kotlin to 1.8.20 Summary: The additional source/target settings should hopefully no longer be necessary with AGP 8.1: https://kotlinlang.org/docs/gradle-configure-project.html#gradle-java-toolchains-support Test Plan: - CI - Build sample app - AS sync Tasks: T153533673 --- android/build.gradle | 5 +++++ android/plugins/leakcanary2/build.gradle | 5 +++++ android/plugins/litho/build.gradle | 5 +++++ android/plugins/retrofit2-protobuf/build.gradle | 5 +++++ android/sample/build.gradle | 5 +++-- android/tutorial/build.gradle | 8 ++------ build.gradle | 1 + gradle.properties | 2 +- 8 files changed, 27 insertions(+), 9 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index e656d0ae61a..763ebccef18 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -48,6 +48,11 @@ android { } } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + buildFeatures { prefab true } diff --git a/android/plugins/leakcanary2/build.gradle b/android/plugins/leakcanary2/build.gradle index d141f408df3..def2cf57d21 100644 --- a/android/plugins/leakcanary2/build.gradle +++ b/android/plugins/leakcanary2/build.gradle @@ -19,6 +19,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { compileOnly "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" implementation project(':android') diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 9b8494679ba..4ca8b0e4595 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -18,6 +18,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { compileOnly deps.lithoAnnotations implementation project(':android') diff --git a/android/plugins/retrofit2-protobuf/build.gradle b/android/plugins/retrofit2-protobuf/build.gradle index b807c0de83c..4a4c383e282 100644 --- a/android/plugins/retrofit2-protobuf/build.gradle +++ b/android/plugins/retrofit2-protobuf/build.gradle @@ -19,6 +19,11 @@ android { targetSdkVersion rootProject.targetSdkVersion } + compileOptions { + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion + } + dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" implementation project(':android') diff --git a/android/sample/build.gradle b/android/sample/build.gradle index e17c59922c1..9c6d01a4160 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -12,6 +12,7 @@ android { compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion ndkVersion rootProject.ndkVersion + defaultConfig { minSdkVersion 23 testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' @@ -36,8 +37,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } packagingOptions { diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 4f55e38b88a..2526f95ec84 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -22,8 +22,8 @@ android { } compileOptions { - targetCompatibility JavaVersion.VERSION_1_8 - sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility rootProject.javaTargetVersion + sourceCompatibility rootProject.javaTargetVersion } buildTypes { @@ -33,10 +33,6 @@ android { } } - kotlinOptions { - jvmTarget = "1.8" - } - packagingOptions { pickFirst "**/libcrypto.so" pickFirst "**/libevent-2.1.so" diff --git a/build.gradle b/build.gradle index 0155e1ac040..abedec2ae16 100644 --- a/build.gradle +++ b/build.gradle @@ -50,6 +50,7 @@ ext { compileSdkVersion = 31 buildToolsVersion = "30.0.3" ndkVersion = "$NDK_VERSION" + javaTargetVersion = JavaVersion.VERSION_17 } ext.deps = [ diff --git a/gradle.properties b/gradle.properties index 92340ba69cf..db061ec28ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers LITHO_VERSION=0.44.0 ANDROIDX_VERSION=1.3.0 -KOTLIN_VERSION=1.6.20 +KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 # NDK From 56af496e9f5367e53318f4e3bd007991d8ef3c1a Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 52/91] [android] Rename no-op package namespace Summary: Shouldn't affect anything but otherwise you get a warning: ``` [:android] /Users/realpassy/Projects/java/flipper/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml Warning: Namespace 'com.facebook.flipper' used in: :android, com.facebook.flipper:flipper:0.182.0. ``` Test Plan: CI Build sample --- android/no-op/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/no-op/build.gradle b/android/no-op/build.gradle index ac84a9a4199..3caf12b4c9d 100644 --- a/android/no-op/build.gradle +++ b/android/no-op/build.gradle @@ -8,7 +8,7 @@ apply plugin: 'com.android.library' android { - namespace 'com.facebook.flipper' + namespace 'com.facebook.flipper.noop' compileSdkVersion rootProject.compileSdkVersion buildToolsVersion rootProject.buildToolsVersion From 5ceeefa0e8671c8bc5effa472d203dde42cda4a4 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 53/91] [android] Remove unnecessary ndk version indirection Summary: The constant was only referenced in one place, the ext property everywhere else. Test Plan: CI --- build.gradle | 2 +- gradle.properties | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index abedec2ae16..5153655d50b 100644 --- a/build.gradle +++ b/build.gradle @@ -49,7 +49,7 @@ ext { targetSdkVersion = 31 compileSdkVersion = 31 buildToolsVersion = "30.0.3" - ndkVersion = "$NDK_VERSION" + ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } diff --git a/gradle.properties b/gradle.properties index db061ec28ab..8a6b5a34ce6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,8 +22,6 @@ ANDROIDX_VERSION=1.3.0 KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 SOLOADER_VERSION=0.10.4 -# NDK -NDK_VERSION=25.1.8937393 # Gradle internals org.gradle.internal.repository.max.retries=10 org.gradle.internal.repository.initial.backoff=1250 From 828b3fec561af760562f02d5931055c405df3855 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 54/91] [android] Copy deprecation note Summary: Ran the Kotlin migration process. They recommend we carry forwards these warnings. Test Plan: - CI --- .../flipper/plugins/uidebugger/core/FragmentTracker.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt index 38d4a6d3403..65e040de880 100644 --- a/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt +++ b/android/src/main/java/com/facebook/flipper/plugins/uidebugger/core/FragmentTracker.kt @@ -228,6 +228,7 @@ object FragmentTracker { Class.forName("android.app.FragmentManager\$FragmentLifecycleCallbacks") != null) { frameworkLifecycleTracker = object : android.app.FragmentManager.FragmentLifecycleCallbacks() { + @Deprecated("Deprecated in Java") override fun onFragmentAttached( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -240,6 +241,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentViewCreated( fm: android.app.FragmentManager?, f: android.app.Fragment?, @@ -253,6 +255,7 @@ object FragmentTracker { } } + @Deprecated("Deprecated in Java") override fun onFragmentDetached( fm: android.app.FragmentManager?, f: android.app.Fragment? From d80fb2ac8884ccfc3d25c18e1dd22c15a187fd40 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 55/91] [android] Build Tools 33.0.2 Summary: Bump to latest version. In isolation to check build failures. Test Plan: Build sample, CI --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5153655d50b..32872eb9d87 100644 --- a/build.gradle +++ b/build.gradle @@ -48,7 +48,7 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 - buildToolsVersion = "30.0.3" + buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 } From 4841207e659cb0a67ddd554b3ef5728fa92b53a4 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 56/91] [android] Bump target and compile SDK Summary: Latest and greatest. Test Plan: As before --- build.gradle | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.gradle b/build.gradle index 32872eb9d87..db74f1da389 100644 --- a/build.gradle +++ b/build.gradle @@ -48,6 +48,8 @@ ext { minSdkVersion = 15 targetSdkVersion = 31 compileSdkVersion = 31 + targetSdkVersion = 33 + compileSdkVersion = 33 buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 From 60efd8bbe1e6dea9253aba926a190ffe8518e376 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 22 May 2023 14:56:59 +0100 Subject: [PATCH 57/91] [android][tutorial] Centralise and bump deps Summary: Per title. Test Plan: As before. --- android/tutorial/build.gradle | 6 +++--- build.gradle | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/android/tutorial/build.gradle b/android/tutorial/build.gradle index 2526f95ec84..8bf1a54e72e 100644 --- a/android/tutorial/build.gradle +++ b/android/tutorial/build.gradle @@ -44,9 +44,9 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib:$KOTLIN_VERSION" - implementation "androidx.appcompat:appcompat:1.4.1" - implementation "androidx.core:core-ktx:1.8.0" + implementation deps.kotlinStdLibrary + implementation deps.supportAppCompat + implementation deps.supportCoreKtx // Flipper // For simplicity, we use Flipper for both debug and release builds here. diff --git a/build.gradle b/build.gradle index db74f1da389..dd9dae2a7cc 100644 --- a/build.gradle +++ b/build.gradle @@ -46,8 +46,6 @@ subprojects { ext { minSdkVersion = 15 - targetSdkVersion = 31 - compileSdkVersion = 31 targetSdkVersion = 33 compileSdkVersion = 33 buildToolsVersion = "33.0.2" @@ -69,6 +67,7 @@ ext.deps = [ supportEspresso : 'androidx.test.espresso:espresso-core:3.5.1', supportEspressoIntents : 'androidx.test.espresso:espresso-intents:3.5.1', supportTestRunner : 'androidx.test:runner:1.5.2', + supportCoreKtx : 'androidx.core:core-ktx:1.10.1', // Arch archPaging : 'android.arch.paging:runtime:1.0.1', // First-party From 41719ec9050693f0eb89a8cbb3b07bc6846f713b Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 24 May 2023 09:41:48 +0100 Subject: [PATCH 58/91] [circleci] Bump Android resources --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2f25e97ac26..f2b3e66c718 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,13 @@ version: 2.1 orbs: - android: circleci/android@2.1.2 + android: circleci/android@2.3.0 jobs: snapshot: environment: TERM: 'dumb' executor: name: android/android-machine - tag: 2021.10.1 + tag: 2023.04.1 resource-class: large steps: - checkout From e52fb5b1dcb996c0ba3e5cf964a3efe87bf6e249 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 24 May 2023 09:45:11 +0100 Subject: [PATCH 59/91] Updated config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f2b3e66c718..17e9ee42f37 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -19,7 +19,7 @@ jobs: - run: name: build command: | - yes | sdkmanager "platforms;android-30" || true + yes | sdkmanager "platforms;android-33" || true /tmp/retry -m 3 ./gradlew :android:assembleRelease --info - run: name: deploy snapshot From e9038f8696e8d861ca943c89be91865e45f71b9f Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 24 May 2023 11:44:21 +0100 Subject: [PATCH 60/91] [circleci] Bump Android resources --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2f25e97ac26..17e9ee42f37 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,13 +1,13 @@ version: 2.1 orbs: - android: circleci/android@2.1.2 + android: circleci/android@2.3.0 jobs: snapshot: environment: TERM: 'dumb' executor: name: android/android-machine - tag: 2021.10.1 + tag: 2023.04.1 resource-class: large steps: - checkout @@ -19,7 +19,7 @@ jobs: - run: name: build command: | - yes | sdkmanager "platforms;android-30" || true + yes | sdkmanager "platforms;android-33" || true /tmp/retry -m 3 ./gradlew :android:assembleRelease --info - run: name: deploy snapshot From f75dd2b863eb1224f9499c11bfc8d61a9448535c Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 26 May 2023 10:51:21 +0100 Subject: [PATCH 61/91] [js] Upgrade ts-node Summary: Seeing an odd Windows-specific error after upgrading TS. Let's see if this makes a difference. https://github.com/facebook/flipper/actions/runs/5081747814/jobs/9130539676 Test Plan: CI --- desktop/package.json | 2 +- desktop/yarn.lock | 71 +++++++++++++++++++++++++++++++++++++++----- 2 files changed, 65 insertions(+), 8 deletions(-) diff --git a/desktop/package.json b/desktop/package.json index 9ca95288de6..5df28ad6f9c 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -102,7 +102,7 @@ "pretty-format": "^27.5.0", "rimraf": "^3.0.2", "ts-jest": "^26.5.6", - "ts-node": "^9.1.1", + "ts-node": "^10.9.1", "typescript": "^4.9.5" }, "homepage": "https://fbflipper.com/", diff --git a/desktop/yarn.lock b/desktop/yarn.lock index db7abc2942b..2fea644d7b9 100644 --- a/desktop/yarn.lock +++ b/desktop/yarn.lock @@ -2489,6 +2489,13 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@cspotcode/source-map-support@^0.8.0": + version "0.8.1" + resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== + dependencies: + "@jridgewell/trace-mapping" "0.3.9" + "@ctrl/tinycolor@^3.4.0": version "3.4.0" resolved "https://registry.yarnpkg.com/@ctrl/tinycolor/-/tinycolor-3.4.0.tgz#c3c5ae543c897caa9c2a68630bed355be5f9990f" @@ -3215,6 +3222,14 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.0": version "0.3.4" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" @@ -3605,6 +3620,26 @@ resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== +"@tsconfig/node10@^1.0.7": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== + +"@tsconfig/node12@^1.0.7": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== + +"@tsconfig/node14@^1.0.0": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== + +"@tsconfig/node16@^1.0.2": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9" + integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA== + "@types/adobe__node-fetch-retry@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@types/adobe__node-fetch-retry/-/adobe__node-fetch-retry-1.0.4.tgz#6be2530ebb9ccbe14ea87d1246f82c87ecc154cf" @@ -4526,6 +4561,11 @@ acorn-walk@^7.1.1: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.2.0.tgz#0de889a601203909b0fbe07b8938dc21d2e967bc" integrity sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA== +acorn-walk@^8.1.1: + version "8.2.0" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== + acorn@^6.0.1: version "6.4.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6" @@ -4546,6 +4586,11 @@ acorn@^8.2.4: resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.3.0.tgz#1193f9b96c4e8232f00b11a9edff81b2c8b98b88" integrity sha512-tqPKHZ5CaBJw0Xmy0ZZvLs1qTV+BNFSyvn77ASXkpBNfIRk8ev26fKrD9iLGwGA9zedPao52GSHzq8lyZG0NUw== +acorn@^8.4.1: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + acorn@^8.5.0: version "8.7.1" resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" @@ -14083,7 +14128,7 @@ source-map-support@^0.5.16, source-map-support@~0.5.20: buffer-from "^1.0.0" source-map "^0.6.0" -source-map-support@^0.5.17, source-map-support@^0.5.19, source-map-support@^0.5.6: +source-map-support@^0.5.19, source-map-support@^0.5.6: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw== @@ -14739,16 +14784,23 @@ ts-jest@^26.5.6: semver "7.x" yargs-parser "20.x" -ts-node@^9.1.1: - version "9.1.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.1.1.tgz#51a9a450a3e959401bda5f004a72d54b936d376d" - integrity sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg== - dependencies: +ts-node@^10.9.1: + version "10.9.1" + resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== + dependencies: + "@cspotcode/source-map-support" "^0.8.0" + "@tsconfig/node10" "^1.0.7" + "@tsconfig/node12" "^1.0.7" + "@tsconfig/node14" "^1.0.0" + "@tsconfig/node16" "^1.0.2" + acorn "^8.4.1" + acorn-walk "^8.1.1" arg "^4.1.0" create-require "^1.1.0" diff "^4.0.1" make-error "^1.1.1" - source-map-support "^0.5.17" + v8-compile-cache-lib "^3.0.1" yn "3.1.1" tsconfig-paths@^3.14.1: @@ -15138,6 +15190,11 @@ uuid@^8.3.0, uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +v8-compile-cache-lib@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== + v8-compile-cache@^2.0.3: version "2.1.1" resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz#54bc3cdd43317bca91e35dcaf305b1a7237de745" From 6c815ef2e5b1c3e74ac39fedbf71a9e8088b986e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 24 Jul 2023 11:20:07 +0100 Subject: [PATCH 62/91] [js] Run yarn fix --- js/js-flipper/src/client.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/js-flipper/src/client.ts b/js/js-flipper/src/client.ts index 60441f305c5..bfe73bc320a 100644 --- a/js/js-flipper/src/client.ts +++ b/js/js-flipper/src/client.ts @@ -292,8 +292,8 @@ export class FlipperClient { if (method === 'getBackgroundPlugins') { responder.success({ - plugins: [...this.plugins.keys()].filter((key) => - this.plugins.get(key)?.runInBackground?.(), + plugins: [...this.plugins.keys()].filter( + (key) => this.plugins.get(key)?.runInBackground?.(), ), }); return; From 6fab5a5908c3dd4371f2281cf3304987c50a34db Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 4 Aug 2023 10:36:19 +0100 Subject: [PATCH 63/91] [gradle] Remove dokka plugin Summary: This is currently breaking our jetpack-compose build and blocks the entire release as a consequence: https://github.com/facebook/flipper/issues/4970 There are all sorts of workarounds but they require changing the java target which could have other downstream consequences: https://github.com/Kotlin/dokka/issues/2956 We don't actually rely on these artefacts at all, so it's probably safe to just disable this. Closes #4970 Test Plan: ./gradlew publishToMavenLocal --- android/plugins/jetpack-compose/build.gradle | 7 +++++++ build.gradle | 1 - 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/android/plugins/jetpack-compose/build.gradle b/android/plugins/jetpack-compose/build.gradle index ca9e357b50d..2a095f13c3b 100644 --- a/android/plugins/jetpack-compose/build.gradle +++ b/android/plugins/jetpack-compose/build.gradle @@ -32,3 +32,10 @@ android { } apply plugin: 'com.vanniktech.maven.publish' + +import com.vanniktech.maven.publish.SonatypeHost +mavenPublishing { + // Disable javadoc publishing + publishToMavenCentral(SonatypeHost.DEFAULT, false) +} + diff --git a/build.gradle b/build.gradle index 0665eac592f..a0bcfa9d67f 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,6 @@ buildscript { classpath 'com.android.tools.build:gradle:8.0.2' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" - classpath "org.jetbrains.dokka:dokka-gradle-plugin:1.8.20" classpath "org.jetbrains.kotlin:kotlin-serialization:$KOTLIN_VERSION" } } From bbc35ae58fd1dee1faa8ccf2b8e01a2bc99d3199 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 14 Aug 2023 12:28:54 +0100 Subject: [PATCH 64/91] [gradle] ACTUALLY disable dokka builds --- android/plugins/jetpack-compose/build.gradle | 8 +------- build.gradle | 4 ++++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/android/plugins/jetpack-compose/build.gradle b/android/plugins/jetpack-compose/build.gradle index 2a095f13c3b..a4e32371285 100644 --- a/android/plugins/jetpack-compose/build.gradle +++ b/android/plugins/jetpack-compose/build.gradle @@ -31,11 +31,5 @@ android { } } -apply plugin: 'com.vanniktech.maven.publish' - -import com.vanniktech.maven.publish.SonatypeHost -mavenPublishing { - // Disable javadoc publishing - publishToMavenCentral(SonatypeHost.DEFAULT, false) -} +apply plugin: 'com.vanniktech.maven.publish' diff --git a/build.gradle b/build.gradle index a9f47471288..326d81a22d2 100644 --- a/build.gradle +++ b/build.gradle @@ -41,6 +41,10 @@ subprojects { tasks.withType(Javadoc).all { enabled = false } + + tasks.withType(com.android.build.gradle.tasks.JavaDocGenerationTask).all { + enabled = false + } } ext { From eae4f077b203e1ae06f3c31a2494e8f1a9b164b5 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 25 Aug 2023 11:09:17 +0100 Subject: [PATCH 65/91] [flipper] Don't break the build if the reactdevtools patching fails Summary: There seems to be a bug in yarn workspaces on Windows: ``` Error: Cannot find module 'D:\\a\\flipper\\flipper\\desktop\\plugins\\public\\node_modules\\node_modules\\ts-node\\dist\\bin.js ``` Test Plan: Let's see if CI will be happy again. Reviewers: Subscribers: Tasks: Tags: --- desktop/plugins/public/reactdevtools/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/plugins/public/reactdevtools/package.json b/desktop/plugins/public/reactdevtools/package.json index bc8e843951b..32139443acb 100644 --- a/desktop/plugins/public/reactdevtools/package.json +++ b/desktop/plugins/public/reactdevtools/package.json @@ -39,6 +39,6 @@ "flipper-plugin": "*" }, "scripts": { - "postinstall": "ts-node scripts/remove-sourcemap-reference.tsx" + "postinstall": "ts-node scripts/remove-sourcemap-reference.tsx || true" } } From c93191a7fe3c98231313c43ee498756b7989e5d1 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 31 Aug 2023 10:12:19 +0100 Subject: [PATCH 66/91] [android] Bump litho to 0.48.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 6264303a55f..ed764c622cc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ POM_DEVELOPER_ID=facebook POM_DEVELOPER_NAME=facebook POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers -LITHO_VERSION=0.44.0 +LITHO_VERSION=0.48.0 ANDROIDX_VERSION=1.3.0 KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 From f61fb6ae44f0bbe1be4bcc3f53e21cfdee1290a5 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 31 Aug 2023 10:47:15 +0100 Subject: [PATCH 67/91] [android][sample] Disable Fresco integration for now --- .../java/com/facebook/flipper/sample/RootComponentSpec.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java b/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java index 5c8a703a1ee..0c5173c6b32 100644 --- a/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java +++ b/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java @@ -124,12 +124,13 @@ static Component onCreateLayout(final ComponentContext c, @State boolean display .marginDip(YogaEdge.ALL, 10) .textSizeSp(20) .clickHandler(RootComponent.triggerCrash(c))) - .child( + // TODO: Re-enable once we have a new Litho v0.48.0-compatible version of Fresco. + /*.child( FrescoVitoImage2.create(c) .uri(Uri.parse("https://fbflipper.com/img/icon.png")) .marginDip(YogaEdge.ALL, 10) .widthDip(150) - .heightDip(150)) + .heightDip(150))*/ .build(); return VerticalScroll.create(c).childComponent(col).build(); From 6696d277bb7515151ef2320de4610067f8b21e33 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 19 Sep 2023 10:51:48 +0100 Subject: [PATCH 68/91] [android] Bump fresco to 3.1.0 --- android/sample/build.gradle | 1 + build.gradle | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 7847899941c..07392410753 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -90,6 +90,7 @@ dependencies { implementation deps.frescoUiCommon implementation deps.frescoVito implementation deps.frescoVitoLitho + implementation deps.inferAnnotations debugImplementation deps.flipperFrescoPlugin // Integration test diff --git a/build.gradle b/build.gradle index 326d81a22d2..3e497f53318 100644 --- a/build.gradle +++ b/build.gradle @@ -113,12 +113,12 @@ ext.deps = [ testCore : 'androidx.test:core:1.4.0', testRules : 'androidx.test:rules:1.5.0', // Plugin dependencies - flipperFrescoPlugin: 'com.facebook.fresco:flipper-fresco-plugin:3.0.0', - frescoFlipper : 'com.facebook.fresco:flipper:3.0.0', - frescoStetho : 'com.facebook.fresco:stetho:3.0.0', - fresco : 'com.facebook.fresco:fresco:3.0.0', - frescoUiCommon : 'com.facebook.fresco:ui-common:3.0.0', - frescoVito : 'com.facebook.fresco:vito:3.0.0', - frescoVitoCore : 'com.facebook.fresco:vito-core:3.0.0', - frescoVitoLitho : 'com.facebook.fresco:vito-litho:3.0.0', + flipperFrescoPlugin: 'com.facebook.fresco:flipper-fresco-plugin:3.1.0', + frescoFlipper : 'com.facebook.fresco:flipper:3.1.0', + frescoStetho : 'com.facebook.fresco:stetho:3.1.0', + fresco : 'com.facebook.fresco:fresco:3.1.0', + frescoUiCommon : 'com.facebook.fresco:ui-common:3.1.0', + frescoVito : 'com.facebook.fresco:vito:3.1.0', + frescoVitoCore : 'com.facebook.fresco:vito-core:3.1.0', + frescoVitoLitho : 'com.facebook.fresco:vito-litho:3.1.0', ] From 699759be84a243a4bf0c398c7c490434dd6d0f2e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 19 Sep 2023 10:51:58 +0100 Subject: [PATCH 69/91] Back out "Disable Fresco integration for now (#5101)" Original commit changeset: 42b95c21eb04 --- .../flipper/sample/RootComponentSpec.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java b/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java index 2035370704d..5c8a703a1ee 100644 --- a/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java +++ b/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java @@ -8,8 +8,10 @@ package com.facebook.flipper.sample; import android.content.Intent; +import android.net.Uri; import com.facebook.flipper.android.diagnostics.FlipperDiagnosticActivity; import com.facebook.flipper.sample.network.NetworkClient; +import com.facebook.fresco.vito.litho.FrescoVitoImage2; import com.facebook.litho.ClickEvent; import com.facebook.litho.Column; import com.facebook.litho.Component; @@ -122,14 +124,12 @@ static Component onCreateLayout(final ComponentContext c, @State boolean display .marginDip(YogaEdge.ALL, 10) .textSizeSp(20) .clickHandler(RootComponent.triggerCrash(c))) - // TODO: Re-enable once we have a new Litho v0.48.0-compatible version of Fresco. - /*.child( - FrescoVitoImage2.create(c) - .uri(Uri.parse("https://fbflipper.com/img/icon.png")) - .marginDip(YogaEdge.ALL, 10) - .widthDip(150) - .heightDip(150))*/ - + .child( + FrescoVitoImage2.create(c) + .uri(Uri.parse("https://fbflipper.com/img/icon.png")) + .marginDip(YogaEdge.ALL, 10) + .widthDip(150) + .heightDip(150)) .build(); return VerticalScroll.create(c).childComponent(col).build(); From 3bfbee18adeb38cbc63dec4bdee028acae8f335b Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 19 Sep 2023 10:57:28 +0100 Subject: [PATCH 70/91] [android][sample] Display fresco image on demand --- .../java/com/facebook/flipper/sample/RootComponentSpec.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java b/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java index 5c8a703a1ee..d22723b9c52 100644 --- a/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java +++ b/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java @@ -125,11 +125,11 @@ static Component onCreateLayout(final ComponentContext c, @State boolean display .textSizeSp(20) .clickHandler(RootComponent.triggerCrash(c))) .child( - FrescoVitoImage2.create(c) + displayImage ? FrescoVitoImage2.create(c) .uri(Uri.parse("https://fbflipper.com/img/icon.png")) .marginDip(YogaEdge.ALL, 10) .widthDip(150) - .heightDip(150)) + .heightDip(150) : null) .build(); return VerticalScroll.create(c).childComponent(col).build(); From f87d14dd8f25887e40db9110e2c1e3981a4d6d81 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 20 Sep 2023 10:11:40 +0100 Subject: [PATCH 71/91] [android][sample] Display fresco image on demand --- .../java/com/facebook/flipper/sample/RootComponentSpec.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java b/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java index 5c8a703a1ee..d22723b9c52 100644 --- a/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java +++ b/android/sample/src/main/java/com/facebook/flipper/sample/RootComponentSpec.java @@ -125,11 +125,11 @@ static Component onCreateLayout(final ComponentContext c, @State boolean display .textSizeSp(20) .clickHandler(RootComponent.triggerCrash(c))) .child( - FrescoVitoImage2.create(c) + displayImage ? FrescoVitoImage2.create(c) .uri(Uri.parse("https://fbflipper.com/img/icon.png")) .marginDip(YogaEdge.ALL, 10) .widthDip(150) - .heightDip(150)) + .heightDip(150) : null) .build(); return VerticalScroll.create(c).childComponent(col).build(); From 47331a35cefe8ccda6659231fb7a1c3a4eb1505f Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 24 Oct 2023 11:49:27 +0100 Subject: [PATCH 72/91] [packer] Fix packlist Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: --- packer/src/packlist.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packer/src/packlist.yaml b/packer/src/packlist.yaml index ff8f54e23e0..d929b16ead8 100644 --- a/packer/src/packlist.yaml +++ b/packer/src/packlist.yaml @@ -60,7 +60,7 @@ server-linux: - '!*' - flipper-runtime core: - - '!flipper-runtime + - '!flipper-runtime' - '!static' static: - '!*' From 27e15b508a6f7afca59cbb29cf41b5591398c3fc Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 24 Oct 2023 14:06:57 +0100 Subject: [PATCH 73/91] [android] Bump AGP to 8.1.2 --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3e497f53318..109b8d1bff3 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.0' + classpath 'com.android.tools.build:gradle:8.1.2' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.kotlin:kotlin-serialization:$KOTLIN_VERSION" From 1b0d3e038f12a759e3c8ea7234cb4ddda5b2067a Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 24 Oct 2023 14:10:15 +0100 Subject: [PATCH 74/91] [android] Bump target SDK to 34 Summary: Changelog: Android SDK is now built against SDK 34 Test Plan: Reviewers: Subscribers: Tasks: Tags: --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 109b8d1bff3..1cb548ff419 100644 --- a/build.gradle +++ b/build.gradle @@ -49,8 +49,8 @@ subprojects { ext { minSdkVersion = 15 - targetSdkVersion = 33 - compileSdkVersion = 33 + targetSdkVersion = 34 + compileSdkVersion = 34 buildToolsVersion = "33.0.2" ndkVersion = "25.1.8937393" javaTargetVersion = JavaVersion.VERSION_17 From 502bdd6a2d3435f87ca90ef8c538bfc1d618e082 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 24 Oct 2023 14:14:26 +0100 Subject: [PATCH 75/91] [android][sample] Upgrade compose deps Summary: Was dependent on SDK 34. Test Plan: Reviewers: Subscribers: Tasks: Tags: --- android/sample/build.gradle | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/android/sample/build.gradle b/android/sample/build.gradle index 07392410753..dadc3b5fc1f 100644 --- a/android/sample/build.gradle +++ b/android/sample/build.gradle @@ -75,13 +75,13 @@ dependencies { // Compose implementation 'androidx.legacy:legacy-support-v4:1.0.0' - implementation 'androidx.activity:activity-ktx:1.7.2' - implementation 'androidx.compose.runtime:runtime:1.4.3' - implementation 'androidx.activity:activity-compose:1.7.2' - implementation 'androidx.compose.ui:ui:1.4.3' - implementation 'androidx.compose.material3:material3:1.1.1' - implementation 'androidx.compose.ui:ui-tooling:1.4.3' - implementation 'androidx.compose.ui:ui-tooling-preview:1.4.3' + implementation 'androidx.activity:activity-ktx:1.8.0' + implementation 'androidx.compose.runtime:runtime:1.5.4' + implementation 'androidx.activity:activity-compose:1.8.0' + implementation 'androidx.compose.ui:ui:1.5.4' + implementation 'androidx.compose.material3:material3:1.1.2' + implementation 'androidx.compose.ui:ui-tooling:1.5.4' + implementation 'androidx.compose.ui:ui-tooling-preview:1.5.4' // Third-party implementation deps.soloader From ffc141e409e9bdfcd54b2301bde0af39b83cfbc5 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 27 Oct 2023 15:30:06 +0100 Subject: [PATCH 76/91] [android] Bump Fresco to 3.1.3 --- build.gradle | 16 ++++++++-------- gradle.properties | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 1cb548ff419..48fc54c0567 100644 --- a/build.gradle +++ b/build.gradle @@ -113,12 +113,12 @@ ext.deps = [ testCore : 'androidx.test:core:1.4.0', testRules : 'androidx.test:rules:1.5.0', // Plugin dependencies - flipperFrescoPlugin: 'com.facebook.fresco:flipper-fresco-plugin:3.1.0', - frescoFlipper : 'com.facebook.fresco:flipper:3.1.0', - frescoStetho : 'com.facebook.fresco:stetho:3.1.0', - fresco : 'com.facebook.fresco:fresco:3.1.0', - frescoUiCommon : 'com.facebook.fresco:ui-common:3.1.0', - frescoVito : 'com.facebook.fresco:vito:3.1.0', - frescoVitoCore : 'com.facebook.fresco:vito-core:3.1.0', - frescoVitoLitho : 'com.facebook.fresco:vito-litho:3.1.0', + flipperFrescoPlugin: "com.facebook.fresco:flipper-fresco-plugin:$FRESCO_VERSION", + frescoFlipper : "com.facebook.fresco:flipper:$FRESCO_VERSION", + frescoStetho : "com.facebook.fresco:stetho:$FRESCO_VERSION", + fresco : "com.facebook.fresco:fresco:$FRESCO_VERSION", + frescoUiCommon : "com.facebook.fresco:ui-common:$FRESCO_VERSION", + frescoVito : "com.facebook.fresco:vito:$FRESCO_VERSION", + frescoVitoCore : "com.facebook.fresco:vito-core:$FRESCO_VERSION", + frescoVitoLitho : "com.facebook.fresco:vito-litho:$FRESCO_VERSION", ] diff --git a/gradle.properties b/gradle.properties index c4b875f7f07..e45f6c236ff 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,6 +18,7 @@ POM_DEVELOPER_NAME=facebook POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers LITHO_VERSION=0.48.0 +FRESCO_VERSION=3.1.3 ANDROIDX_VERSION=1.3.0 KOTLIN_VERSION=1.8.20 FBJNI_VERSION=0.3.0 From 007bb61ef9bbf51bab6f392f12fe0e8cc40389cb Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 19 Jan 2024 12:05:56 +0000 Subject: [PATCH 77/91] [flipper] Upgrade AGP to 8.2.1, Gradle to 8.2 Summary: This is required to support the current stable version of Android Studio (2023.1.1). Test Plan: ./gradlew :sample:installDebug, sync in AS --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 7e5f4b324f0..a0e016e7470 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' + classpath 'com.android.tools.build:gradle:8.2.1' classpath 'com.vanniktech:gradle-maven-publish-plugin:0.25.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$KOTLIN_VERSION" classpath "org.jetbrains.kotlin:kotlin-serialization:$KOTLIN_VERSION" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a2d883fb9b9..e8cc9f9627a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -5,7 +5,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 2e594aa78b54b0f0c8543bfe95f871112a035dde Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 25 Mar 2024 17:23:18 +0000 Subject: [PATCH 78/91] [flipper] Add --tar option to build server script for Linux and Windows --- .../scripts/build-flipper-server-release.tsx | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/desktop/scripts/build-flipper-server-release.tsx b/desktop/scripts/build-flipper-server-release.tsx index 90ee412ee1a..d5d4cf7d239 100644 --- a/desktop/scripts/build-flipper-server-release.tsx +++ b/desktop/scripts/build-flipper-server-release.tsx @@ -735,6 +735,34 @@ async function createMacDMG( }); } +async function createTar( + platform: BuildPlatform, + outputPath: string, + destPath: string, +) { + console.log(`⚙️ Create tar of: ${outputPath}`); + + const name = `flipper-server-${platform}.tar.gz`; + const temporaryDirectory = os.tmpdir(); + const tempTarPath = path.resolve(temporaryDirectory, name); + const finalTarPath = path.resolve(destPath, name); + + // Create a tar.gz based on the output path + await tar.c( + { + gzip: true, + file: tempTarPath, + cwd: outputPath, + }, + ['.'], + ); + + await fs.move(tempTarPath, finalTarPath); + await fs.remove(outputPath); + + console.log(`✅ Tar successfully created: ${finalTarPath}`); +} + async function setUpLinuxBundle(outputDir: string) { console.log(`⚙️ Creating Linux startup script in ${outputDir}/flipper`); await fs.writeFile(path.join(outputDir, 'flipper'), LINUX_STARTUP_SCRIPT); @@ -920,8 +948,14 @@ async function bundleServerReleaseForPlatform( if (platform === BuildPlatform.LINUX) { await setUpLinuxBundle(outputDir); + if (argv.tar) { + await createTar(platform, outputDir, distDir); + } } else if (platform === BuildPlatform.WINDOWS) { await setUpWindowsBundle(outputDir); + if (argv.tar) { + await createTar(platform, outputDir, distDir); + } } console.log( From 82fe1ff422daef67a5e66e27f240d96d3dd23ba8 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 25 Mar 2024 17:25:52 +0000 Subject: [PATCH 79/91] Upload bundled Linux and Windows builds --- .github/workflows/release.yml | 240 ++++++++++++++++++---------------- 1 file changed, 125 insertions(+), 115 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a4df5d9ab5..c4f6c2d3658 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,7 +5,7 @@ on: branches: - main paths: - - 'desktop/package.json' + - "desktop/package.json" jobs: release: @@ -29,7 +29,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} ref: ${{ steps.extract-version-commit.outputs.commit }} - version_tag_prefix: 'v' + version_tag_prefix: "v" version_assertion_command: 'grep -q "\"version\": \"$version\"" desktop/package.json' - name: Create release if: ${{ steps.tag-version-commit.outputs.tag != '' }} @@ -53,32 +53,42 @@ jobs: desktop-directory: ./desktop steps: - - uses: actions/checkout@v3.5.3 - with: - ref: ${{ needs.release.outputs.tag }} - - uses: actions/setup-node@v3.6.0 - with: - node-version: '18.x' - - name: Install - uses: nick-invision/retry@v2.0.0 - with: - timeout_minutes: 10 - max_attempts: 3 - command: cd ${{env.desktop-directory}} && yarn - - name: Build - run: cd ${{env.desktop-directory}} && yarn build:flipper-server --mac --dmg - - name: List dist artifacts - run: ls -l dist/ - - name: Upload x86-64 - uses: actions/upload-artifact@v3.1.2 - with: - name: 'Flipper-server-mac-x64.dmg' - path: 'dist/Flipper-server-mac-x64.dmg' - - name: Upload aarch64 - uses: actions/upload-artifact@v3.1.2 - with: - name: 'Flipper-server-mac-aarch64.dmg' - path: 'dist/Flipper-server-mac-aarch64.dmg' + - uses: actions/checkout@v3.5.3 + with: + ref: ${{ needs.release.outputs.tag }} + - uses: actions/setup-node@v3.6.0 + with: + node-version: "18.x" + - name: Install + uses: nick-invision/retry@v2.0.0 + with: + timeout_minutes: 10 + max_attempts: 3 + command: cd ${{env.desktop-directory}} && yarn + - name: Build + run: cd ${{env.desktop-directory}} && yarn build:flipper-server --mac --dmg --linux --win --tar + - name: List dist artifacts + run: ls -l dist/ + - name: Upload Mac x86-64 + uses: actions/upload-artifact@v3.1.2 + with: + name: "Flipper-server-mac-x64.dmg" + path: "dist/Flipper-server-mac-x64.dmg" + - name: Upload Mac aarch64 + uses: actions/upload-artifact@v3.1.2 + with: + name: "Flipper-server-mac-aarch64.dmg" + path: "dist/Flipper-server-mac-aarch64.dmg" + - name: Upload Linux x64 + uses: actions/upload-artifact@v3.1.2 + with: + name: "flipper-server-linux.tar.gz" + path: "dist/flipper-server-linux.tar.gz" + - name: Upload Windows x64 + uses: actions/upload-artifact@v3.1.2 + with: + name: "flipper-server-windows.tar.gz" + path: "dist/flipper-server-windows.tar.gz" build-flipper-server: needs: @@ -88,27 +98,27 @@ jobs: desktop-directory: ./desktop steps: - - uses: actions/checkout@v3.5.3 - with: - ref: ${{ needs.release.outputs.tag }} - - uses: actions/setup-node@v3.6.0 - with: - node-version: '18.x' - - name: Install - uses: nick-invision/retry@v2.0.0 - with: - timeout_minutes: 10 - max_attempts: 3 - command: cd ${{env.desktop-directory}} && yarn - - name: Build - run: cd ${{env.desktop-directory}} && yarn build:flipper-server - - name: List dist artifacts - run: ls -l dist/ - - name: Upload flipper-server - uses: actions/upload-artifact@v3.1.2 - with: - name: 'flipper-server.tgz' - path: 'dist/flipper-server.tgz' + - uses: actions/checkout@v3.5.3 + with: + ref: ${{ needs.release.outputs.tag }} + - uses: actions/setup-node@v3.6.0 + with: + node-version: "18.x" + - name: Install + uses: nick-invision/retry@v2.0.0 + with: + timeout_minutes: 10 + max_attempts: 3 + command: cd ${{env.desktop-directory}} && yarn + - name: Build + run: cd ${{env.desktop-directory}} && yarn build:flipper-server + - name: List dist artifacts + run: ls -l dist/ + - name: Upload flipper-server + uses: actions/upload-artifact@v3.1.2 + with: + name: "flipper-server.tgz" + path: "dist/flipper-server.tgz" publish: needs: @@ -118,53 +128,53 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.3 - with: - ref: ${{ needs.release.outputs.tag }} - - name: Download Flipper Server x86-64 - if: ${{ needs.release.outputs.tag != '' }} - uses: actions/download-artifact@v1 - with: - name: 'Flipper-server-mac-x64.dmg' - path: 'Flipper-server-mac-x64.dmg' - - name: Download Flipper Server aarch64 - if: ${{ needs.release.outputs.tag != '' }} - uses: actions/download-artifact@v1 - with: - name: 'Flipper-server-mac-aarch64.dmg' - path: 'Flipper-server-mac-aarch64.dmg' - - name: Download Flipper Server - if: ${{ needs.release.outputs.tag != '' }} - uses: actions/download-artifact@v1 - with: - name: 'flipper-server.tgz' - path: 'flipper-server.tgz' - - name: GitHub Upload Release Artifacts - if: ${{ needs.release.outputs.tag != '' }} - uses: aigoncharov/github-upload-release-artifacts-action@2.2.3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - created_tag: ${{ needs.release.outputs.tag }} - args: flipper-server.tgz/flipper-server.tgz Flipper-server-mac-x64.dmg/Flipper-server-mac-x64.dmg Flipper-server-mac-aarch64.dmg/Flipper-server-mac-aarch64.dmg - - name: Set up npm token - run: echo "//registry.yarnpkg.com/:_authToken=${{ secrets.FLIPPER_NPM_TOKEN }}" >> ~/.npmrc - - name: Publish flipper-server on NPM - if: ${{ needs.release.outputs.tag != '' }} - run: | - tar zxvf flipper-server.tgz/flipper-server.tgz - cd package - yarn publish - - name: Open issue on failure - if: failure() - uses: JasonEtco/create-an-issue@v2.9.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPOSITORY: ${{ github.repository }} - RUN_ID: ${{ github.run_id }} - WORKFLOW_NAME: "Publish" - with: - filename: .github/action-failure-template.md + - uses: actions/checkout@v3.5.3 + with: + ref: ${{ needs.release.outputs.tag }} + - name: Download Flipper Server x86-64 + if: ${{ needs.release.outputs.tag != '' }} + uses: actions/download-artifact@v1 + with: + name: "Flipper-server-mac-x64.dmg" + path: "Flipper-server-mac-x64.dmg" + - name: Download Flipper Server aarch64 + if: ${{ needs.release.outputs.tag != '' }} + uses: actions/download-artifact@v1 + with: + name: "Flipper-server-mac-aarch64.dmg" + path: "Flipper-server-mac-aarch64.dmg" + - name: Download Flipper Server + if: ${{ needs.release.outputs.tag != '' }} + uses: actions/download-artifact@v1 + with: + name: "flipper-server.tgz" + path: "flipper-server.tgz" + - name: GitHub Upload Release Artifacts + if: ${{ needs.release.outputs.tag != '' }} + uses: aigoncharov/github-upload-release-artifacts-action@2.2.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + created_tag: ${{ needs.release.outputs.tag }} + args: flipper-server.tgz/flipper-server.tgz Flipper-server-mac-x64.dmg/Flipper-server-mac-x64.dmg Flipper-server-mac-aarch64.dmg/Flipper-server-mac-aarch64.dmg + - name: Set up npm token + run: echo "//registry.yarnpkg.com/:_authToken=${{ secrets.FLIPPER_NPM_TOKEN }}" >> ~/.npmrc + - name: Publish flipper-server on NPM + if: ${{ needs.release.outputs.tag != '' }} + run: | + tar zxvf flipper-server.tgz/flipper-server.tgz + cd package + yarn publish + - name: Open issue on failure + if: failure() + uses: JasonEtco/create-an-issue@v2.9.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPOSITORY: ${{ github.repository }} + RUN_ID: ${{ github.run_id }} + WORKFLOW_NAME: "Publish" + with: + filename: .github/action-failure-template.md dispatch: needs: @@ -172,22 +182,22 @@ jobs: runs-on: ubuntu-latest steps: - - name: Publish Workflow Dispatch - if: ${{ needs.release.outputs.tag != '' }} - uses: benc-uk/workflow-dispatch@v1.2.2 - with: - workflow: Publish Pods - ref: ${{ needs.release.outputs.tag }} - - name: Publish NPM - if: ${{ needs.release.outputs.tag != '' }} - uses: benc-uk/workflow-dispatch@v1.2.2 - with: - workflow: Publish NPM - ref: ${{ needs.release.outputs.tag }} - - name: Publish Android - if: ${{ needs.release.outputs.tag != '' }} - uses: benc-uk/workflow-dispatch@v1.2.2 - with: - workflow: Publish Android - ref: ${{ needs.release.outputs.tag }} - inputs: '{"tag": "${{ needs.release.outputs.tag }}"}' + - name: Publish Workflow Dispatch + if: ${{ needs.release.outputs.tag != '' }} + uses: benc-uk/workflow-dispatch@v1.2.2 + with: + workflow: Publish Pods + ref: ${{ needs.release.outputs.tag }} + - name: Publish NPM + if: ${{ needs.release.outputs.tag != '' }} + uses: benc-uk/workflow-dispatch@v1.2.2 + with: + workflow: Publish NPM + ref: ${{ needs.release.outputs.tag }} + - name: Publish Android + if: ${{ needs.release.outputs.tag != '' }} + uses: benc-uk/workflow-dispatch@v1.2.2 + with: + workflow: Publish Android + ref: ${{ needs.release.outputs.tag }} + inputs: '{"tag": "${{ needs.release.outputs.tag }}"}' From 3ff75353de22561aa0624fd5df4197ef947d81ff Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Tue, 7 May 2024 10:37:49 +0100 Subject: [PATCH 80/91] [packer] Fix tests --- packer/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packer/src/main.rs b/packer/src/main.rs index df74996ec90..cd57087c1cc 100644 --- a/packer/src/main.rs +++ b/packer/src/main.rs @@ -405,7 +405,7 @@ mod test { fn test_included_packlist_parses() { let res: PackList = serde_yaml::from_str(DEFAULT_PACKLIST).expect("Default packlist doesn't deserialize"); - assert_eq!(res.0.len(), 4); + assert_eq!(res.0.len(), 6); } #[test] From 954f58745a7c93786cf0c247cc2e0af0f66e3885 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 10 Jul 2024 14:30:19 +0100 Subject: [PATCH 81/91] [android] Bump Litho dependency to 0.50.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c3a40ea144f..477dcc53f43 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ POM_DEVELOPER_ID=facebook POM_DEVELOPER_NAME=facebook POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers -LITHO_VERSION=0.49.0 +LITHO_VERSION=0.50.0 FRESCO_VERSION=3.1.3 ANDROIDX_VERSION=1.3.0 ANDROIDX_ACTIVITY_VERSION=1.8.2 From f289f1a26478c9641bc2573769e23e84f13168d4 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 10 Jul 2024 14:35:12 +0100 Subject: [PATCH 82/91] [gh] Remove doctor build now that it no longer exists --- .github/workflows/nodejs-doctor.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/nodejs-doctor.yml diff --git a/.github/workflows/nodejs-doctor.yml b/.github/workflows/nodejs-doctor.yml deleted file mode 100644 index 0ca49a4298e..00000000000 --- a/.github/workflows/nodejs-doctor.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Doctor Node CI -# This action runs on 'git push' and PRs -on: [push, pull_request] - -jobs: - build: - runs-on: 'ubuntu-latest' - env: - doctor-directory: ./desktop/doctor - steps: - - uses: actions/checkout@v3.5.3 - - uses: actions/setup-node@v3.6.0 - with: - node-version: '18.x' - - name: install - working-directory: ${{env.doctor-directory}} - run: yarn - - name: run - working-directory: ${{env.doctor-directory}} - run: yarn run run From bdad8565170d25277a3105f93ffc106c106e6614 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 10 Jul 2024 14:35:30 +0100 Subject: [PATCH 83/91] [android] Bump Litho dependency to 0.50.0 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c3a40ea144f..477dcc53f43 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ POM_DEVELOPER_ID=facebook POM_DEVELOPER_NAME=facebook POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers -LITHO_VERSION=0.49.0 +LITHO_VERSION=0.50.0 FRESCO_VERSION=3.1.3 ANDROIDX_VERSION=1.3.0 ANDROIDX_ACTIVITY_VERSION=1.8.2 From 33af3386b11ad56ec814912f54d360e367ad15c6 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Wed, 10 Jul 2024 19:17:56 +0100 Subject: [PATCH 84/91] [android] Bump Litho dependency to 0.50.1 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c3a40ea144f..bdca638aa1e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ POM_DEVELOPER_ID=facebook POM_DEVELOPER_NAME=facebook POM_ISSUES_URL=https://github.com/facebook/flipper/issues/ # Shared version numbers -LITHO_VERSION=0.49.0 +LITHO_VERSION=0.50.1 FRESCO_VERSION=3.1.3 ANDROIDX_VERSION=1.3.0 ANDROIDX_ACTIVITY_VERSION=1.8.2 From f50e7a4efa81f6276fcc2e085e4852198fbe3d85 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 11 Jul 2024 10:36:39 +0100 Subject: [PATCH 85/91] [litho] Add missing json serialization dep --- android/plugins/litho/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/android/plugins/litho/build.gradle b/android/plugins/litho/build.gradle index 83a3a6a89c2..b583d189f68 100644 --- a/android/plugins/litho/build.gradle +++ b/android/plugins/litho/build.gradle @@ -37,6 +37,7 @@ android { implementation deps.lithoSectionsCore implementation deps.lithoWidget implementation deps.supportAppCompat + implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.1" compileOnly deps.jsr305 testImplementation deps.junit From 1246c8b6f9376acc8c05fcaf8e3a2fc8a0aa2163 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 12 Jul 2024 07:28:43 -0700 Subject: [PATCH 86/91] Disable another flaky test (#5653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/facebook/flipper/pull/5653 Test Plan: ``` $ yarn test Test Suites: 2 skipped, 98 passed, 98 of 100 total Tests: 19 skipped, 545 passed, 564 total Snapshots: 190 passed, 190 total Time: 44.194 s, estimated 169 s Ran all test suites. ✨ Done in 49.96s. ``` Reviewed By: antonk52 Differential Revision: D59680971 Pulled By: passy fbshipit-source-id: 3fd6dd7ecfa14be53de3bbe67e81ab79793ae610 --- desktop/flipper-ui/src/__tests__/PluginContainer.node.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop/flipper-ui/src/__tests__/PluginContainer.node.tsx b/desktop/flipper-ui/src/__tests__/PluginContainer.node.tsx index 43284e04190..cc305f752ae 100644 --- a/desktop/flipper-ui/src/__tests__/PluginContainer.node.tsx +++ b/desktop/flipper-ui/src/__tests__/PluginContainer.node.tsx @@ -124,7 +124,8 @@ test.skip('Plugin container can render plugin and receive updates', async () => expect((await renderer.findByTestId('counter')).textContent).toBe('2'); }); -test('Number of times console errors/warning during plugin render', async () => { +// TODO(T119353406): Disabled due to flakiness. +test.skip('Number of times console errors/warning during plugin render', async () => { await renderMockFlipperWithPlugin(TestPlugin); expect(errorSpy.mock.calls).toEqual([ From d988d710d0eb0c74c7bf00fa394e0c1505ea228e Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 15 Jul 2024 14:43:36 +0100 Subject: [PATCH 87/91] [js] Use tsx for plugin postinstall --- desktop/plugins/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/plugins/package.json b/desktop/plugins/package.json index cb40f1649c6..fcb8107c947 100644 --- a/desktop/plugins/package.json +++ b/desktop/plugins/package.json @@ -24,6 +24,6 @@ "react-dom": "*" }, "scripts": { - "postinstall": "cd .. && ./ts-node ./plugins/postinstall.tsx" + "postinstall": "cd .. && tsx ./plugins/postinstall.tsx" } } From 9ad0a1520fc74cab10b746cc3c3fd519c6ea470d Mon Sep 17 00:00:00 2001 From: Emmanuel Proulx Date: Mon, 15 Jul 2024 06:59:55 -0700 Subject: [PATCH 88/91] Moved package from AndroidManifest.xml into build.gradle namespace (#5541) Summary: This is necessary because Google requires this in AGP version 8. The code no longer works now that we're at version 8 of AGP. This is because AGP 8 requires that the package be changed to a namespace option in build.gradle. ## Changelog The React Native module now works with Android Gradle Plugin version 8. Pull Request resolved: https://github.com/facebook/flipper/pull/5541 Test Plan: I imported this in my own React Native project, and I was getting a build failed: "Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace." Then I made this one change and rebuilt my project. The build worked and my app ran correctly. Reviewed By: LukeDefeo Differential Revision: D55419610 Pulled By: passy fbshipit-source-id: 5646172b14ab8a4ec6b6d3ffeb3b68c44e707883 --- react-native/react-native-flipper/android/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/react-native/react-native-flipper/android/build.gradle b/react-native/react-native-flipper/android/build.gradle index 90d8fca9d86..1e771049fe9 100644 --- a/react-native/react-native-flipper/android/build.gradle +++ b/react-native/react-native-flipper/android/build.gradle @@ -48,6 +48,7 @@ def safeExtGet(prop, fallback) { apply plugin: 'com.android.library' android { + namespace 'com.facebook.flipper.reactnative' compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION) buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION) defaultConfig { From ea917828ae653075c43c5b54b99f8f3ed59fd8fe Mon Sep 17 00:00:00 2001 From: Ishmael Tshikhovhokhovho Date: Mon, 15 Jul 2024 09:24:15 -0700 Subject: [PATCH 89/91] Network plugin - Support formatting network request (#5652) Summary: The network plugin allows for formatting network responses, making it possible to convert protobuf messages into a human-readable format. However, there is currently no method to format network request bodies. This PR introduces a NetworkRequestFormatter to address this issue. ## Changelog Network plugin: Support formatting request body Pull Request resolved: https://github.com/facebook/flipper/pull/5652 Test Plan: Here we intercepted the network call and modified the request and response bodies Screenshot 2024-07-11 at 23 13 58 Reviewed By: antonk52 Differential Revision: D59750064 Pulled By: passy fbshipit-source-id: 787227184d5609e9fdb3f07962b7cff0e972726f --- .../plugins/network/NetworkFlipperPlugin.java | 34 +++++++++++++++++-- .../network/NetworkRequestFormatter.java | 18 ++++++++++ 2 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 android/plugins/network/src/main/java/com/facebook/flipper/plugins/network/NetworkRequestFormatter.java diff --git a/android/plugins/network/src/main/java/com/facebook/flipper/plugins/network/NetworkFlipperPlugin.java b/android/plugins/network/src/main/java/com/facebook/flipper/plugins/network/NetworkFlipperPlugin.java index 4c9a1bf2d18..f3499d46d3b 100644 --- a/android/plugins/network/src/main/java/com/facebook/flipper/plugins/network/NetworkFlipperPlugin.java +++ b/android/plugins/network/src/main/java/com/facebook/flipper/plugins/network/NetworkFlipperPlugin.java @@ -19,7 +19,9 @@ public class NetworkFlipperPlugin extends BufferingFlipperPlugin implements NetworkReporter { public static final String ID = "Network"; private static final int MAX_BODY_SIZE_IN_BYTES = 1024 * 1024; + private List mFormatters; + private final List mRequestFormatters; public NetworkFlipperPlugin() { this(null); @@ -27,6 +29,13 @@ public NetworkFlipperPlugin() { public NetworkFlipperPlugin(List formatters) { this.mFormatters = formatters; + this.mRequestFormatters = null; + } + + public NetworkFlipperPlugin( + List formatters, List requestFormatters) { + this.mFormatters = formatters; + this.mRequestFormatters = requestFormatters; } @Override @@ -40,7 +49,8 @@ public void setFormatters(List formatters) { @Override public void reportRequest(final RequestInfo requestInfo) { - (new ErrorReportingRunnable(getConnection()) { + final Runnable job = + new ErrorReportingRunnable(getConnection()) { @Override protected void runOrThrow() throws Exception { final FlipperObject request = @@ -55,8 +65,26 @@ protected void runOrThrow() throws Exception { send("newRequest", request); } - }) - .run(); + }; + + if (mRequestFormatters != null) { + for (NetworkRequestFormatter formatter : mRequestFormatters) { + if (formatter.shouldFormat(requestInfo)) { + formatter.format( + requestInfo, + new NetworkRequestFormatter.OnCompletionListener() { + @Override + public void onCompletion(final String json) { + requestInfo.body = json.getBytes(); + job.run(); + } + }); + return; + } + } + } + + job.run(); } @Override diff --git a/android/plugins/network/src/main/java/com/facebook/flipper/plugins/network/NetworkRequestFormatter.java b/android/plugins/network/src/main/java/com/facebook/flipper/plugins/network/NetworkRequestFormatter.java new file mode 100644 index 00000000000..9ae35ab19a3 --- /dev/null +++ b/android/plugins/network/src/main/java/com/facebook/flipper/plugins/network/NetworkRequestFormatter.java @@ -0,0 +1,18 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +package com.facebook.flipper.plugins.network; + +public interface NetworkRequestFormatter { + interface OnCompletionListener { + void onCompletion(String json); + } + + boolean shouldFormat(NetworkReporter.RequestInfo request); + + void format(NetworkReporter.RequestInfo request, OnCompletionListener onCompletionListener); +} From eca526ce9105283814e5b5478b7ec48eacfee50b Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 15 Jul 2024 18:49:50 +0100 Subject: [PATCH 90/91] [js] Use tsx for plugin postinstall --- desktop/plugins/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/plugins/package.json b/desktop/plugins/package.json index cb40f1649c6..17e88b95e4e 100644 --- a/desktop/plugins/package.json +++ b/desktop/plugins/package.json @@ -24,6 +24,6 @@ "react-dom": "*" }, "scripts": { - "postinstall": "cd .. && ./ts-node ./plugins/postinstall.tsx" + "postinstall": "cd .. && ./node_modules/.bin/tsx ./plugins/postinstall.tsx" } } From 37dae2260a33ba695900efd6609d8d31e41545d0 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Mon, 15 Jul 2024 18:49:50 +0100 Subject: [PATCH 91/91] [js] Use tsx for plugin postinstall --- desktop/plugins/package.json | 5 +- desktop/plugins/yarn.lock | 171 +++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+), 2 deletions(-) diff --git a/desktop/plugins/package.json b/desktop/plugins/package.json index cb40f1649c6..1084f25c842 100644 --- a/desktop/plugins/package.json +++ b/desktop/plugins/package.json @@ -9,7 +9,8 @@ "devDependencies": { "fs-extra": "^9.0.1", "p-map": "^4.0.0", - "promisify-child-process": "^4.1.1" + "promisify-child-process": "^4.1.1", + "tsx": "^4.16.2" }, "peerDependencies": { "@ant-design/icons": "*", @@ -24,6 +25,6 @@ "react-dom": "*" }, "scripts": { - "postinstall": "cd .. && ./ts-node ./plugins/postinstall.tsx" + "postinstall": "tsx postinstall.tsx" } } diff --git a/desktop/plugins/yarn.lock b/desktop/plugins/yarn.lock index 0991cc6a77c..cc47c48ba0e 100644 --- a/desktop/plugins/yarn.lock +++ b/desktop/plugins/yarn.lock @@ -2,6 +2,121 @@ # yarn lockfile v1 +"@esbuild/aix-ppc64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz#c7184a326533fcdf1b8ee0733e21c713b975575f" + integrity sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ== + +"@esbuild/android-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz#09d9b4357780da9ea3a7dfb833a1f1ff439b4052" + integrity sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A== + +"@esbuild/android-arm@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.21.5.tgz#9b04384fb771926dfa6d7ad04324ecb2ab9b2e28" + integrity sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg== + +"@esbuild/android-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/android-x64/-/android-x64-0.21.5.tgz#29918ec2db754cedcb6c1b04de8cd6547af6461e" + integrity sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA== + +"@esbuild/darwin-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz#e495b539660e51690f3928af50a76fb0a6ccff2a" + integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ== + +"@esbuild/darwin-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz#c13838fa57372839abdddc91d71542ceea2e1e22" + integrity sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw== + +"@esbuild/freebsd-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz#646b989aa20bf89fd071dd5dbfad69a3542e550e" + integrity sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g== + +"@esbuild/freebsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz#aa615cfc80af954d3458906e38ca22c18cf5c261" + integrity sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ== + +"@esbuild/linux-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz#70ac6fa14f5cb7e1f7f887bcffb680ad09922b5b" + integrity sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q== + +"@esbuild/linux-arm@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz#fc6fd11a8aca56c1f6f3894f2bea0479f8f626b9" + integrity sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA== + +"@esbuild/linux-ia32@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz#3271f53b3f93e3d093d518d1649d6d68d346ede2" + integrity sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg== + +"@esbuild/linux-loong64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz#ed62e04238c57026aea831c5a130b73c0f9f26df" + integrity sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg== + +"@esbuild/linux-mips64el@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz#e79b8eb48bf3b106fadec1ac8240fb97b4e64cbe" + integrity sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg== + +"@esbuild/linux-ppc64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz#5f2203860a143b9919d383ef7573521fb154c3e4" + integrity sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w== + +"@esbuild/linux-riscv64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz#07bcafd99322d5af62f618cb9e6a9b7f4bb825dc" + integrity sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA== + +"@esbuild/linux-s390x@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz#b7ccf686751d6a3e44b8627ababc8be3ef62d8de" + integrity sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A== + +"@esbuild/linux-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz#6d8f0c768e070e64309af8004bb94e68ab2bb3b0" + integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ== + +"@esbuild/netbsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz#bbe430f60d378ecb88decb219c602667387a6047" + integrity sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg== + +"@esbuild/openbsd-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz#99d1cf2937279560d2104821f5ccce220cb2af70" + integrity sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow== + +"@esbuild/sunos-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz#08741512c10d529566baba837b4fe052c8f3487b" + integrity sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg== + +"@esbuild/win32-arm64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz#675b7385398411240735016144ab2e99a60fc75d" + integrity sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A== + +"@esbuild/win32-ia32@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz#1bfc3ce98aa6ca9a0969e4d2af72144c59c1193b" + integrity sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA== + +"@esbuild/win32-x64@0.21.5": + version "0.21.5" + resolved "https://registry.yarnpkg.com/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz#acad351d582d157bb145535db2a6ff53dd514b5c" + integrity sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw== + aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" @@ -20,6 +135,35 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== +esbuild@~0.21.5: + version "0.21.5" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.21.5.tgz#9ca301b120922959b766360d8ac830da0d02997d" + integrity sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw== + optionalDependencies: + "@esbuild/aix-ppc64" "0.21.5" + "@esbuild/android-arm" "0.21.5" + "@esbuild/android-arm64" "0.21.5" + "@esbuild/android-x64" "0.21.5" + "@esbuild/darwin-arm64" "0.21.5" + "@esbuild/darwin-x64" "0.21.5" + "@esbuild/freebsd-arm64" "0.21.5" + "@esbuild/freebsd-x64" "0.21.5" + "@esbuild/linux-arm" "0.21.5" + "@esbuild/linux-arm64" "0.21.5" + "@esbuild/linux-ia32" "0.21.5" + "@esbuild/linux-loong64" "0.21.5" + "@esbuild/linux-mips64el" "0.21.5" + "@esbuild/linux-ppc64" "0.21.5" + "@esbuild/linux-riscv64" "0.21.5" + "@esbuild/linux-s390x" "0.21.5" + "@esbuild/linux-x64" "0.21.5" + "@esbuild/netbsd-x64" "0.21.5" + "@esbuild/openbsd-x64" "0.21.5" + "@esbuild/sunos-x64" "0.21.5" + "@esbuild/win32-arm64" "0.21.5" + "@esbuild/win32-ia32" "0.21.5" + "@esbuild/win32-x64" "0.21.5" + fs-extra@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" @@ -30,6 +174,18 @@ fs-extra@^9.0.1: jsonfile "^6.0.1" universalify "^1.0.0" +fsevents@~2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +get-tsconfig@^4.7.5: + version "4.7.5" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.7.5.tgz#5e012498579e9a6947511ed0cd403272c7acbbaf" + integrity sha512-ZCuZCnlqNzjb4QprAzXKdpp/gh6KTxSJuw3IBsPnV/7fV4NxC9ckB+vPTt8w7fJA0TaSD7c55BR47JD6MEDyDw== + dependencies: + resolve-pkg-maps "^1.0.0" + graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.4" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" @@ -61,6 +217,21 @@ promisify-child-process@^4.1.1: resolved "https://registry.yarnpkg.com/promisify-child-process/-/promisify-child-process-4.1.1.tgz#290659e079f9c7bd46708404d4488a1a6b802686" integrity sha512-/sRjHZwoXf1rJ+8s4oWjYjGRVKNK1DUnqfRC1Zek18pl0cN6k3yJ1cCbqd0tWNe4h0Gr+SY4vR42N33+T82WkA== +resolve-pkg-maps@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz#616b3dc2c57056b5588c31cdf4b3d64db133720f" + integrity sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw== + +tsx@^4.16.2: + version "4.16.2" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-4.16.2.tgz#8722be119ae226ef0b4c6210d5ee90f3ba823f19" + integrity sha512-C1uWweJDgdtX2x600HjaFaucXTilT7tgUZHbOE4+ypskZ1OP8CRCSDkCxG6Vya9EwaFIVagWwpaVAn5wzypaqQ== + dependencies: + esbuild "~0.21.5" + get-tsconfig "^4.7.5" + optionalDependencies: + fsevents "~2.3.3" + universalify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d"