Skip to content

Commit 1245568

Browse files
committed
Reapply "Codemod format for trailing commas change"
This reverts commit 40d64a2.
1 parent 85ff448 commit 1245568

File tree

232 files changed

+2421
-1662
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+2421
-1662
lines changed

build.gradle.kts

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,22 @@ fun getListReactAndroidProperty(name: String) = reactAndroidProperties.getProper
2626

2727
apiValidation {
2828
ignoredPackages.addAll(
29-
getListReactAndroidProperty("binaryCompatibilityValidator.ignoredPackages"))
29+
getListReactAndroidProperty("binaryCompatibilityValidator.ignoredPackages")
30+
)
3031
ignoredClasses.addAll(getListReactAndroidProperty("binaryCompatibilityValidator.ignoredClasses"))
3132
nonPublicMarkers.addAll(
32-
getListReactAndroidProperty("binaryCompatibilityValidator.nonPublicMarkers"))
33+
getListReactAndroidProperty("binaryCompatibilityValidator.nonPublicMarkers")
34+
)
3335
validationDisabled =
3436
reactAndroidProperties
3537
.getProperty("binaryCompatibilityValidator.validationDisabled")
3638
?.toBoolean() == true
3739
}
3840

3941
version =
40-
if (project.hasProperty("isSnapshot") &&
41-
(project.property("isSnapshot") as? String).toBoolean()) {
42+
if (
43+
project.hasProperty("isSnapshot") && (project.property("isSnapshot") as? String).toBoolean()
44+
) {
4245
"${reactAndroidProperties.getProperty("VERSION_NAME")}-SNAPSHOT"
4346
} else {
4447
reactAndroidProperties.getProperty("VERSION_NAME")
@@ -66,8 +69,10 @@ tasks.register("clean", Delete::class.java) {
6669
description = "Remove all the build files and intermediate build outputs"
6770
dependsOn(gradle.includedBuild("gradle-plugin").task(":clean"))
6871
subprojects.forEach {
69-
if (it.project.plugins.hasPlugin("com.android.library") ||
70-
it.project.plugins.hasPlugin("com.android.application")) {
72+
if (
73+
it.project.plugins.hasPlugin("com.android.library") ||
74+
it.project.plugins.hasPlugin("com.android.application")
75+
) {
7176
dependsOn(it.tasks.named("clean"))
7277
}
7378
}
@@ -77,10 +82,13 @@ tasks.register("clean", Delete::class.java) {
7782
delete(rootProject.file("./packages/react-native/sdks/download/"))
7883
delete(rootProject.file("./packages/react-native/sdks/hermes/"))
7984
delete(
80-
rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/arm64-v8a/"))
85+
rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/arm64-v8a/")
86+
)
8187
delete(
8288
rootProject.file(
83-
"./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/"))
89+
"./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/armeabi-v7a/"
90+
)
91+
)
8492
delete(rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/x86/"))
8593
delete(rootProject.file("./packages/react-native/ReactAndroid/src/main/jni/prebuilt/lib/x86_64/"))
8694
delete(rootProject.file("./packages/react-native-codegen/lib"))
@@ -98,7 +106,8 @@ tasks.register("publishAllToMavenTempLocal") {
98106
dependsOn(":packages:react-native:ReactAndroid:publishAllPublicationsToMavenTempLocalRepository")
99107
// We don't publish the external-artifacts to Maven Local as ci is using it via workspace.
100108
dependsOn(
101-
":packages:react-native:ReactAndroid:hermes-engine:publishAllPublicationsToMavenTempLocalRepository")
109+
":packages:react-native:ReactAndroid:hermes-engine:publishAllPublicationsToMavenTempLocalRepository"
110+
)
102111
}
103112

104113
tasks.register("publishAndroidToSonatype") {
@@ -120,7 +129,8 @@ if (project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoole
120129
That's fine for local development, but you should not commit this change.
121130
********************************************************************************
122131
"""
123-
.trimIndent())
132+
.trimIndent()
133+
)
124134
allprojects {
125135
configurations.all {
126136
resolutionStrategy.dependencySubstitution {
@@ -152,10 +162,12 @@ allprojects {
152162
"**/build/**",
153163
"**/hermes-engine/**",
154164
"**/internal/featureflags/**",
155-
"**/systeminfo/ReactNativeVersion.kt")
165+
"**/systeminfo/ReactNativeVersion.kt",
166+
)
156167
listOf(
157168
com.ncorti.ktfmt.gradle.tasks.KtfmtCheckTask::class,
158-
com.ncorti.ktfmt.gradle.tasks.KtfmtFormatTask::class)
169+
com.ncorti.ktfmt.gradle.tasks.KtfmtFormatTask::class,
170+
)
159171
.forEach { tasks.withType(it) { exclude(excludePatterns) } }
160172

161173
// Disable the problematic ktfmt script tasks due to symbolic link issues in subprojects

packages/gradle-plugin/react-native-gradle-plugin/build.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ tasks.withType<KotlinCompile>().configureEach {
6868
// See comment above on JDK 11 support
6969
jvmTarget.set(JvmTarget.JVM_11)
7070
allWarningsAsErrors.set(
71-
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false)
71+
project.properties["enableWarningsAsErrors"]?.toString()?.toBoolean() ?: false
72+
)
7273
}
7374
}
7475

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,8 @@ abstract class ReactExtension @Inject constructor(val project: Project) {
208208
} else {
209209
buildTypes.forEach { buildType ->
210210
result.add(
211-
(dependencyConfiguration ?: "${buildType}Implementation") to ":$nameCleansed")
211+
(dependencyConfiguration ?: "${buildType}Implementation") to ":$nameCleansed"
212+
)
212213
}
213214
}
214215
}

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ class ReactPlugin : Plugin<Project> {
112112
********************************************************************************
113113
114114
"""
115-
.trimIndent())
115+
.trimIndent()
116+
)
116117
exitProcess(1)
117118
}
118119
}
@@ -186,7 +187,8 @@ class ReactPlugin : Plugin<Project> {
186187
// We want to exclude the build directory, to don't pick them up for execution
187188
// avoidance.
188189
tree.exclude("**/build/**/*")
189-
})
190+
}
191+
)
190192

