[Libreoffice-commits] online.git: 2 commits - android/app android/gradle.properties android/README configure.ac .gitignore loleaflet/html loleaflet/Makefile.am Makefile.am

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Feb 13 12:23:18 UTC 2019


 .gitignore                                                             |    4 +
 Makefile.am                                                            |   11 +---
 android/README                                                         |    7 ++-
 android/app/src/main/java/org/libreoffice/androidapp/MainActivity.java |    2 
 android/gradle.properties                                              |   19 ++++++++
 configure.ac                                                           |    4 +
 loleaflet/Makefile.am                                                  |   23 ++++++----
 loleaflet/html/loleaflet.html.m4                                       |    1 
 8 files changed, 53 insertions(+), 18 deletions(-)

New commits:
commit e79f5f7ec689facbd96f3fbeee3cfa72aded7201
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Feb 13 13:22:25 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Feb 13 13:22:25 2019 +0100

    android: Create the html, js and css and copy it to the right place.
    
    Change-Id: I3efbba0ae369387796e2d08b3003e4f469610dda

diff --git a/.gitignore b/.gitignore
index a5c7420b4..aa2c717fb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -91,6 +91,10 @@ pocolib-symlink
 ICU.dat
 ios/Mobile/Assets.xcassets/AppIcon.appiconset
 
+# android stuff
+/android/app/src/main/assets/dist
+/android/app/src/main/cpp/CMakeLists.txt
+
 # backup and temporary editor files: the only convenience rules allowed here.
 *~
 .*sw?
diff --git a/Makefile.am b/Makefile.am
index 62f74125c..401ad72e6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,14 +1,12 @@
 ETAGS=ctags -e
 
-if ENABLE_IOSAPP
-
-SUBDIRS = loleaflet
-
-else
+if ENABLE_MOBILEAPP
 
 if ENABLE_GTKAPP
-
 SUBDIRS = gtk loleaflet
+else
+SUBDIRS = loleaflet
+endif
 
 else
 
@@ -392,4 +390,3 @@ endif
 build-nocheck: all-am
 
 endif
-endif
diff --git a/android/README b/android/README
index 83b1debde..b1580fdb3 100644
--- a/android/README
+++ b/android/README
@@ -28,7 +28,12 @@
 
   ./autogen.sh && ./configure CC=~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang CXX=~/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/armv7a-linux-androideabi21-clang++ --host=arm-linux-androideabi --enable-androidapp --with-lo-builddir=/local/libreoffice/master-android --with-poco-includes=/opt/poco-android/include --with-poco-libs=/opt/poco-android/lib --disable-setcap --enable-silent-rules --enable-debug
 
-* Build it
+* Build the JavaScript, HTML and CSS files
+
+  # just run 'make'
+  make
+
+* Build the actual app
 
   + Start Android Studio
   + Open this 'android' subdir as a project
