diff options
Diffstat (limited to 'android/source/build.gradle')
-rw-r--r-- | android/source/build.gradle | 83 |
1 files changed, 52 insertions, 31 deletions
diff --git a/android/source/build.gradle b/android/source/build.gradle index a690749ff0ee..8cbef7744d8e 100644 --- a/android/source/build.gradle +++ b/android/source/build.gradle @@ -2,21 +2,26 @@ apply plugin: 'com.android.application' // buildhost settings - paths and the like apply from: 'liboSettings.gradle' -project.ext.set("archivesBaseName", "LibreOfficeViewer") allprojects { repositories { - jcenter() + mavenCentral() + maven { + url "https://ipv6.repo1.maven.org/maven2" + } google() } } //build-time dependencies - android plugin for gradle buildscript { repositories { - jcenter() + mavenCentral() + maven { + url "https://ipv6.repo1.maven.org/maven2" + } google() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.1' + classpath 'com.android.tools.build:gradle:8.3.2' } } @@ -27,15 +32,16 @@ dependencies { "libreoffice.jar", "unoloader.jar" ]) - implementation 'com.android.support:design:27.1.1' // also pulls-in corresponding support libraries - implementation 'com.android.support.constraint:constraint-layout:1.1.2' + implementation 'com.google.android.material:material:1.11.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.4' + implementation "androidx.multidex:multidex:2.0.1" } android { - compileSdkVersion 28 - compileOptions { - // silence some java-language features hints - sourceCompatibility 6 + namespace 'org.libreoffice' + compileSdk 34 + buildFeatures { + buildConfig = true } // uses non-conventional source layout, so need to reconfigure accordingly // ToDo move to conventional layout, so stuff can be stripped down. @@ -45,15 +51,17 @@ android { main.res.srcDirs = ['res', 'res_generated'] main.java.srcDirs = ['../Bootstrap/src', 'src/java'] main.jniLibs.srcDirs = ["${liboJniLibsdir}"] - main.jni.srcDirs = [] // don't attempt to build native-lib via gradle // the configuration data that might be stripped or not fullUI.assets.srcDirs 'assets_fullUI' strippedUI.assets.srcDirs 'assets_strippedUI' strippedUIEditing.assets.srcDirs 'assets_strippedUI' } defaultConfig { - minSdkVersion 16 - targetSdkVersion 28 + // minSdkVersion is set in liboSettings.gradle + targetSdkVersion 34 + // multidex needed when > 65,536 methods referenced with minSdKVersion < 21 + // s. https://developer.android.com/studio/build/multidex + multiDexEnabled true vectorDrawables.useSupportLibrary = true } buildTypes { @@ -77,16 +85,31 @@ android { strippedUIEditing { dimension "default" buildConfigField 'boolean', 'ALLOW_EDITING', 'true' - versionNameSuffix "-editing" } fullUI.dimension "default" } - lintOptions { - // don't error-out on missing translations - warning 'MissingTranslation' + lint { + warningsAsErrors true + // ignore missing or extra translations, since these are tracked/managed via Weblate + ignore 'ExtraTranslation', 'MissingTranslation' + // don't error-out on external updates (new gradle plugin, library versions + // or target API become available) + // don't error-out on TypographyEllipsis, since this can be introduced with + // new translations, and those are handled in Weblate + informational 'AndroidGradlePluginVersion', 'GradleDependency', 'NewerVersionAvailable', 'OldTargetApi', 'TypographyEllipsis' + // don't fail on pre-existing issues + // These should be dealt with at some point, though. + // To update lint-baseline.xml, just remove the file and run the build again. + baseline file("lint-baseline.xml") + // s.a. lint.xml that contains further config } } +// show warnings about use of deprecated API +tasks.withType(JavaCompile).configureEach { + options.deprecation = true +} + /* remark inherited from makefile: Then "assets". Let the directory structure under assets mimic that under solver for now. @@ -145,11 +168,20 @@ task copyAssets(type: Copy) { description "copies assets that can be accessed within the installed apk" into 'assets' - // include icons + // include icons, Impress styles and required .ui files into ('share') { into ('config') { from ("${liboInstdir}/share/config") - includes = ['images_**.zip'] + includes = ['images_**.zip', + '**/simpress/**.xml', + '**/annotation.ui', + '**/hfmenubutton.ui', + '**/inforeadonlydialog.ui', + '**/pbmenubutton.ui', + '**/scrollbars.ui', + '**/tabbuttons.ui', + '**/tabviewbar.ui' + ] } } @@ -174,15 +206,6 @@ task copyAssets(type: Copy) { include '*.data' } } - // include required .ui files - into('config') { - from "${liboInstdir}/share/config" - include '**/annotation.ui', - '**/hfmenubutton.ui', - '**/inforeadonlydialog.ui', - '**/pbmenubutton.ui', - '**/tabbuttons.ui', '**/tabviewbar.ui' - } } task copyAppResources(type: Copy) { @@ -193,9 +216,6 @@ task copyAppResources(type: Copy) { rename "LICENSE", "license.txt" rename "NOTICE", "notice.txt" } - from("${liboExampleDocument}") { - rename ".*", "example.odt" - } } task createFullConfig(type: Copy) { @@ -264,6 +284,7 @@ task createRCfiles { [Bootstrap] LO_LIB_DIR=file://$APP_DATA_DIR/lib/ BRAND_BASE_DIR=file:///assets + BRAND_SHARE_SUBDIR=share 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() |