191193
val needsCodegenFromPackageJson = project.needsCodegenFromPackageJson(rootExtension.root)
192194
it.onlyIf { (isLibrary || needsCodegenFromPackageJson) && !includesGeneratedCode }
@@ -303,7 +305,8 @@ class ReactPlugin : Plugin<Project> {
303305
project.extensions.getByType(ApplicationAndroidComponentsExtension::class.java).apply {
304306
onVariants(selector().all()) { variant ->
305307
variant.sources.java?.addStaticSourceDirectory(
306-
generatedAutolinkingJavaDir.get().asFile.absolutePath)
308+
generatedAutolinkingJavaDir.get().asFile.absolutePath
309+
)
307310
}
308311
}
309312
}

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactRootProjectPlugin.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,12 @@ class ReactRootProjectPlugin : Plugin<Project> {
5959
}
6060

6161
private fun checkLegacyArchProperty(project: Project) {
62-
if ((project.hasProperty(PropertyUtils.NEW_ARCH_ENABLED) &&
63-
!project.property(PropertyUtils.NEW_ARCH_ENABLED).toString().toBoolean()) ||
64-
(project.hasProperty(PropertyUtils.SCOPED_NEW_ARCH_ENABLED) &&
65-
!project.property(PropertyUtils.SCOPED_NEW_ARCH_ENABLED).toString().toBoolean())) {
62+
if (
63+
(project.hasProperty(PropertyUtils.NEW_ARCH_ENABLED) &&
64+
!project.property(PropertyUtils.NEW_ARCH_ENABLED).toString().toBoolean()) ||
65+
(project.hasProperty(PropertyUtils.SCOPED_NEW_ARCH_ENABLED) &&
66+
!project.property(PropertyUtils.SCOPED_NEW_ARCH_ENABLED).toString().toBoolean())
67+
) {
6668
project.logger.error(
6769
"""
6870
********************************************************************************
@@ -77,7 +79,8 @@ class ReactRootProjectPlugin : Plugin<Project> {
7779
********************************************************************************
7880
7981
"""
80-
.trimIndent())
82+
.trimIndent()
83+
)
8184
}
8285
}
8386
}

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ internal fun Project.configureReactTasks(variant: Variant, config: ReactExtensio
5454

5555
configureNewArchPackagingOptions(project, config, variant)
5656
configureJsEnginePackagingOptions(config, variant, isHermesEnabledInThisVariant, useThirdPartyJSC)
57-
if (!isHermesEnabledInThisVariant &&
58-
!useThirdPartyJSC &&
59-
rootProject.name != "react-native-github") {
57+
if (
58+
!isHermesEnabledInThisVariant &&
59+
!useThirdPartyJSC &&
60+
rootProject.name != "react-native-github"
61+
) {
6062
showJSCRemovalMessage(project)
6163
}
6264

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/internal/PrivateReactExtension.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@ abstract class PrivateReactExtension @Inject constructor(project: Project) {
3939
// - We're inside a user project, so inside the ./android folder. Default should be
4040
// ../
4141
// User can always override this default by setting a `root =` inside the template.
42-
if (project.rootProject.name == "react-native-github" ||
43-
project.rootProject.name == "react-native-build-from-source") {
42+
if (
43+
project.rootProject.name == "react-native-github" ||
44+
project.rootProject.name == "react-native-build-from-source"
45+
) {
4446
project.rootProject.layout.projectDirectory.dir("../../")
4547
} else {
4648
project.rootProject.layout.projectDirectory.dir("../")
47-
})
49+
}
50+
)
4851

4952
val reactNativeDir: DirectoryProperty =
5053
objects.directoryProperty().convention(root.dir("node_modules/react-native"))

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateAutolinkingNewArchitecturesFileTask.kt

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -165,88 +165,88 @@ abstract class GenerateAutolinkingNewArchitecturesFileTask : DefaultTask() {
165165
// language=cmake
166166
val CMAKE_TEMPLATE =
167167
"""
168-
# This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin)
169-
cmake_minimum_required(VERSION 3.13)
170-
set(CMAKE_VERBOSE_MAKEFILE on)
171-
172-
# We set REACTNATIVE_MERGED_SO so libraries/apps can selectively decide to depend on either libreactnative.so
173-
# or link against a old prefab target (this is needed for React Native 0.76 on).
174-
set(REACTNATIVE_MERGED_SO true)
175-
176-
{{ libraryIncludes }}
177-
178-
set(AUTOLINKED_LIBRARIES
179-
{{ libraryModules }}
180-
)
181-
"""
168+
# This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin)
169+
cmake_minimum_required(VERSION 3.13)
170+
set(CMAKE_VERBOSE_MAKEFILE on)
171+
172+
# We set REACTNATIVE_MERGED_SO so libraries/apps can selectively decide to depend on either libreactnative.so
173+
# or link against a old prefab target (this is needed for React Native 0.76 on).
174+
set(REACTNATIVE_MERGED_SO true)
175+
176+
{{ libraryIncludes }}
177+
178+
set(AUTOLINKED_LIBRARIES
179+
{{ libraryModules }}
180+
)
181+
"""
182182
.trimIndent()
183183

184184
// language=cpp
185185
val CPP_TEMPLATE =
186186
"""
187-
/**
188-
* This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin).
189-
*
190-
* Do not edit this file as changes may cause incorrect behavior and will be lost
191-
* once the code is regenerated.
192-
*
193-
*/
194-
195-
#include "autolinking.h"
196-
{{ autolinkingCppIncludes }}
197-
198-
namespace facebook {
199-
namespace react {
200-
201-
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params) {
202-
{{ autolinkingCppTurboModuleJavaProviders }}
203-
return nullptr;
204-
}
205-
206-
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
207-
{{ autolinkingCppTurboModuleCxxProviders }}
208-
return nullptr;
209-
}
210-
211-
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
212-
{{ autolinkingCppComponentDescriptors }}
213-
return;
214-
}
215-
216-
} // namespace react
217-
} // namespace facebook
218-
"""
187+
/**
188+
* This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin).
189+
*
190+
* Do not edit this file as changes may cause incorrect behavior and will be lost
191+
* once the code is regenerated.
192+
*
193+
*/
194+
195+
#include "autolinking.h"
196+
{{ autolinkingCppIncludes }}
197+
198+
namespace facebook {
199+
namespace react {
200+
201+
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params) {
202+
{{ autolinkingCppTurboModuleJavaProviders }}
203+
return nullptr;
204+
}
205+
206+
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker) {
207+
{{ autolinkingCppTurboModuleCxxProviders }}
208+
return nullptr;
209+
}
210+
211+
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry) {
212+
{{ autolinkingCppComponentDescriptors }}
213+
return;
214+
}
215+
216+
} // namespace react
217+
} // namespace facebook
218+
"""
219219
.trimIndent()
220220

