@react-native/gradle-plugin 0.73.1 → 0.73.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.gradle.kts
CHANGED
package/package.json
CHANGED
|
@@ -12,7 +12,8 @@ import com.android.build.gradle.internal.tasks.factory.dependsOn
|
|
|
12
12
|
import com.facebook.react.internal.PrivateReactExtension
|
|
13
13
|
import com.facebook.react.tasks.GenerateCodegenArtifactsTask
|
|
14
14
|
import com.facebook.react.tasks.GenerateCodegenSchemaTask
|
|
15
|
-
import com.facebook.react.utils.AgpConfiguratorUtils.
|
|
15
|
+
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForApp
|
|
16
|
+
import com.facebook.react.utils.AgpConfiguratorUtils.configureBuildConfigFieldsForLibraries
|
|
16
17
|
import com.facebook.react.utils.AgpConfiguratorUtils.configureDevPorts
|
|
17
18
|
import com.facebook.react.utils.BackwardCompatUtils.configureBackwardCompatibilityReactMap
|
|
18
19
|
import com.facebook.react.utils.DependencyUtils.configureDependencies
|
|
@@ -64,9 +65,10 @@ class ReactPlugin : Plugin<Project> {
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
configureReactNativeNdk(project, extension)
|
|
67
|
-
|
|
68
|
+
configureBuildConfigFieldsForApp(project, extension)
|
|
68
69
|
configureDevPorts(project)
|
|
69
70
|
configureBackwardCompatibilityReactMap(project)
|
|
71
|
+
configureJavaToolChains(project)
|
|
70
72
|
|
|
71
73
|
project.extensions.getByType(AndroidComponentsExtension::class.java).apply {
|
|
72
74
|
onVariants(selector().all()) { variant ->
|
|
@@ -77,12 +79,10 @@ class ReactPlugin : Plugin<Project> {
|
|
|
77
79
|
}
|
|
78
80
|
|
|
79
81
|
// Library Only Configuration
|
|
82
|
+
configureBuildConfigFieldsForLibraries(project)
|
|
80
83
|
project.pluginManager.withPlugin("com.android.library") {
|
|
81
84
|
configureCodegen(project, extension, rootExtension, isLibrary = true)
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
// Library and App Configurations
|
|
85
|
-
configureJavaToolChains(project)
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
private fun checkJvmVersion(project: Project) {
|
|
@@ -23,6 +23,7 @@ internal fun Project.configureReactTasks(variant: Variant, config: ReactExtensio
|
|
|
23
23
|
val targetName = variant.name.capitalizeCompat()
|
|
24
24
|
val targetPath = variant.name
|
|
25
25
|
|
|
26
|
+
val buildDir = this.layout.buildDirectory.get().asFile
|
|
26
27
|
// Resources: generated/assets/react/<variant>/index.android.bundle
|
|
27
28
|
val resourcesDir = File(buildDir, "generated/res/react/$targetPath")
|
|
28
29
|
// Bundle: generated/assets/react/<variant>/index.android.bundle
|
|
@@ -18,7 +18,7 @@ import org.gradle.api.plugins.AppliedPlugin
|
|
|
18
18
|
@Suppress("UnstableApiUsage")
|
|
19
19
|
internal object AgpConfiguratorUtils {
|
|
20
20
|
|
|
21
|
-
fun
|
|
21
|
+
fun configureBuildConfigFieldsForApp(project: Project, extension: ReactExtension) {
|
|
22
22
|
val action =
|
|
23
23
|
Action<AppliedPlugin> {
|
|
24
24
|
project.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext ->
|
|
@@ -35,6 +35,16 @@ internal object AgpConfiguratorUtils {
|
|
|
35
35
|
project.pluginManager.withPlugin("com.android.library", action)
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
fun configureBuildConfigFieldsForLibraries(appProject: Project) {
|
|
39
|
+
appProject.rootProject.allprojects { subproject ->
|
|
40
|
+
subproject.pluginManager.withPlugin("com.android.library") {
|
|
41
|
+
subproject.extensions.getByType(AndroidComponentsExtension::class.java).finalizeDsl { ext ->
|
|
42
|
+
ext.buildFeatures.buildConfig = true
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
fun configureDevPorts(project: Project) {
|
|
39
49
|
val devServerPort =
|
|
40
50
|
project.properties["reactNativeDevServerPort"]?.toString() ?: DEFAULT_DEV_SERVER_PORT
|