[Android] Prevent gradle from failing when building some modules in standalone mode

Nicolas Pomepuy git at videolan.org
Thu Feb 24 11:14:28 UTC 2022


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Feb 21 10:19:35 2022 +0100| [c78f6b1f686782fe1d4a3c5a02b369cf7137c7e2] | committer: Nicolas Pomepuy

Prevent gradle from failing when building some modules in standalone mode

> https://code.videolan.org/videolan/vlc-android/commit/c78f6b1f686782fe1d4a3c5a02b369cf7137c7e2
---

 application/vlc-android/build.gradle | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/application/vlc-android/build.gradle b/application/vlc-android/build.gradle
index 67106e1ad..8479c0676 100644
--- a/application/vlc-android/build.gradle
+++ b/application/vlc-android/build.gradle
@@ -241,14 +241,16 @@ def revision() {
 def changelog() {
     def newsFile = new File("NEWS")
     def line, output = "", started = false
-    newsFile.withReader { reader ->
-        while ((line = reader.readLine()) != null) {
-            if (started && !line?.trim()) break
-            if (started) {
-                if (output != "") output += "\\n"
-                output += line.trim()
+    if (newsFile.exists()) {
+        newsFile.withReader { reader ->
+            while ((line = reader.readLine()) != null) {
+                if (started && !line?.trim()) break
+                if (started) {
+                    if (output != "") output += "\\n"
+                    output += line.trim()
+                }
+                if (line.contains("---")) started = true
             }
-            if (line.contains("---")) started = true
         }
     }
     return output



More information about the Android mailing list