Skip to content

Commit

Permalink
copy bundled js into correct libraries assets dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Legion2 committed Aug 17, 2021
1 parent 1220125 commit 7f8348d
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions react.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -284,25 +284,32 @@ afterEvaluate {
into(file(config."jsBundleDir${targetName}"))
} else {
into ("$buildDir/intermediates")
into ("assets/${targetPath}") {
from(jsBundleDir)
}
if (isAndroidLibrary) {
into ("library_assets/${variant.name}/out") {
from(jsBundleDir)
}
} else {
into ("assets/${targetPath}") {
from(jsBundleDir)
}

// Workaround for Android Gradle Plugin 3.2+ new asset directory
into ("merged_assets/${variant.name}/merge${targetName}Assets/out") {
from(jsBundleDir)
}
// Workaround for Android Gradle Plugin 3.2+ new asset directory
into ("merged_assets/${variant.name}/merge${targetName}Assets/out") {
from(jsBundleDir)
}

// Workaround for Android Gradle Plugin 3.4+ new asset directory
into ("merged_assets/${variant.name}/out") {
from(jsBundleDir)
// Workaround for Android Gradle Plugin 3.4+ new asset directory
into ("merged_assets/${variant.name}/out") {
from(jsBundleDir)
}
}
}

// mergeAssets must run first, as it clears the intermediates directory
dependsOn(variant.mergeAssetsProvider.get())

enabled(currentBundleTask.enabled)
dependsOn(currentBundleTask)
}

// mergeResources task runs before the bundle file is copied to the intermediate asset directory from Android plugin 4.1+.
Expand Down

0 comments on commit 7f8348d

Please sign in to comment.