Skip to content

Commit

Permalink
RNGP - Remove unused applyAppPlugin
Browse files Browse the repository at this point in the history
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm removing the `applyAppPlugin` property which was never used. The new logic will apply the App Plugin if the `com.android.application` plugin is found.

I've also removed the corresponding tests. New one will follow afterwards

Changelog:
[Internal] [Changed] - RNGP - Remove unused applyAppPlugin

Reviewed By: cipolleschi

Differential Revision: D40547689

fbshipit-source-id: ce1089498a586a43cb5e07950767c2c4b51b4597
  • Loading branch information
cortinico authored and facebook-github-bot committed Oct 20, 2022
1 parent affcfa7 commit 8e8e18b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ abstract class ReactExtension @Inject constructor(project: Project) {

private val objects = project.objects

/**
* Whether the React App plugin should apply its logic or not. Set it to false if you're still
* relying on `react.gradle` to configure your build. Default: false
*/
val applyAppPlugin: Property<Boolean> = objects.property(Boolean::class.java).convention(false)

/**
* The path to the root of your project. This is the path to where the `package.json` lives. All
* the CLI commands will be invoked from this folder as working directory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,26 @@ class ReactPlugin : Plugin<Project> {
if ((jvmVersion?.toIntOrNull() ?: 0) <= 8) {
project.logger.error(
"""
********************************************************************************
ERROR: requires JDK11 or higher.
Incompatible major version detected: '$jvmVersion'
********************************************************************************
"""
.trimIndent())
exitProcess(1)
}
}

private fun applyAppPlugin(project: Project, config: ReactExtension) {
configureReactNativeNdk(project, config)
configureBuildConfigFields(project)
configureDevPorts(project)
project.afterEvaluate {
if (config.applyAppPlugin.getOrElse(false)) {
project.pluginManager.withPlugin("com.android.application") {
configureReactNativeNdk(project, config)
configureBuildConfigFields(project)
configureDevPorts(project)
project.afterEvaluate {
val isAndroidLibrary = project.plugins.hasPlugin("com.android.library")
val variants =
if (isAndroidLibrary) {
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/rn-tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ plugins {
*/

react {
applyAppPlugin = true
cliPath = "../../../../cli.js"
bundleAssetName = "RNTesterApp.android.bundle"
entryFile = file("../../js/RNTesterApp.android.js")
Expand Down

0 comments on commit 8e8e18b

Please sign in to comment.