OsmAnd library config

This commit is contained in:
max-klaus 2020-11-24 17:07:44 +03:00
parent 6a085f5d0b
commit e9b3a881b5
2 changed files with 86 additions and 145 deletions

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"
package="net.osmand.plus">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<!-- The next 2 seem necessary only for Android < v4.2 (to initialize BT SCO) -->
<uses-permission android:name="android.permission.BROADCAST_STICKY" android:maxSdkVersion="18" />
<uses-permission android:name="android.permission.BLUETOOTH" android:maxSdkVersion="18" />
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.microphone" android:required="false" />
<uses-feature android:name="android.hardware.wifi" android:required="false" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.sensor.light" android:required="false" />
<uses-feature android:name="android.hardware.sensor.compass" android:required="false" />
<uses-feature android:name="android.hardware.sensor.accelerometer" android:required="false" />
<uses-feature android:name="android.hardware.sensor.gyroscope" android:required="false" />
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
<uses-feature android:name="com.sec.feature.spen_usp" android:required="false"/>
<uses-sdk android:targetSdkVersion="26"
tools:overrideLibrary="com.getkeepsafe.taptargetview, studio.carbonylgroup.textfieldboxes, android.support.customtabs"/>
<supports-screens android:resizeable="true" android:smallScreens="true" android:normalScreens="true" android:largeScreens="true"
android:xlargeScreens="true" android:anyDensity="true" />
</manifest>

View file

