diff --git a/android/codepush.gradle b/android/codepush.gradle index a0f9d2748..6188f4c0d 100644 --- a/android/codepush.gradle +++ b/android/codepush.gradle @@ -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) { @@ -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 @@ -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 { @@ -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; @@ -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