From b7c4736eb6e69afd0dff03ad166a8c8a02223de2 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 9 Aug 2023 10:08:27 -0700 Subject: [PATCH] Convert flipper-integartion Gradle file to Kotlin DSL (#38884) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/38884 Convert flipper-integartion Gradle file to Kotlin DSL Changelog: [Internal] [Changed] - Convert flipper-integartion Gradle file to Kotlin DSL Reviewed By: luluwu2032 Differential Revision: D48187572 fbshipit-source-id: ff463f2ccf5ea3333893b3c6c691808d478a855d --- .../flipper-integration/build.gradle | 61 ------------------ .../flipper-integration/build.gradle.kts | 62 +++++++++++++++++++ 2 files changed, 62 insertions(+), 61 deletions(-) delete mode 100644 packages/react-native/ReactAndroid/flipper-integration/build.gradle create mode 100644 packages/react-native/ReactAndroid/flipper-integration/build.gradle.kts diff --git a/packages/react-native/ReactAndroid/flipper-integration/build.gradle b/packages/react-native/ReactAndroid/flipper-integration/build.gradle deleted file mode 100644 index 1f7001c48e3..00000000000 --- a/packages/react-native/ReactAndroid/flipper-integration/build.gradle +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ - -plugins { - id("com.android.library") - id("maven-publish") - id("signing") - id("org.jetbrains.kotlin.android") -} - -group = "com.facebook.react" -version = parent.publishing_version - -repositories { - // Normally RNGP will set repositories for all modules, - // but when consumed from source, we need to re-declare - // those repositories as there is no app module there. - mavenCentral() - google() -} - -android { - compileSdk 33 - buildToolsVersion = "33.0.1" - namespace "com.facebook.react.flipper" - - defaultConfig { - minSdk = 21 - } - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 - } - - kotlin { - jvmToolchain(11) - } - - dependencies { - implementation project(':packages:react-native:ReactAndroid') - debugImplementation(libs.flipper) - debugImplementation(libs.flipper.network.plugin) { - exclude group:'com.squareup.okhttp3', module:'okhttp' - } - debugImplementation(libs.flipper.fresco.plugin) - } - - publishing { - multipleVariants { - withSourcesJar() - allVariants() - } - } -} - -apply from: "../publish.gradle" diff --git a/packages/react-native/ReactAndroid/flipper-integration/build.gradle.kts b/packages/react-native/ReactAndroid/flipper-integration/build.gradle.kts new file mode 100644 index 00000000000..fdee7d1c944 --- /dev/null +++ b/packages/react-native/ReactAndroid/flipper-integration/build.gradle.kts @@ -0,0 +1,62 @@ +/* + * 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. + */ + +import org.jetbrains.kotlin.gradle.plugin.extraProperties + +plugins { + id("com.android.library") + id("maven-publish") + id("signing") + id("org.jetbrains.kotlin.android") +} + +group = "com.facebook.react" + +version = + parent?.extraProperties?.get("publishing_version") + ?: error("publishing_version not set for flipper-integration") + +repositories { + // Normally RNGP will set repositories for all modules, + // but when consumed from source, we need to re-declare + // those repositories as there is no app module there. + mavenCentral() + google() +} + +android { + compileSdk = 33 + buildToolsVersion = "33.0.1" + namespace = "com.facebook.react.flipper" + + defaultConfig { minSdk = 21 } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + + kotlin { jvmToolchain(11) } + + dependencies { + implementation(project(":packages:react-native:ReactAndroid")) + debugImplementation(libs.flipper) + debugImplementation(libs.flipper.network.plugin) { + exclude(group = "com.squareup.okhttp3", module = "okhttp") + } + debugImplementation(libs.flipper.fresco.plugin) + } + + publishing { + multipleVariants { + withSourcesJar() + allVariants() + } + } +} + +apply(from = "../publish.gradle")