diff --git a/android/app/src/main/java/org/libreoffice/androidapp/MainActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/MainActivity.java
index 121e9cc9c..9388372b4 100644
--- a/android/app/src/main/java/org/libreoffice/androidapp/MainActivity.java
+++ b/android/app/src/main/java/org/libreoffice/androidapp/MainActivity.java
@@ -32,7 +32,7 @@ public class MainActivity extends AppCompatActivity {
         browserSettings.setJavaScriptEnabled(true);
         browser.addJavascriptInterface(new JavaScriptInterface(), "MainHandler");
 
-        browser.loadUrl("file:///android_asset/html/index.html");
+        browser.loadUrl("file:///android_asset/dist/loleaflet.html");
 
         Button jsButton = findViewById(R.id.js_button);
         jsButton.setOnClickListener(new View.OnClickListener() {
diff --git a/configure.ac b/configure.ac
index b1ce4a7fb..32cf66d8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -485,16 +485,20 @@ AS_IF([test "$ENABLE_GTKAPP" = true],
 AM_CONDITIONAL([ENABLE_DEBUG], [test "$ENABLE_DEBUG" = "true"])
 
 mobile_app=
+ENABLE_MOBILEAPP=
 MOBILEAPP=0
 AC_MSG_CHECKING([Is this a mobile app])
 if test "$enable_gtkapp" = "yes" -o "$enable_iosapp" = "yes" -o "$enable_androidapp"; then
      AC_MSG_RESULT([Yes])
      mobile_app=true;
      MOBILEAPP=1
+     ENABLE_MOBILEAPP=true
 else
      AC_MSG_RESULT([No])
 fi
 AC_DEFINE_UNQUOTED([MOBILEAPP],[$MOBILEAPP],[Define to 1 if this is a mobileapp (eg. Android) build.])
+AC_SUBST(ENABLE_MOBILEAPP)
+AM_CONDITIONAL([ENABLE_MOBILEAPP], [test "$ENABLE_MOBILEAPP" = "true"])
 
 ENABLE_SSL=true
 if test "$enable_ssl" != "no" -a "$mobile_app" != "true"; then
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 2732e1928..dcdcf31fc 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -3,11 +3,9 @@ DRAW_VERSION=0.2.4
 
 L10N_PO = $(wildcard $(srcdir)/po/*.po)
 
-if !ENABLE_IOSAPP
-if !ENABLE_GTKAPP
+if !ENABLE_MOBILEAPP
 L10N_JSON = $(patsubst $(srcdir)/po/%.po,$(builddir)/dist/l10n/%.json,$(L10N_PO))
 endif
-endif
 
 if ENABLE_IOSAPP
 L10N_IOS_ALL_JS = $(builddir)/dist/l10n-all.js
@@ -111,12 +109,10 @@ NODE_MODULES_JS =\
 	node_modules/vex-js/js/vex.js \
 	node_modules/vex-js/js/vex.dialog.js
 
-if !ENABLE_IOSAPP
-if !ENABLE_GTKAPP
+if !ENABLE_MOBILEAPP
 NODE_MODULES_JS +=\
 	node_modules/l10n-for-node/l10n.js
 endif
-endif
 
 NODE_MODULES_JS_SRC = $(patsubst %.js,$(builddir)/%.js,$(NODE_MODULES_JS))
 NODE_MODULES_JS_DST = $(patsubst %.js,$(builddir)/dist/%.js,$(NODE_MODULES_JS))
@@ -152,11 +148,9 @@ all-local:
 	@$(MAKE) node_modules
 	@$(MAKE) build-loleaflet
 
-if !ENABLE_IOSAPP
-if !ENABLE_GTKAPP
+if !ENABLE_MOBILEAPP
 ADMIN_BUNDLE = $(builddir)/dist/admin-bundle.js
 endif
-endif
 
 build-loleaflet: | $(LOLEAFLET_L10N_DST) \
 	$(L10N_JSON) \
@@ -169,6 +163,16 @@ build-loleaflet: | $(LOLEAFLET_L10N_DST) \
 	$(builddir)/dist/bundle.js \
 	$(builddir)/dist/loleaflet.html
 	@echo "build loleaflet completed"
+if ENABLE_ANDROIDAPP
+	@rm -rf $(srcdir)/../android/app/src/main/assets/dist
+	@cp -a $(builddir)/dist $(srcdir)/../android/app/src/main/assets/
+	@echo
+	@echo "Copied JS, HTML and CSS to the Android project (android/app/src/main/assets/dist)."
+	@echo
+	@echo "  Now you need to build the actual .apk from Android Studio:"
+	@echo "  Just open the 'android' subdir as a project there and build."
+	@echo
+endif
 
 $(builddir)/dist/admin-bundle.js: $(LOLEAFLET_ADMIN_DST) \
 	$(LOLEAFLET_PREFIX)/dist/admin-src.js
@@ -244,6 +248,7 @@ $(builddir)/dist/loleaflet.html: $(srcdir)/html/loleaflet.html.m4 $(LOLEAFLET_HT
 	@m4 -E -DDEBUG=$(ENABLE_DEBUG) \
 		-DIOSAPP=$(ENABLE_IOSAPP) \
 		-DGTKAPP=$(ENABLE_GTKAPP) \
+		-DANDROIDAPP=$(ENABLE_ANDROIDAPP) \
 		-DMOBILEAPPNAME="$(MOBILE_APP_NAME)" \
 		-DLOLEAFLET_CSS="$(subst $(SPACE),$(COMMA),$(LOLEAFLET_CSS_M4))" \
 		-DLOLEAFLET_JS="$(subst $(SPACE),$(COMMA),$(GLOBAL_JS) $(NODE_MODULES_JS) \
diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4
index 96bd3704e..fbfa87b03 100644
--- a/loleaflet/html/loleaflet.html.m4
+++ b/loleaflet/html/loleaflet.html.m4
@@ -16,6 +16,7 @@ dnl# Define MOBILEAPP as true if this is either for the iOS app or for the gtk+
 define([MOBILEAPP],[])
 ifelse(IOSAPP,[true],[define([MOBILEAPP],[true])])
 ifelse(GTKAPP,[true],[define([MOBILEAPP],[true])])
+ifelse(ANDROIDAPP,[true],[define([MOBILEAPP],[true])])
 
 ifelse(MOBILEAPP,[],
   // Start listening for Host_PostmessageReady message and save the
commit 7088b77471e3fa6cddacc3bd28217d8088b446ee
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Wed Feb 13 13:20:59 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Wed Feb 13 13:20:59 2019 +0100

    android: Add a missing file.
    
    Change-Id: Ia514a4fe706f8e3fba8f7bb782f58870ba8d6bae

diff --git a/android/gradle.properties b/android/gradle.properties
new file mode 100644
index 000000000..9e6fce102
--- /dev/null
+++ b/android/gradle.properties
@@ -0,0 +1,19 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+android.enableJetifier=true
+android.useAndroidX=true
+org.gradle.jvmargs=-Xmx1536m
+
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true


More information about the Libreoffice-commits mailing list