[Libreoffice-commits] online.git: android/app loleaflet/Makefile.am

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 21 21:01:26 UTC 2020


 android/app/appSettings.gradle.in |    1 +
 android/app/build.gradle          |   12 +++++++++++-
 loleaflet/Makefile.am             |    1 -
 3 files changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 8b593d94c160db1c6d4e640072495d8f03e701e3
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Apr 21 16:41:58 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Tue Apr 21 23:01:07 2020 +0200

    android: add gradle task copyBrandFiles
    
    The gradle build system can do the job
    
    Change-Id: Ife8f080726ca61540201bd00acb7fab97efbba85
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92659
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/android/app/appSettings.gradle.in b/android/app/appSettings.gradle.in
index a4e89c24f..cbef6f786 100644
--- a/android/app/appSettings.gradle.in
+++ b/android/app/appSettings.gradle.in
@@ -6,6 +6,7 @@ ext {
     liboInfoURL         = '@INFO_URL@'
     liboLauncherIcon    = '@mipmap/@APP_IC_LAUNCHER@'
     liboHasBranding     = '@APP_HAS_BRANDING@'
+    liboBrandingDir     = '@APP_BRANDING_DIR@'
     liboAndroidAbi      = '@ANDROID_ABI@'
 }
 android.defaultConfig {
diff --git a/android/app/build.gradle b/android/app/build.gradle
index abb4d01b0..a7218c635 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -74,10 +74,20 @@ dependencies {
     implementation project(path: ':lib')
 }
 
+task copyBrandFiles(type: Copy) {
+	from "${liboBrandingDir}/android"
+	into "src/main/res"
+	println 'copy files done'
+}
+
 task build_loleaflet(type: Exec) {
 	commandLine 'make', '-C', '../../'
 }
 
 afterEvaluate {
-	preBuild.dependsOn build_loleaflet
+	if (!project.ext.liboHasBranding.equals("true") || !file("${liboBrandingDir}").exists()) {
+		copyBrandFiles.enabled = false;
+	}
+
+	preBuild.dependsOn copyBrandFiles, build_loleaflet
 }
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 9702c2e65..a7466742f 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -338,7 +338,6 @@ if ENABLE_ANDROIDAPP
 	@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)/branding.css" "$(APP_BRANDING_DIR)/branding.js" $(abs_top_srcdir)/android/lib/src/main/assets/dist/ ; else touch $(abs_top_srcdir)/android/lib/src/main/assets/dist/branding.css ; fi
 	@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)"/images/*.svg $(abs_top_srcdir)/android/lib/src/main/assets/dist/images/ ; fi
 	@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)/images/toolbar-bg-logo.svg" $(abs_top_srcdir)/android/lib/src/main/assets/dist/images/toolbar-bg.svg ; fi
-	@if test -d "$(APP_BRANDING_DIR)/android" ; then for I in `cd "$(APP_BRANDING_DIR)/android" && find . -type f` ; do mkdir -p $(abs_top_srcdir)/android/lib/src/main/res/`dirname $$I` ; cp -a "$(APP_BRANDING_DIR)/android/$$I" "$(abs_top_srcdir)/android/app/src/main/res/$$I" ; done ; fi
 	@if test -d "$(APP_BRANDING_DIR)/online-theme" ; then mkdir -p $(abs_top_srcdir)/android/lib/src/main/assets/share/theme_definitions ; cp -a "$(APP_BRANDING_DIR)/online-theme" "$(abs_top_srcdir)/android/lib/src/main/assets/share/theme_definitions/online" ; fi
 	@echo
 	@echo "Copied JS, HTML and CSS to the Android project (android/lib/src/main/assets/dist)."


More information about the Libreoffice-commits mailing list