Skip to content

Commit 9b0adb5

Browse files
sonicdoefacebook-github-bot
authored andcommitted
Fix indentation in Gradle files (#26012)
Summary: Fixes indentation in `*.gradle` files by using four-space indents [as specified in `.editorconfig`](https://github.com/facebook/react-native/blob/0ccedf3964b1ebff43e4631d1e60b3e733096e56/.editorconfig#L13-L14). ## Changelog [Internal] [Fixed] - Fix indentation in Gradle files Pull Request resolved: #26012 Test Plan: Considering [the diff consists of whitespace changes only](https://github.com/facebook/react-native/compare/master...sonicdoe:gradle-indentation?w=1), I think this is safe to merge if the test suite passes. Differential Revision: D16761514 Pulled By: cpojer fbshipit-source-id: 9b035b5c6b35a70b2b54fe35416840fb90a0c6b1
1 parent e2d55d5 commit 9b0adb5

File tree

5 files changed

+35
-35
lines changed

5 files changed

+35
-35
lines changed

RNTester/android/app/build.gradle

+6-6
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ android {
110110

111111
flavorDimensions "vm"
112112
productFlavors {
113-
hermes {
114-
dimension "vm"
115-
}
116-
jsc {
117-
dimension "vm"
118-
}
113+
hermes {
114+
dimension "vm"
115+
}
116+
jsc {
117+
dimension "vm"
118+
}
119119
}
120120

121121
defaultConfig {

ReactAndroid/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ task prepareHermes() {
9999
hermesAAR = file("$projectDir/../../hermes-engine/android/hermes-debug.aar")
100100

101101
if (!hermesAAR.exists()) {
102-
// At Facebook, this file is in a different folder
103-
hermesAAR = file("$projectDir/../../node_modules/hermes-engine/android/hermes-debug.aar")
102+
// At Facebook, this file is in a different folder
103+
hermesAAR = file("$projectDir/../../node_modules/hermes-engine/android/hermes-debug.aar")
104104
}
105105
}
106106
def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" })

ReactAndroid/release.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ def configureReactNativePom(def pom) {
6262
}
6363

6464
if (JavaVersion.current().isJava8Compatible()) {
65-
allprojects {
66-
tasks.withType(Javadoc) {
67-
options.addStringOption("Xdoclint:none", "-quiet")
65+
allprojects {
66+
tasks.withType(Javadoc) {
67+
options.addStringOption("Xdoclint:none", "-quiet")
68+
}
6869
}
69-
}
7070
}
7171

7272
afterEvaluate { project ->

react.gradle

+19-19
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,31 @@ def reactNativeInspectorProxyPort() {
2929
}
3030

3131
def getHermesOSBin() {
32-
if (Os.isFamily(Os.FAMILY_WINDOWS)) return "win64-bin";
33-
if (Os.isFamily(Os.FAMILY_MAC)) return "osx-bin";
34-
if (Os.isOs(null, "linux", "amd64", null)) return "linux64-bin";
35-
throw new Exception("OS not recognized. Please set project.ext.react.hermesCommand " +
36-
"to the path of a working Hermes compiler.");
32+
if (Os.isFamily(Os.FAMILY_WINDOWS)) return "win64-bin";
33+
if (Os.isFamily(Os.FAMILY_MAC)) return "osx-bin";
34+
if (Os.isOs(null, "linux", "amd64", null)) return "linux64-bin";
35+
throw new Exception("OS not recognized. Please set project.ext.react.hermesCommand " +
36+
"to the path of a working Hermes compiler.");
3737
}
3838

3939
// Make sure not to inspect the Hermes config unless we need it,
4040
// to avoid breaking any JSC-only setups.
4141
def getHermesCommand = {
42-
// If the project specifies a Hermes command, don't second guess it.
43-
if (!hermesCommand.contains("%OS-BIN%")) {
44-
return hermesCommand
45-
}
42+
// If the project specifies a Hermes command, don't second guess it.
43+
if (!hermesCommand.contains("%OS-BIN%")) {
44+
return hermesCommand
45+
}
4646

47-
// Execution on Windows fails with / as separator
48-
return hermesCommand
49-
.replaceAll("%OS-BIN%", getHermesOSBin())
50-
.replace('/' as char, File.separatorChar);
47+
// Execution on Windows fails with / as separator
48+
return hermesCommand
49+
.replaceAll("%OS-BIN%", getHermesOSBin())
50+
.replace('/' as char, File.separatorChar);
5151
}
5252

5353
// Set enableHermesForVariant to a function to configure per variant,
5454
// or set `enableHermes` to True/False to set all of them
5555
def enableHermesForVariant = config.enableHermesForVariant ?: {
56-
def variant -> config.enableHermes ?: false
56+
def variant -> config.enableHermes ?: false
5757
}
5858

5959
android {
@@ -177,10 +177,10 @@ afterEvaluate {
177177
}
178178

179179
enabled config."bundleIn${targetName}" != null
180-
? config."bundleIn${targetName}"
181-
: config."bundleIn${variant.buildType.name.capitalize()}" != null
182-
? config."bundleIn${variant.buildType.name.capitalize()}"
183-
: targetName.toLowerCase().contains("release")
180+
? config."bundleIn${targetName}"
181+
: config."bundleIn${variant.buildType.name.capitalize()}" != null
182+
? config."bundleIn${variant.buildType.name.capitalize()}"
183+
: targetName.toLowerCase().contains("release")
184184
}
185185

186186
// Expose a minimal interface on the application variant and the task itself:
@@ -297,7 +297,7 @@ afterEvaluate {
297297
def targetVariant = ".*/transforms/[^/]*/${targetPath}/.*"
298298
def path = details.file.getAbsolutePath().replace(File.separatorChar, '/' as char)
299299
if (path.matches(targetVariant) && details.file.isFile()) {
300-
details.file.delete()
300+
details.file.delete()
301301
}
302302
}
303303
}

template/android/app/build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ dependencies {
192192
implementation "com.facebook.react:react-native:+" // From node_modules
193193

194194
if (enableHermes) {
195-
def hermesPath = "../../node_modules/hermes-engine/android/";
196-
debugImplementation files(hermesPath + "hermes-debug.aar")
197-
releaseImplementation files(hermesPath + "hermes-release.aar")
195+
def hermesPath = "../../node_modules/hermes-engine/android/";
196+
debugImplementation files(hermesPath + "hermes-debug.aar")
197+
releaseImplementation files(hermesPath + "hermes-release.aar")
198198
} else {
199-
implementation jscFlavor
199+
implementation jscFlavor
200200
}
201201
}
202202

0 commit comments

Comments
 (0)