Skip to content

Commit

Permalink
Fix indentation in Gradle files (#26012)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sonicdoe authored and facebook-github-bot committed Aug 12, 2019
1 parent e2d55d5 commit 9b0adb5
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 35 deletions.
12 changes: 6 additions & 6 deletions RNTester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ android {

flavorDimensions "vm"
productFlavors {
hermes {
dimension "vm"
}
jsc {
dimension "vm"
}
hermes {
dimension "vm"
}
jsc {
dimension "vm"
}
}

defaultConfig {
Expand Down
4 changes: 2 additions & 2 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ task prepareHermes() {
hermesAAR = file("$projectDir/../../hermes-engine/android/hermes-debug.aar")

if (!hermesAAR.exists()) {
// At Facebook, this file is in a different folder
hermesAAR = file("$projectDir/../../node_modules/hermes-engine/android/hermes-debug.aar")
// At Facebook, this file is in a different folder
hermesAAR = file("$projectDir/../../node_modules/hermes-engine/android/hermes-debug.aar")
}
}
def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" })
Expand Down
8 changes: 4 additions & 4 deletions ReactAndroid/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def configureReactNativePom(def pom) {
}

if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption("Xdoclint:none", "-quiet")
allprojects {
tasks.withType(Javadoc) {
options.addStringOption("Xdoclint:none", "-quiet")
}
}
}
}

afterEvaluate { project ->
Expand Down
38 changes: 19 additions & 19 deletions react.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ def reactNativeInspectorProxyPort() {
}

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

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

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

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

android {
Expand Down Expand Up @@ -177,10 +177,10 @@ afterEvaluate {
}

enabled config."bundleIn${targetName}" != null
? config."bundleIn${targetName}"
: config."bundleIn${variant.buildType.name.capitalize()}" != null
? config."bundleIn${variant.buildType.name.capitalize()}"
: targetName.toLowerCase().contains("release")
? config."bundleIn${targetName}"
: config."bundleIn${variant.buildType.name.capitalize()}" != null
? config."bundleIn${variant.buildType.name.capitalize()}"
: targetName.toLowerCase().contains("release")
}

// Expose a minimal interface on the application variant and the task itself:
Expand Down Expand Up @@ -297,7 +297,7 @@ afterEvaluate {
def targetVariant = ".*/transforms/[^/]*/${targetPath}/.*"
def path = details.file.getAbsolutePath().replace(File.separatorChar, '/' as char)
if (path.matches(targetVariant) && details.file.isFile()) {
details.file.delete()
details.file.delete()
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ dependencies {
implementation "com.facebook.react:react-native:+" // From node_modules

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
implementation jscFlavor
}
}

Expand Down

0 comments on commit 9b0adb5

Please sign in to comment.