Skip to content

Commit

Permalink
android: check if native modules assets exist
Browse files Browse the repository at this point in the history
Checks if the native modules assets folder exists before trying
to create the files and dir lists for the current arch at build time.
Fixes a build error when trying to build with the native modules
feature turned on but without native modules inside the nodejs
project.
  • Loading branch information
jaimecbernardo committed Jun 19, 2018
1 parent 222f953 commit 22e6286
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ if ("1".equals(shouldRebuildNativeModules)) {
outputs.file "${rootProject.buildDir}/nodejs-native-assets/nodejs-native-assets-${abi_name}/file.list"
outputs.file "${rootProject.buildDir}/nodejs-native-assets/nodejs-native-assets-${abi_name}/dir.list"
doLast{
if(!(new File("${rootProject.buildDir}/nodejs-native-assets/nodejs-native-assets-${abi_name}/")).exists()) {
// If the native assets folder doesn't exist from the copy task, skip the creation of the file.list
return;
}
delete "${rootProject.buildDir}/nodejs-native-assets/nodejs-native-assets-${abi_name}/file.list"
delete "${rootProject.buildDir}/nodejs-native-assets/nodejs-native-assets-${abi_name}/dir.list"
String file_list = "";
Expand Down

0 comments on commit 22e6286

Please sign in to comment.