mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
RNGP - Add autolinking fields to ReactExtensions (#44220)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44220 This diff is part of RFC0759 https://github.com/react-native-community/discussions-and-proposals/pull/759 Here we're looking into splitting the autolinking into a component that will live inside core (specifically inside the React Native Gradle Plugin - RNGP) and another component that will live inside the Community CLI. Here I start by adding 2 fields to RNGP extension, that frameworks and templates can use to provide their autolinking config. Changelog: [Internal] [Changed] - RNGP - Add autolinking fields to ReactExtensions Reviewed By: cipolleschi Differential Revision: D55475597 fbshipit-source-id: 316d1919a113a94c57426710f487f334c6128345
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b53c4395ce
commit
2455eab9df
+32
@@ -11,6 +11,7 @@ import com.facebook.react.utils.projectPathToLibraryName
|
||||
import javax.inject.Inject
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.file.DirectoryProperty
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.gradle.api.file.RegularFileProperty
|
||||
import org.gradle.api.provider.ListProperty
|
||||
import org.gradle.api.provider.Property
|
||||
@@ -147,4 +148,35 @@ abstract class ReactExtension @Inject constructor(project: Project) {
|
||||
*/
|
||||
val codegenJavaPackageName: Property<String> =
|
||||
objects.property(String::class.java).convention("com.facebook.fbreact.specs")
|
||||
|
||||
/** Auto-linking Config */
|
||||
|
||||
/**
|
||||
* Location of the JSON file used to configure autolinking. This file is the output of the
|
||||
* `@react-native-community/cli` config command.
|
||||
*
|
||||
* If not specified, RNGP will just invoke whatever you pass as [autolinkConfigCommand].
|
||||
*/
|
||||
val autolinkConfigFile: RegularFileProperty = objects.fileProperty()
|
||||
|
||||
/**
|
||||
* The command to invoke as source of truth for the autolinking configuration. Default is `["npx",
|
||||
* "@react-native-community/cli", "config"]`.
|
||||
*/
|
||||
val autolinkConfigCommand: ListProperty<String> =
|
||||
objects
|
||||
.listProperty(String::class.java)
|
||||
.convention(listOf("npx", "@react-native-community/cli", "config"))
|
||||
|
||||
/**
|
||||
* Location of the lock files used to consider wether autolinking [autolinkConfigCommand] should
|
||||
* re-execute or not. If file collection is unchanged, the autolinking command will not be
|
||||
* re-executed.
|
||||
*
|
||||
* If not specified, RNGP will just look for both yarn.lock and package.lock in the [root] folder.
|
||||
*/
|
||||
val autolinkLockFiles: Property<FileCollection> =
|
||||
objects
|
||||
.property(FileCollection::class.java)
|
||||
.convention(root.files("../yarn.lock", "../package-lock.json"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user