Skip to content

Commit

Permalink
Fix thrown GradleScriptExceptions
Browse files Browse the repository at this point in the history
Summary:
Changelog:
[Android] [Fixed] Use actual constructor when throwing GradleScriptException

Reviewed By: PeteTheHeat

Differential Revision: D21644385

fbshipit-source-id: 09802682cb9eb788e508cff3fbebdbdacd5b1d69
  • Loading branch information
Joshua Selbo authored and facebook-github-bot committed May 19, 2020
1 parent afad239 commit 8ef0f1d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ReactAndroid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy
task prepareHermes() {
def hermesPackagePath = findNodeModulePath(projectDir, "hermes-engine")
if (!hermesPackagePath) {
throw new GradleScriptException("Could not find the hermes-engine npm package")
throw new GradleScriptException("Could not find the hermes-engine npm package", null)
}

def hermesAAR = file("$hermesPackagePath/android/hermes-debug.aar")
if (!hermesAAR.exists()) {
throw new GradleScriptException("The hermes-engine npm package is missing \"android/hermes-debug.aar\"")
throw new GradleScriptException("The hermes-engine npm package is missing \"android/hermes-debug.aar\"", null)
}

def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" })
Expand Down Expand Up @@ -165,12 +165,12 @@ task prepareJSC {
doLast {
def jscPackagePath = findNodeModulePath(projectDir, "jsc-android")
if (!jscPackagePath) {
throw new GradleScriptException("Could not find the jsc-android npm package")
throw new GradleScriptException("Could not find the jsc-android npm package", null)
}

def jscDist = file("$jscPackagePath/dist")
if (!jscDist.exists()) {
throw new GradleScriptException("The jsc-android npm package is missing its \"dist\" directory")
throw new GradleScriptException("The jsc-android npm package is missing its \"dist\" directory", null)
}

def jscAAR = fileTree(jscDist).matching({ it.include "**/android-jsc/**/*.aar" }).singleFile
Expand Down

0 comments on commit 8ef0f1d

Please sign in to comment.