From 346025d65dca42d2021b28f879246b77a4f7c75c Mon Sep 17 00:00:00 2001 From: Hristo Deshev Date: Fri, 21 Oct 2016 13:06:19 +0300 Subject: [PATCH] Fix(project template) Force bindings regen, if out dir empty. Running `tns build ... --bundle` runs the clean gradle target and we can end up deleting bindings *.dex files while the presence of *.txt files in the generator dir will prevent us from regenerating them. The fix checks the output dir and forces regeneration if it has no files. --- android-static-binding-generator/project/build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/android-static-binding-generator/project/build.gradle b/android-static-binding-generator/project/build.gradle index fe1e30e8c..2bbb13368 100644 --- a/android-static-binding-generator/project/build.gradle +++ b/android-static-binding-generator/project/build.gradle @@ -56,6 +56,11 @@ task generateInterfaceNamesList() { shouldRun = !contents.equals(current.toString()) } + if (!shouldRun) { + //Force regeneration if the output dir contains no files + shouldRun = project.outDir.listFiles().length == 0 + } + if (shouldRun) { javaexec { main "-jar"