Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(codepush.gradle): config arraylist accessing. #2512

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions android/codepush.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.nio.file.Paths;

def config = project.extensions.findByName("react") ?: []
def bundleAssetName = config.bundleAssetName.get() ?: "index.android.bundle"
def bundleAssetName = config.bundleAssetName ?: "index.android.bundle"

// because elvis operator
def elvisFile(thing) {
Expand All @@ -24,7 +24,7 @@ android.buildTypes.each { buildType ->
}

gradle.projectsEvaluated {
def debuggableVariants = config.debuggableVariants.get() ?: ['debug']
def debuggableVariants = config.debuggableVariants ?: ['debug']

android.applicationVariants.all { variant ->
// No code push for debuggable variants
Expand All @@ -34,7 +34,7 @@ gradle.projectsEvaluated {

def nodeModulesPath;
if (config.root) {
nodeModulesPath = Paths.get(config.root.asFile.get().absolutePath, "/node_modules");
nodeModulesPath = Paths.get(config.root.asFile.absolutePath, "/node_modules");
} else if (project.hasProperty('nodeModulesPath')) {
nodeModulesPath = project.nodeModulesPath
} else {
Expand All @@ -49,8 +49,8 @@ gradle.projectsEvaluated {
def jsBundleFile;

// Additional node commandline arguments
def nodeExecutableAndArgs = config.nodeExecutableAndArgs.get() ?: ["node"]
def extraPackagerArgs = config.extraPackagerArgs.get() ?: []
def nodeExecutableAndArgs = config.nodeExecutableAndArgs ?: ["node"]
def extraPackagerArgs = config.extraPackagerArgs ?: []

// Make this task run right after the bundle task
def generateBundledResourcesHash;
Expand All @@ -73,11 +73,11 @@ gradle.projectsEvaluated {
runBefore("merge${targetName}Assets", generateBundledResourcesHash)
} else {
def jsBundleDirConfigName = "jsBundleDir${targetName}"
jsBundleDir = elvisFile(config."$jsBundleDirConfigName").get() ?:
jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?:
file("$buildDir/intermediates/assets/${targetPath}")

def resourcesDirConfigName = "resourcesDir${targetName}"
resourcesDir = elvisFile(config."${resourcesDirConfigName}").get() ?:
resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?:
file("$buildDir/intermediates/res/merged/${targetPath}")

// In case version of 'Android Plugin for Gradle'' is lower than 1.3.0
Expand Down