221221
// language=cpp
222222
val hTemplate =
223223
"""
224-
/**
225-
* This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin).
226-
*
227-
* Do not edit this file as changes may cause incorrect behavior and will be lost
228-
* once the code is regenerated.
229-
*
230-
*/
231-
232-
#pragma once
233-
234-
#include <ReactCommon/CallInvoker.h>
235-
#include <ReactCommon/JavaTurboModule.h>
236-
#include <ReactCommon/TurboModule.h>
237-
#include <jsi/jsi.h>
238-
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
239-
240-
namespace facebook {
241-
namespace react {
242-
243-
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params);
244-
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker);
245-
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry);
246-
247-
} // namespace react
248-
} // namespace facebook
249-
"""
224+
/**
225+
* This code was generated by [React Native](https://www.npmjs.com/package/@react-native/gradle-plugin).
226+
*
227+
* Do not edit this file as changes may cause incorrect behavior and will be lost
228+
* once the code is regenerated.
229+
*
230+
*/
231+
232+
#pragma once
233+
234+
#include <ReactCommon/CallInvoker.h>
235+
#include <ReactCommon/JavaTurboModule.h>
236+
#include <ReactCommon/TurboModule.h>
237+
#include <jsi/jsi.h>
238+
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
239+
240+
namespace facebook {
241+
namespace react {
242+
243+
std::shared_ptr<TurboModule> autolinking_ModuleProvider(const std::string moduleName, const JavaTurboModule::InitParams &params);
244+
std::shared_ptr<TurboModule> autolinking_cxxModuleProvider(const std::string moduleName, const std::shared_ptr<CallInvoker>& jsInvoker);
245+
void autolinking_registerProviders(std::shared_ptr<ComponentDescriptorProviderRegistry const> providerRegistry);
246+
247+
} // namespace react
248+
} // namespace facebook
249+
"""
250250
.trimIndent()
251251
}
252252
}

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateCodegenArtifactsTask.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ abstract class GenerateCodegenArtifactsTask : Exec() {
8282
libraryName,
8383
"--javaPackageName",
8484
codegenJavaPackageName,
85-
))
85+
)
86+
)
8687
}
8788
}

packages/gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/GenerateCodegenSchemaTask.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ abstract class GenerateCodegenSchemaTask : Exec() {
6969
"NativeSampleTurboModule",
7070
generatedSchemaFile.get().asFile.cliPath(workingDir),
7171
jsRootDir.asFile.get().cliPath(workingDir),
72-
))
72+
)
73+
)
7374
}
7475
}

0 commit comments

Comments
 (0)