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@gmail.com>
Reviewed-by: Henry Castro <hcastro@collabora.com>
This commit is contained in:
Henry Castro 2020-04-21 16:41:58 -04:00
parent 49edc462b7
commit 8b593d94c1
3 changed files with 12 additions and 2 deletions

View file

@ -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 {

View file

@ -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
}

View file

@ -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)."