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

Update codepush.gradle #2471

Merged
merged 6 commits into from
Jun 27, 2024
Merged
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 @@ -2,8 +2,8 @@

import java.nio.file.Paths;

def config = project.extensions.findByName("react") ?: []
def bundleAssetName = config.bundleAssetName.get() ?: "index.android.bundle"
def config = project.extensions.findByName("react") ?: [:]
def bundleAssetName = config.bundleAssetName ? config.bundleAssetName.get() : "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 ? config.debuggableVariants.get() : ['debug']

android.applicationVariants.all { variant ->
// No code push for debuggable variants
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 ? config.nodeExecutableAndArgs.get(): ["node"]
def extraPackagerArgs = config.extraPackagerArgs ? config.extraPackagerArgs.get() : []

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

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

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