Kaydet (Commit) ee8257a1 authored tarafından Christian Lohmaier's avatar Christian Lohmaier

migrate android build to gradle

move preparation tasks (creating assets/processing files) from the
makefile into the gradle script

This allows much easier integration into android-studio (just open
android/source with android studio after running make to compile the
native library)

Change-Id: I9a9d6832797c24a7e195a1c7954cd6d20f5a8496
üst 8dc648d0
......@@ -31,7 +31,6 @@
# autoconf generated stuff
/aclocal.m4
/android/source/AndroidManifest.xml
/autom4te.cache
/autogen.input
/autogen.lastrun
......
......@@ -42,7 +42,6 @@ $(BUILDDIR)/config_host.mk : $(wildcard \
$(SRCDIR)/instsetoo_native/util/openoffice.lst.in \
$(SRCDIR)/configure.ac \
$(SRCDIR)/config_host/*.h.in \
$(SRCDIR)/android/source/AndroidManifest.xml.in \
$(BUILDDIR)/autogen.input \
$(BUILDDIR)/autogen.lastrun \
$(BUILDDIR)/autogen.sh \
......
assets
bin
gen
libs
obj
local.properties
native-code.cxx
AppCompat-v7
/source/.gradle/
/source/.idea/
/source/assets/
/source/assets_fullUI/
/source/assets_strippedUI/
/source/build/
/source/captures/
/source/jniLibs/
/source/jniLibs_debug/
/source/liboSettings.gradle
/source/local.properties
/source/native-code.cxx
/source/obj/
/source/source.iml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.libreoffice.kit"
android:versionCode="1"
android:versionName="1.0">
<application>
<activity android:name="org.libreoffice.kit.LibreOfficeKit" />
</application>
</manifest>
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
<?xml version="1.0" encoding="UTF-8"?>
<project name="LibreOfficeBootstrap" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<loadproperties srcFile="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="clobber_android_rules" default="debug">
<import file="${sdk.dir}/tools/ant/build.xml" />
<!--
This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
and tweaked - it needs to match the same SDK version as
your build
-->
<!--
This file is auto-generated by Bootstrap/Makefile.shared from
a versioned .xml file - please edit me there
-->
<target name="-package-resources" depends="-crunch">
<!-- only package resources if *not* a library project -->
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt executable="${aapt}"
command="package"
manifestpackage="@ANDROID_PACKAGE_NAME@"
versioncode="${version.code}"
versionname="${version.name}"
debug="${build.is.packaging.debug}"
manifest="${out.manifest.abs.file}"
assets="${asset.absolute.dir}"
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
nocrunch="${build.packaging.nocrunch}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
previousBuildType="${build.last.target}"
buildType="${build.target}"
ignoreAssets="${aapt.ignore.assets}">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<nocompress/> <!-- forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</do-only-if-not-library>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="clobber_android_rules" default="debug">
<import file="${sdk.dir}/tools/ant/build.xml" />
<!--
This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
and tweaked - it needs to match the same SDK version as
your build
-->
<!--
This file is auto-generated by Bootstrap/Makefile.shared from
a versioned .xml file - please edit me there
-->
<target name="-package-resources" depends="-crunch">
<!-- only package resources if *not* a library project -->
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt executable="${aapt}"
command="package"
manifestpackage="@ANDROID_PACKAGE_NAME@"
versioncode="${version.code}"
versionname="${version.name}"
debug="${build.is.packaging.debug}"
manifest="${out.manifest.abs.file}"
assets="${asset.absolute.dir}"
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
nocrunch="${build.packaging.nocrunch}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
previousBuildType="${build.last.target}"
buildType="${build.target}"
ignoreAssets="${aapt.ignore.assets}">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<nocompress/> <!-- forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</do-only-if-not-library>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="clobber_android_rules" default="debug">
<import file="${sdk.dir}/tools/ant/build.xml" />
<!--
This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
and tweaked - it needs to match the same SDK version as
your build
-->
<!--
This file is auto-generated by Bootstrap/Makefile.shared from
a versioned .xml file - please edit me there
-->
<target name="-package-resources" depends="-crunch">
<!-- only package resources if *not* a library project -->
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt executable="${aapt}"
command="package"
manifestpackage="@ANDROID_PACKAGE_NAME@"
versioncode="${version.code}"
versionname="${version.name}"
debug="${build.is.packaging.debug}"
manifest="${out.manifest.abs.file}"
assets="${asset.absolute.dir}"
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
nocrunch="${build.packaging.nocrunch}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
previousBuildType="${build.last.target}"
buildType="${build.target}"
ignoreAssets="${aapt.ignore.assets}">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<nocompress/> <!-- forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</do-only-if-not-library>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="clobber_android_rules" default="debug">
<import file="${sdk.dir}/tools/ant/build.xml" />
<!--
This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
and tweaked - it needs to match the same SDK version as
your build
-->
<!--
This file is auto-generated by Bootstrap/Makefile.shared from
a versioned .xml file - please edit me there
-->
<target name="-package-resources" depends="-crunch">
<!-- only package resources if *not* a library project -->
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt executable="${aapt}"
command="package"
manifestpackage="@ANDROID_PACKAGE_NAME@"
versioncode="${version.code}"
versionname="${version.name}"
debug="${build.is.packaging.debug}"
manifest="${out.manifest.abs.file}"
assets="${asset.absolute.dir}"
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
nocrunch="${build.packaging.nocrunch}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
previousBuildType="${build.last.target}"
buildType="${build.target}"
ignoreAssets="${aapt.ignore.assets}">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<nocompress/> <!-- forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</do-only-if-not-library>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="clobber_android_rules" default="debug">
<import file="${sdk.dir}/tools/ant/build.xml" />
<!--
This is copy/pasted from ${sdk.dir}/tools/ant/build.xml
and tweaked - it needs to match the same SDK version as
your build
-->
<!--
This file is auto-generated by Bootstrap/Makefile.shared from
a versioned .xml file - please edit me there
-->
<target name="-package-resources" depends="-crunch">
<!-- only package resources if *not* a library project -->
<do-only-if-not-library elseText="Library project: do not package resources..." >
<aapt executable="${aapt}"
command="package"
manifestpackage="@ANDROID_PACKAGE_NAME@"
versioncode="${version.code}"
versionname="${version.name}"
debug="${build.is.packaging.debug}"
manifest="${out.manifest.abs.file}"
assets="${asset.absolute.dir}"
androidjar="${project.target.android.jar}"
apkfolder="${out.absolute.dir}"
nocrunch="${build.packaging.nocrunch}"
resourcefilename="${resource.package.file.name}"
resourcefilter="${aapt.resource.filter}"
libraryResFolderPathRefid="project.library.res.folder.path"
libraryPackagesRefid="project.library.packages"
libraryRFileRefid="project.library.bin.r.file.path"
previousBuildType="${build.last.target}"
buildType="${build.target}"
ignoreAssets="${aapt.ignore.assets}">
<res path="${out.res.absolute.dir}" />
<res path="${resource.absolute.dir}" />
<nocompress/> <!-- forces no compression on any files in assets or res/raw -->
<!-- <nocompress extension="xml" /> forces no compression on specific file extensions in assets and res/raw -->
</aapt>
</do-only-if-not-library>
</target>
</project>
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
android.library=true
# Project target.
target=android-23
......@@ -20,7 +20,7 @@ $(loandroid3_DIR)/done : $(call gb_Postprocess_get_target,AllModulesButInstsetNa
# still looks for the .apk, and we want fresh daily builds to be uploaded.
# Us "foo" instead of the old INPATH
mkdir -p $(BUILDDIR)/instsetoo_native/foo/bin; \
cp $(SRCDIR)/android/source/bin/*-debug.apk $(BUILDDIR)/instsetoo_native/foo/bin
cp $(SRCDIR)/android/source/build/outputs/apk/*-debug.apk $(BUILDDIR)/instsetoo_native/foo/bin
$(call gb_CustomTarget_get_clean_target,android/loandroid3) :
$(call gb_Output_announce,$(subst $(WORKDIR)/Clean/,,$@),$(false),MAK,2)
......
......@@ -23,8 +23,8 @@ release-apk: build
rm -f $(SIGNED_APK)
# the actual signing
jarsigner --verbose -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/.keystore $(BUILDDIR)/android/source/bin/LibreOfficeViewer-release-unsigned.apk $(key)
$(ANDROID_SDK_HOME)/build-tools/*/zipalign -v 4 $(BUILDDIR)/android/source/bin/LibreOfficeViewer-release-unsigned.apk $(SIGNED_APK)
jarsigner --verbose -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/.keystore $(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk $(key)
$(ANDROID_SDK_HOME)/build-tools/*/zipalign -v 4 $(BUILDDIR)/android/source/build/outputs/apk/LibreOfficeViewer-strippedUI-release-unsigned.apk $(SIGNED_APK)
@echo
@echo "Resulting signed apk: $(SIGNED_APK)"
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.libreoffice"
android:installLocation="@ANDROID_INSTALL_LOCATION@"
android:versionCode="@ANDROID_VERSION_NUMBER@"
android:versionName="@ANDROID_VERSION_NAME@">
android:installLocation="${installLocation}">
<!-- App requires OpenGL ES 2.0 -->
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
......@@ -12,7 +10,6 @@
<uses-permission android:name="android.permission.INTERNET" />
<application
@ANDROID_DEBUGGABLE@
android:allowBackup="true"
android:icon="@drawable/main"
android:label="@string/app_name"
......
......@@ -5,11 +5,7 @@ endif
# The default target just builds.
all: build-ant
# The package of this app
# The setting from configure (ANDROID_PACKAGE_NAME) is applied in later stages.
APP_PACKAGE=org.libreoffice
all: build-gradle
DISABLE_UI=TRUE
BOOTSTRAPDIR=../Bootstrap
......@@ -18,27 +14,25 @@ include $(BOOTSTRAPDIR)/Makefile.shared
native-code.cxx: $(SRCDIR)/solenv/bin/native-code.py
$< -j -g core -g writer -g calc -g draw -g edit > $@
build-ant: android_version_setup copy-stuff prepare-appcompat link-so properties
#
# Copy jar files we need
#
for F in java_uno \
juh \
jurt \
ridl \
unoloader; do \
$(call COPYJAR,$(INSTDIR)/$(LIBO_URE_SHARE_JAVA_FOLDER)/$${F}.jar); \
done
for F in unoil; do \
$(call COPYJAR,$(INSTDIR)/$(LIBO_SHARE_JAVA_FOLDER)/$${F}.jar); \
done
#ownCloud lib dependency
$(call COPYJAR,$(WORKDIR)/UnpackedTarball/owncloud_android_lib/bin/owncloud-android-library.jar)
#
unset JAVA_HOME && $(ANT) $(if $(verbose),,-quiet) $(if $(ENABLE_RELEASE_BUILD),release,debug)
install:
./gradlew $(if $(verbose),--info) $(if $(versionCode),-PcmdVersionCode=$(versionCode)) install$(if $(DISABLE_UI),StrippedUI,FullUI)Debug
@echo
@echo 'Run it with "make run"'
@echo
uninstall:
$(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(ANDROID_PACKAGE_NAME)
clean:
rm -rf assets assets_fullUI assets_strippedUI jniLibs jniLibs_debug $(OBJLOCAL)
rm -f native-code.cxx
rm -f liboSettings.gradle
build-gradle: liboSettings.gradle local.properties link-so
./gradlew $(if $(verbose),--info) $(if $(versionCode),-PcmdVersionCode=$(versionCode)) assemble$(if $(DISABLE_UI),StrippedUI,FullUI)$(if $(ENABLE_RELEASE_BUILD),Release,Debug)
run:
adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity
$(ANDROID_SDK_HOME)/platform-tools/adb shell am start -n $(ANDROID_PACKAGE_NAME)/.ui.LibreOfficeUIActivity
debugrun:
$(SYSBASE)/../../../ndk-gdb --start
project.ext.set("archivesBaseName", "LibreOfficeViewer")
//build-time dependencies - android plugin for gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
apply plugin: 'com.android.application'
// buildhost settings - paths and the like
apply from: 'liboSettings.gradle'
// compile-time dependencies
dependencies {
compile fileTree(dir: "${liboInstdir}/${liboUREJavaFolder}", include: [
"java_uno.jar",
"juh.jar",
"jurt.jar",
"ridl.jar",
"unoloader.jar"
])
compile files("${liboInstdir}/${liboShareJavaFolder}/unoil.jar")
compile files("${liboWorkdir}/UnpackedTarball/owncloud_android_lib/bin/owncloud-android-library.jar")
compile 'com.android.support:support-v4:23.0.1'
compile 'com.android.support:appcompat-v7:23.0.1'
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileOptions {
// silence some java-language features hints
sourceCompatibility 6
}
// uses non-conventional source layout, so need to reconfigure accordingly
// ToDo move to conventional layout, so stuff can be stripped down.
sourceSets {
main.manifest.srcFile 'AndroidManifest.xml'
main.assets.srcDirs = ['assets']
main.res.srcDirs = ['res']
main.java.srcDirs = ['../Bootstrap/src', 'src/java']
main.jniLibs.srcDirs = ['jniLibs']
main.jni.srcDirs = [] // don't attempt to build native-lib via gradle
// gdbserver stuff from separate dir
debug.jniLibs.srcDirs "jniLibs_debug"
// the configuration data that might be stripped or not
fullUI.assets.srcDirs 'assets_fullUI'
strippedUI.assets.srcDirs 'assets_strippedUI'
}
// defaults for Manifest
defaultConfig {
minSdkVersion 14
targetSdkVersion 23
manifestPlaceholders = [installLocation: "preferExternal"]
}
buildTypes {
debug {
// make android studio happy...
jniDebuggable true
// would work just fine with external, but setting emulator up is a little more work
manifestPlaceholders = [installLocation: "internalOnly"]
}
}
productFlavors {
strippedUI
fullUI
}
}
/* remark inherited from makefile:
Then "assets". Let the directory structure under assets mimic
that under solver for now.
Please note that I have no idea what all of this is really necessary and for
much of this stuff being copied, no idea whether it makes any sense at all.
Much of this is copy-pasted from android/qa/sc/Makefile (where a couple of
unit tests for sc are built, and those do seem to mostly work) and
android/qa/desktop/Makefile (mmeeks's desktop demo, also works to some
extent)
*/
// Assets that are unpacked at run-time into the app's data directory. These
// are files read by non-LO code, fontconfig and freetype for now, that doesn't
// understand "/assets" paths.
task copyUnpackAssets(type: Copy) {
description "copies assets that need to be extracted on the device"
into 'assets/unpack'
into('program') {
from("${liboInstdir}/${liboEtcFolder}/types") {
includes = [
"offapi.rdb",
"oovbaapi.rdb"
]
}
from("${liboInstdir}/${liboUreMiscFolder}") {
includes = ["types.rdb"]
rename 'types.rdb', 'udkapi.rdb'
}
}
into('user/fonts') {
from "${liboInstdir}/share/fonts/truetype"
// Note: restrict list of fonts due to size considerations - no technical reason anymore
// ToDo: fonts would be good candidate for using Expansion Files instead
includes = [
"Liberation*.ttf",
"Caladea-*.ttf",
"Carlito-*.ttf",
"Gen*.ttf",
"opens___.ttf"
]
}
into('etc/fonts') {
from "./"
includes = ['fonts.conf']
filter {
String line ->
line.replaceAll(
'@@APPLICATION_ID@@', new String("${android.defaultConfig.applicationId}")
)
}
}
}
task copyAssets(type: Copy) {
description "copies assets that can be accessed within the installed apk"
into 'assets'
from("${liboSrcRoot}/readlicense_oo/license/") {
includes = ["LICENSE", "NOTICE"]
rename "LICENSE", "license.txt"
rename "NOTICE", "notice.txt"
}
from("${liboExampleDocument}") {
rename ".*", "example.odt"
}
into('program') {
from "${liboInstdir}/program"
includes = ['services.rdb', 'services/services.rdb']
into('resource') {
from "${liboInstdir}/${liboSharedResFolder}"
includes = ['*en-US.res']
}
}
into('share') {
from "${liboInstdir}/share"
// Filter data is needed by e.g. the drawingML preset shape import.
includes = ['registry/**', 'filter/**']
// those two get processed by mobile-config.py
excludes = ['registry/main.xcd', 'registry/res/registry_en-US.xcd']
}
}
task createFullConfig(type: Copy) {
// grab dir to clear whole hierarchy on clean target
outputs.dir "assets_fullUI"
into 'assets_fullUI/share/config/soffice.cfg'
from "${liboInstdir}/share/config/soffice.cfg"
}
task createStrippedConfig {
def preserveDir = file("assets_strippedUI/share/share/config/soffice.cfg/empty")
outputs.dir "assets_strippedUI"
outputs.dir "assets_strippedUI/share/registry/res"
outputs.file preserveDir
doLast {
file('assets_strippedUI/share/registry/res').mkdirs()
file("assets_strippedUI/share/share/config/soffice.cfg").mkdirs()
// just empty file
preserveDir.text = ""
}
}
task createStrippedConfigMain(type: Exec) {
dependsOn 'createStrippedConfig'
inputs.files "${liboInstdir}/share/registry/main.xcd", "${liboSrcRoot}/android/mobile-config.py"
outputs.file "assets_strippedUI/share/registry/main.xcd"
executable "${liboSrcRoot}/android/mobile-config.py"
args = ["${liboInstdir}/share/registry/main.xcd", "assets_strippedUI/share/registry/main.xcd"]
}
task createStrippedConfigRegistry(type: Exec) {
dependsOn 'createStrippedConfig'
inputs.files "${liboInstdir}/share/registry/res/registry_en-US.xcd", "${liboSrcRoot}/android/mobile-config.py"
outputs.file "assets_strippedUI/share/registry/res/registry_en-US.xcd"
executable "${liboSrcRoot}/android/mobile-config.py"
args = ["${liboInstdir}/share/registry/res/registry_en-US.xcd", "assets_strippedUI/share/registry/res/registry_en-US.xcd"]
doFirst {
file('assets_strippedUI/share/registry/res').mkdirs()
}
}
task copyNdkDebugServer(type: Copy) {
description "copies gdbserver into and creates gdb.setup in the debug-type only native directory"
inputs.file "liboSettings.gradle"
def gdbsetup = file("jniLibs_debug/${liboAndroidAppAbi}/gdb.setup")
outputs.file gdbsetup
outputs.dir 'jniLibs_debug' // own the directory, so it is removed on this task's clean
into "jniLibs_debug/${liboAndroidAppAbi}"
from "${liboNdkGdbserver}"
doLast {
gdbsetup.text = "set solib-search-path ./obj/local/${liboAndroidAppAbi}"
}
}
task createRCfiles {
inputs.file "liboSettings.gradle"
dependsOn copyUnpackAssets, copyAssets
def sofficerc = file('assets/unpack/program/sofficerc')
def fundamentalrc = file('assets/program/fundamentalrc')
def bootstraprc = file('assets/program/bootstraprc')
def unorc = file('assets/program/unorc')
def versionrc = file('assets/program/versionrc')
outputs.files sofficerc, fundamentalrc, unorc, bootstraprc, versionrc
doLast {
sofficerc.text = '''\
[Bootstrap]
Logo=1
NativeProgress=1
URE_BOOTSTRAP=file:///assets/program/fundamentalrc
HOME=$APP_DATA_DIR/cache
OSL_SOCKET_PATH=$APP_DATA_DIR/cache
'''.stripIndent()
fundamentalrc.text = '''\
[Bootstrap]
LO_LIB_DIR=file://$APP_DATA_DIR/lib/
BRAND_BASE_DIR=file:///assets
CONFIGURATION_LAYERS=xcsxcu:${BRAND_BASE_DIR}/share/registry res:${BRAND_BASE_DIR}/share/registry
URE_BIN_DIR=file:///assets/ure/bin/dir/nothing-here/we-can/exec-anyway
'''.stripIndent()
bootstraprc.text = '''\
[Bootstrap]
InstallMode=<installmode>
ProductKey=LibreOffice '''+ "${liboVersionMajor}.${liboVersionMinor}" + '''
UserInstallation=file://$APP_DATA_DIR
'''.stripIndent()
unorc.text = '''\
[Bootstrap]
URE_INTERNAL_LIB_DIR=file://$APP_DATA_DIR/lib/
UNO_TYPES=file://$APP_DATA_DIR/program/udkapi.rdb file://$APP_DATA_DIR/program/offapi.rdb file://$APP_DATA_DIR/program/oovbaapi.rdb
UNO_SERVICES=file:///assets/program/services.rdb file:///assets/program/services/services.rdb
'''.stripIndent()
versionrc.text = '''\
[Version]
AllLanguages=en-US
BuildVersion=
buildid=''' + "${liboGitFullCommit}" + '''
ReferenceOOoMajorMinor=4.1
'''.stripIndent()
}
}
// creating the UI stuff is cheap, don't bother only applying it for the flavor..
preBuild.dependsOn 'createRCfiles',
'createStrippedConfigMain',
'createStrippedConfigRegistry',
'createFullConfig',
'copyNdkDebugServer'
clean.dependsOn 'cleanCopyAssets',
'cleanCreateStrippedConfig',
'cleanCreateFullConfig',
'cleanCopyNdkDebugServer'
<?xml version="1.0" encoding="UTF-8"?>
<project name="LibreOfficeViewer" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<loadproperties srcFile="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${android.library.reference.1}/no-resource-compress.xml" />
</project>
......@@ -74,7 +74,7 @@
later to patch in proper code in fontonfig on Android to
find out a good place.
-->
<cachedir>/data/data/org.libreoffice/fontconfig</cachedir>
<cachedir>/data/data/@@APPLICATION_ID@@/fontconfig</cachedir>
<config>
<!--
......
#Tue Oct 06 15:23:16 CEST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`"
cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-23
# Use the Bootstrap class
android.library.reference.1=../Bootstrap
android.library.reference.2=../AppCompat-v7
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment