Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3b7d96f496
3 changed files with 82 additions and 51 deletions
1
OsmAnd/.gitignore
vendored
1
OsmAnd/.gitignore
vendored
|
@ -1,5 +1,6 @@
|
||||||
bin/
|
bin/
|
||||||
dist/
|
dist/
|
||||||
|
res/values/no_translate.xml
|
||||||
assets/specialphrases/*
|
assets/specialphrases/*
|
||||||
assets/voice/*
|
assets/voice/*
|
||||||
gen/
|
gen/
|
||||||
|
|
|
@ -1,23 +1,26 @@
|
||||||
apply plugin: 'com.android.application'
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
// Global Paramers accepted
|
||||||
|
// APK_NUMBER_VERSION - version number of apk
|
||||||
|
// APK_VERSION - version name like 2.1 (subsitute of app_version in no_translate.xml)
|
||||||
|
// APP_NAME - app name
|
||||||
|
// APP_EDITION - used for build numbers
|
||||||
|
// APP_FEATURES - features +play_market +gps_status -parking_plugin -blackberry -free_version -amazon
|
||||||
|
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
// 0. Update! OsmAndCore_wrapper for build ()
|
// 0. Update OsmAndCore_wrapper for build (implement )
|
||||||
// 1. no_translate.xml (versionFeatures, app.edition, build.version )
|
// 1. Filter fonts
|
||||||
// <condition>
|
|
||||||
// <isset property="versionFeatures" />
|
|
||||||
// </condition>
|
|
||||||
// <then>
|
|
||||||
// <replaceregexp file="res/values/no_translate.xml" match='versionFeatures">(.*)<
|
|
||||||
// replace='versionFeatures">${versionFeatures}<' byline="true" />
|
|
||||||
// 2. Filter fonts
|
|
||||||
// <unzip src="OsmAndCore_android.aar" dest=".">
|
// <unzip src="OsmAndCore_android.aar" dest=".">
|
||||||
// <patternset>
|
// <patternset>
|
||||||
// <include name="assets/**/map/fonts/OpenSans/*"/>
|
// <include name="assets/**/map/fonts/OpenSans/*"/>
|
||||||
// <include name="assets/**/map/fonts/NotoSans/*"/>
|
// <include name="assets/**/map/fonts/NotoSans/*"/>
|
||||||
// </patternset>
|
// </patternset>
|
||||||
// </unzip>
|
// </unzip>
|
||||||
// 3. fix_apostrophe_issues (replace match="[^=]([^\\])'" replace="\1\\\\'") res/**/strings.xml
|
// 2. fix_apostrophe_issues (replace match="[^=]([^\\])'" replace="\1\\\\'") res/**/strings.xml
|
||||||
// 4. sherpafy/free/paid
|
// 3. sherpafy/free/paid
|
||||||
|
// 4. Release signature
|
||||||
|
// 5. APP_NAME, APP_EDITION uses flavor
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 21
|
compileSdkVersion 21
|
||||||
|
@ -71,17 +74,18 @@ android {
|
||||||
aidl.srcDirs = ["src"]
|
aidl.srcDirs = ["src"]
|
||||||
java.srcDirs = [
|
java.srcDirs = [
|
||||||
"src",
|
"src",
|
||||||
fileTree(dir: "../OsmAnd-java/src", exclude: "**/PlatformUtil.java"),
|
fileTree(dir: "../OsmAnd-java/src", exclude: "**/PlatformUtil.java")
|
||||||
"resourcesSrc"
|
// "resourcesSrc"
|
||||||
]
|
]
|
||||||
resources.srcDirs = [
|
resources.srcDirs = [
|
||||||
"src",
|
"src"
|
||||||
"../OsmAnd-java/src",
|
// "../OsmAnd-java/src"
|
||||||
"resourcesSrc"
|
// "resourcesSrc"
|
||||||
]
|
]
|
||||||
renderscript.srcDirs = ["src"]
|
renderscript.srcDirs = ["src"]
|
||||||
res.srcDirs = [
|
res.srcDirs = [
|
||||||
"res"
|
'res'
|
||||||
|
|
||||||
]
|
]
|
||||||
assets.srcDirs = [
|
assets.srcDirs = [
|
||||||
'assets'
|
'assets'
|
||||||
|
@ -155,44 +159,42 @@ android {
|
||||||
signingConfig signingConfigs.publishing
|
signingConfig signingConfigs.publishing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def replaceNoTranslate(line) {
|
||||||
|
if(line.contains("\"app_name\"") && System.getenv("APP_NAME")) {
|
||||||
|
return line.replaceAll(">[^<]*<", " >"+System.getenv("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")+"<")
|
||||||
|
}
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
|
||||||
|
task updateNoTranslate(type: Copy) {
|
||||||
|
from('.') {
|
||||||
|
include 'no_translate.xml'
|
||||||
|
filter {
|
||||||
|
line -> replaceNoTranslate(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
into 'res/values/'
|
||||||
|
}
|
||||||
|
|
||||||
task collectVoiceAssets(type: Sync) {
|
task collectVoiceAssets(type: Sync) {
|
||||||
from "../../resources/voice"
|
from "../../resources/voice"
|
||||||
into "assets/voice"
|
into "assets/voice"
|
||||||
include "voice/**/*.p"
|
include "**/*.p"
|
||||||
}
|
}
|
||||||
|
|
||||||
task collectSpecialPhrasesAssets(type: Sync) {
|
task collectSpecialPhrasesAssets(type: Sync) {
|
||||||
from "../../resources/voice"
|
from "../../resources/specialphrases"
|
||||||
into "assets/specialphrases"
|
into "assets/specialphrases"
|
||||||
include "specialphrases/*.txt"
|
include "*.txt"
|
||||||
}
|
|
||||||
|
|
||||||
task collectRoutingResources(type: Sync) {
|
|
||||||
from "../../resources/routing"
|
|
||||||
into "resourcesSrc/net/osmand/router"
|
|
||||||
include "*.xml"
|
|
||||||
}
|
|
||||||
|
|
||||||
task collectRenderingStylesResources(type: Sync) {
|
|
||||||
from "../../resources/rendering_styles"
|
|
||||||
into "resourcesSrc/net/osmand/render"
|
|
||||||
include "*.xml"
|
|
||||||
}
|
|
||||||
|
|
||||||
task copyStyleIcons(type: Copy) {
|
|
||||||
from "../../resources/rendering_styles/style-icons/"
|
|
||||||
into "res/"
|
|
||||||
include "**/*.png"
|
|
||||||
}
|
|
||||||
|
|
||||||
task collectRegionsInfoResources(type: Copy) {
|
|
||||||
from "../../resources/countries-info"
|
|
||||||
into "resourcesSrc/net/osmand/map"
|
|
||||||
include "regions.ocbf"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
task collectHelpContentsAssets(type: Sync) {
|
task collectHelpContentsAssets(type: Sync) {
|
||||||
|
@ -206,17 +208,44 @@ task collectHelpContentsAssets(type: Sync) {
|
||||||
include "style.css"
|
include "style.css"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task collectRoutingResources(type: Sync) {
|
||||||
|
from "../../resources/routing"
|
||||||
|
into "src/net/osmand/router"
|
||||||
|
include "*.xml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
task collectMiscResources(type: Copy) {
|
task collectMiscResources(type: Copy) {
|
||||||
into "resourcesSrc/net/osmand/osm"
|
into "src/net/osmand/osm"
|
||||||
from("../../resources/obf_creation") {
|
from("../../resources/obf_creation") {
|
||||||
include "rendering_types.xml"
|
include "rendering_types.xml"
|
||||||
}
|
}
|
||||||
from("../../resources/poi") {
|
from("../../resources/poi") {
|
||||||
include "poi_types.xml"
|
include "poi_types.xml"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task collectRenderingStylesResources(type: Sync) {
|
||||||
|
from "../../resources/rendering_styles"
|
||||||
|
into "src/net/osmand/render"
|
||||||
|
include "*.xml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
task collectRegionsInfoResources(type: Copy) {
|
||||||
|
from "../../resources/countries-info"
|
||||||
|
into "src/net/osmand/map"
|
||||||
|
include "regions.ocbf"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
task copyStyleIcons(type: Copy) {
|
||||||
|
from "../../resources/rendering_styles/style-icons/"
|
||||||
|
into "res/"
|
||||||
|
include "**/*.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
task collectExternalResources << {}
|
task collectExternalResources << {}
|
||||||
collectExternalResources.dependsOn collectVoiceAssets,
|
collectExternalResources.dependsOn collectVoiceAssets,
|
||||||
collectSpecialPhrasesAssets,
|
collectSpecialPhrasesAssets,
|
||||||
|
@ -225,12 +254,14 @@ collectExternalResources.dependsOn collectVoiceAssets,
|
||||||
collectRenderingStylesResources,
|
collectRenderingStylesResources,
|
||||||
collectRegionsInfoResources,
|
collectRegionsInfoResources,
|
||||||
collectMiscResources,
|
collectMiscResources,
|
||||||
copyStyleIcons
|
copyStyleIcons,
|
||||||
|
updateNoTranslate
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
compileTask -> compileTask.dependsOn << collectExternalResources
|
compileTask -> compileTask.dependsOn << collectExternalResources
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
task downloadAAR {
|
task downloadAAR {
|
||||||
def f = new File("libs/OsmAndCore_wrapper.jar")
|
def f = new File("libs/OsmAndCore_wrapper.jar")
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
<resources>
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
<string name="app_name">OsmAnd~</string>
|
<string name="app_name">OsmAnd~</string>
|
||||||
<string name="app_name_ver">OsmAnd 2.0.0</string>
|
|
||||||
<string name="app_version">2.0.0</string>
|
<string name="app_version">2.0.0</string>
|
||||||
<!--
|
<!--
|
||||||
Note: For our dev build apk's, the above "app_version" is provided (via osmand/build.xml) as the base version prefix to our build number in the format:
|
Note: For our dev build apk's, the above "app_version" is provided (via osmand/build.xml) as the base version prefix to our build number in the format:
|
Loading…
Reference in a new issue