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 f7cfeab
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions react.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -282,27 +282,34 @@ afterEvaluate {
if (config."jsBundleDir${targetName}") {
from(jsBundleDir)
into(file(config."jsBundleDir${targetName}"))
} else {
} 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 f7cfeab

Please sign in to comment.