@ -1,23 +1,5 @@
//apply plugin: 'com.android.application'
apply plugin: 'com.android.library'
// Global Parameters accepted
// TARGET_APP_NAME - app name
// APK_NUMBER_VERSION - version number of apk
// APK_VERSION_SUFFIX - build number like #99999Z, appended (for dev builds) to Manifest's versionName as X.X.X#99999Z
// Z means flavor: M=-master, D=-main-default, B=-Blackberry, Des=-design, MQA=-main-qt-arm, MQDA=-main-qt-default-arm, S=-sherpafy
// APP_EDITION - date stamp of builds
// APP_FEATURES - features +play_market +gps_status -parking_plugin -blackberry -free_version -amazon
// 1. To be done Filter fonts
// <unzip src="OsmAndCore_android.aar" dest=".">
// <patternset>
// <include name="assets/**/map/fonts/OpenSans/*"/>
// <include name="assets/**/map/fonts/NotoSans/*"/>
// </patternset>
// </unzip>
// Less important
task printc {
configurations.each { if(it.isCanBeResolved()) println it.name }
}
@ -27,67 +9,21 @@ android {
buildToolsVersion "29.0.3"
// compileNdkVersion "android-ndk-r17b"
signingConfigs {
development {
storeFile file("../keystores/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
publishing {
storeFile file("/var/lib/jenkins/osmand_key")
storePassword System.getenv("OSMAND_APK_PASSWORD")
keyAlias "osmand"
keyPassword System.getenv("OSMAND_APK_PASSWORD")
}
}
defaultConfig {
minSdkVersion System.getenv("MIN_SDK_VERSION") ? System.getenv("MIN_SDK_VERSION").toInteger() : 15
minSdkVersion 15
targetSdkVersion 29
versionCode 390
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
multiDexEnabled true
versionName "3.9.0"
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
versionName System.getenv("APK_VERSION_SUFFIX")? versionName + System.getenv("APK_VERSION_SUFFIX").toString(): versionName
// Stops the Gradle plugins automatic rasterization of vectors
// vectorDrawables.generatedDensities = ['hdpi']
vectorDrawables.useSupportLibrary = true
}
lintOptions {
lintConfig file("lint.xml")
abortOnError false
warningsAsErrors false
}
/*
bundle {
language {
// Specifies that the app bundle should not support
// configuration APKs for language resources. These
// resources are instead packaged with each base and
// dynamic feature APK.
enableSplit = false
}
}
*/
// related to kuromoji
//packagingOptions {
// exclude '/META-INF/CONTRIBUTORS.md'
// exclude '/META-INF/LICENSE.md'
// exclude '/META-INF/NOTICE.md'
//}
// This is from OsmAndCore_android.aar - for some reason it's not inherited
aaptOptions {
// Don't compress any embedded resources
noCompress "qz"
cruncherEnabled = false
// Flag notifies aapt to keep the attribute IDs around
// additionalParameters "--no-version-vectors"
}
dexOptions {
@ -96,7 +32,7 @@ android {
sourceSets {
main {
manifest.srcFile "AndroidManifest.xml"
manifest.srcFile "AndroidManifest-library.xml"
jni.srcDirs = []
jniLibs.srcDirs = ["libs"]
aidl.srcDirs = ["src"]
@ -107,25 +43,8 @@ android {
assets.srcDirs = ["assets"]
}
debug {
manifest.srcFile "AndroidManifest-debug.xml"
}
/*
full {
java.srcDirs = ["src-google"]
}
free {
java.srcDirs = ["src-google"]
manifest.srcFile "AndroidManifest-free.xml"
}
freedev {
java.srcDirs = ["src-google"]
manifest.srcFile "AndroidManifest-freedev.xml"
}
freehuawei {
java.srcDirs = ["src-huawei"]
manifest.srcFile "AndroidManifest-freehuawei.xml"
}
*/
legacy {
jniLibs.srcDirs = ["libc++"]
}
@ -165,70 +84,27 @@ android {
}
}
/*
// Version
freedev {
dimension "version"
applicationId "net.osmand.dev"
// resConfig "en"
}
free {
dimension "version"
applicationId "net.osmand"
}
full {
dimension "version"
applicationId "net.osmand.plus"
}
freehuawei {
dimension "version"
applicationId "net.osmand.huawei"
}
*/
// CoreVersion
// Build that doesn't include 3D OpenGL
legacy {
dimension "coreversion"
}
// Build that includes 3D OpenGL release
qtcore {
dimension "coreversion"
}
// Build that includes 3D OpenGL debug
qtcoredebug {
dimension "coreversion"
}
}
buildTypes {
debug {
buildConfigField "String", "OPR_BASE_URL", "\"https://test.openplacereviews.org/\""
buildConfigField "String", "OSM_OAUTH_CONSUMER_KEY", "\"Ti2qq3fo4i4Wmuox3SiWRIGq3obZisBHnxmcM05y\""
buildConfigField "String", "OSM_OAUTH_CONSUMER_SECRET", "\"lxulb3HYoMmd2cC4xxNe1dyfRMAY8dS0eNihJ0DM\""
signingConfig signingConfigs.development
}
release {
buildConfigField "String", "OPR_BASE_URL", "\"https://test.openplacereviews.org/\""
buildConfigField "String", "OSM_OAUTH_CONSUMER_KEY", "\"Ti2qq3fo4i4Wmuox3SiWRIGq3obZisBHnxmcM05y\""
buildConfigField "String", "OSM_OAUTH_CONSUMER_SECRET", "\"lxulb3HYoMmd2cC4xxNe1dyfRMAY8dS0eNihJ0DM\""
signingConfig signingConfigs.publishing
}
debuggable true
}
release {
debuggable false
}
}
}
def replaceNoTranslate(line) {
if (line.contains("\"app_name\"") && System.getenv("TARGET_APP_NAME")) {
return line.replaceAll(">[^<]*<", ">" + System.getenv("TARGET_APP_NAME") + "<")
}
if (line.contains("\"app_name_free\"") && System.getenv("TARGET_APP_NAME")) {
return line.replaceAll(">[^<]*<", ">" + System.getenv("TARGET_APP_NAME") + "<")
}
if (line.contains("\"app_edition\"") && System.getenv("APP_EDITION")) {
return line.replaceAll(">[^<]*<", ">" + System.getenv("APP_EDITION") + "<")
}
if (line.contains("\"versionFeatures\"") && System.getenv("APP_FEATURES")) {
return line.replaceAll(">[^<]*<", ">" + System.getenv("APP_FEATURES") + "<")
if (line.contains("\"versionFeatures\"")) {
return line.replaceAll(">[^<]*<", ">" + "" + "<")
}
return line;
}
@ -402,6 +278,8 @@ task collectExternalResources {
// Legacy core build
import org.apache.tools.ant.taskdefs.condition.Os
import java.util.regex.Pattern
task buildOsmAndCore(type: Exec) {
Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString().toLowerCase()
@ -452,11 +330,6 @@ afterEvaluate {
android.libraryVariants.all { variant ->
variant.javaCompiler.dependsOn(collectExternalResources, buildOsmAndCore, cleanupDuplicatesInCore)
}
Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString().toLowerCase()
if (tskReqStr.contains("huawei")) {
apply plugin: 'com.huawei.agconnect'
}
}
task appStart(type: Exec) {
@ -466,6 +339,27 @@ task appStart(type: Exec) {
// commandLine 'cmd', '/c', 'adb', 'shell', 'am', 'start', '-n', 'net.osmand.plus/net.osmand.plus.activities.MapActivity'
}
// Uploading artifacts to local path
group = "net.osmand"
uploadArchives {
repositories.ivy {
// credentials {
// username ""
// password ""
// }
url = "/Users/alexey/tmp/ivy";//System.getenv("OSMAND_BINARIES_IVY_ROOT") ?: "./"
layout "pattern" , {
artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
}
// def gitInfo = "git describe --long".execute().text.trim()
// def parsedGitInfo = Pattern.compile("v(\\d+\\.\\d+)-([\\d.]+)-(\\w+)").matcher(gitInfo)
// assert parsedGitInfo.matches()
// version = parsedGitInfo.group(1) + "-SNAPSHOT"
version = "1.0"
}
}
dependencies {
implementation project(path: ':OsmAnd-java', configuration: 'android')
implementation project(':OsmAnd-api')
@ -497,14 +391,14 @@ dependencies {
// implementation 'com.ibm.icu:icu4j:50.1'
// implementation 'net.sf.trove4j:trove4j:3.0.3'
qtcoreImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
qtcoredebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
// qtcoreImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
// qtcoredebugImplementation fileTree(include: ['QtAndroid.jar', 'QtAndroidBearer.jar'], dir: 'libs')
legacyImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@jar"
qtcoredebugImplementation "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar"
qtcoredebugImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
qtcoreImplementation "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar"
qtcoreImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
// qtcoredebugImplementation "net.osmand:OsmAndCore_androidNativeDebug:0.1-SNAPSHOT@aar"
// qtcoredebugImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
// qtcoreImplementation "net.osmand:OsmAndCore_androidNativeRelease:0.1-SNAPSHOT@aar"
// qtcoreImplementation "net.osmand:OsmAndCore_android:0.1-SNAPSHOT@aar"
implementation ("com.getkeepsafe.taptargetview:taptargetview:1.12.0"){
exclude group: 'com.android.support'
}
@ -516,6 +410,4 @@ dependencies {
exclude group: "com.fasterxml.jackson.core"
}
implementation 'com.jaredrummler:colorpicker:1.1.0'
//freehuaweiImplementation 'com.huawei.hms:iap:5.0.2.300'
}