From 9b0adb5ad132b8ff37e707a4943411d92b4e58dc Mon Sep 17 00:00:00 2001 From: Jakob Krigovsky Date: Mon, 12 Aug 2019 02:42:00 -0700 Subject: [PATCH] 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: https://github.com/facebook/react-native/pull/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 --- RNTester/android/app/build.gradle | 12 +++++----- ReactAndroid/build.gradle | 4 ++-- ReactAndroid/release.gradle | 8 +++---- react.gradle | 38 +++++++++++++++---------------- template/android/app/build.gradle | 8 +++---- 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/RNTester/android/app/build.gradle b/RNTester/android/app/build.gradle index 7e96dc1d8063b9..b805922c1fa0f3 100644 --- a/RNTester/android/app/build.gradle +++ b/RNTester/android/app/build.gradle @@ -110,12 +110,12 @@ android { flavorDimensions "vm" productFlavors { - hermes { - dimension "vm" - } - jsc { - dimension "vm" - } + hermes { + dimension "vm" + } + jsc { + dimension "vm" + } } defaultConfig { diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 835d18122e2f29..c59ab9f50beccc 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -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" }) diff --git a/ReactAndroid/release.gradle b/ReactAndroid/release.gradle index d97451c8020e69..fbdb6cc19e3b41 100644 --- a/ReactAndroid/release.gradle +++ b/ReactAndroid/release.gradle @@ -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 -> diff --git a/react.gradle b/react.gradle index 1688508bf91068..14f07461daaed6 100644 --- a/react.gradle +++ b/react.gradle @@ -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 { @@ -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: @@ -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() } } } diff --git a/template/android/app/build.gradle b/template/android/app/build.gradle index 04a6eba473a104..21080c6b38eca3 100644 --- a/template/android/app/build.gradle +++ b/template/android/app/build.gradle @@ -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 } }