[android] Moved list of files to include in obb to gradle.properties; added old obb removal to obbPush task.

This commit is contained in:
Dmitry Yunitsky 2015-11-13 13:53:52 +03:00
parent 6ca22db1b6
commit 85bb232656
2 changed files with 21 additions and 25 deletions

View file

@ -324,7 +324,7 @@ tasks.withType(JavaCompile) { compileTask ->
clean.dependsOn ndkBuildClean
// Cleans built native static libs.
task cppClean(type: Delete) {
task cppClean(type: Delete) << {
buildTypes.each { type ->
archs.each { arch ->
delete "../../omim-android-${type.cppType}-${arch}"
@ -333,27 +333,18 @@ task cppClean(type: Delete) {
}
// Tasks for generating obb files for Google Play
task obbClean(type: Delete) {
task obbClean(type: Delete) << {
delete fileTree(dir: 'build', include: '**/*.obb')
}
def fonts = ['../data/01_dejavusans.ttf',
'../data/02_droidsans-fallback.ttf',
'../data/03_jomolhari-id-a3d.ttf',
'../data/04_padauk.ttf',
'../data/05_khmeros.ttf',
'../data/06_code2000.ttf']
def worlds = ['../data/World.mwm', '../data/WorldCoasts.mwm']
def rawFonts = 'build/fonts.obb'
def rawWorlds = 'build/worlds.obb'
def alignedFonts = 'build/worlds_aligned.obb'
def alignedWorlds = 'build/fonts_aligned.obb'
def rawFonts = 'build/fonts_unaligned.obb'
def rawWorlds = 'build/worlds_unaligned.obb'
def alignedFonts = 'build/worlds.obb'
def alignedWorlds = 'build/fonts.obb'
task obbGenerate() {
createObbGenerateTask('Main', fonts, rawFonts)
createObbGenerateTask('Patch', worlds, rawWorlds)
createObbGenerateTask('Main', propObbFonts.split(' '), rawFonts)
createObbGenerateTask('Patch', propObbWorlds.split(' '), rawWorlds)
createObbAlignTask('Main', rawFonts, alignedWorlds)
createObbAlignTask('Patch', rawWorlds, alignedFonts)
}
@ -377,14 +368,14 @@ def createObbAlignTask(type, rawObb, alignedObb) {
}
task obbPush(dependsOn: ['obbGenerate', 'obbPushMain', 'obbPushPatch']) {
tasks.create(type: Exec, name: 'obbPushMain') {
commandLine android.getAdbExe(), 'push', alignedFonts, obbGetFullPath('main')
def obbPath = "/mnt/sdcard/Android/obb/${project.ext.appId}/"
tasks.create(type: Exec, name: 'obbRemoveOnDevice') {
commandLine android.getAdbExe(), 'shell', 'rm', "${obbPath}*.obb"
}
tasks.create(type: Exec, name: 'obbPushPatch') {
commandLine android.getAdbExe(), 'push', alignedWorlds, obbGetFullPath('patch')
tasks.create(type: Exec, name: 'obbPushMain', dependsOn: 'obbRemoveOnDevice') {
commandLine android.getAdbExe(), 'push', alignedFonts, "${obbPath}fonts.obb"
}
tasks.create(type: Exec, name: 'obbPushPatch', dependsOn: 'obbRemoveOnDevice') {
commandLine android.getAdbExe(), 'push', alignedWorlds, "${obbPath}worlds.obb"
}
}
def obbGetFullPath(name) {
return "/mnt/sdcard/Android/obb/${project.ext.appId}/${name}.obb"
}

View file

@ -7,3 +7,8 @@ propVersionCode=515
propVersionName=5.1.5
propDebugNdkFlags=V=1 NDK_DEBUG=1 DEBUG=1
propReleaseNdkFlags=V=1 NDK_DEBUG=0 PRODUCTION=1
# list of files for obb-s
propObbFonts ../data/01_dejavusans.ttf ../data/02_droidsans-fallback.ttf ../data/03_jomolhari-id-a3d.ttf \
../data/04_padauk.ttf ../data/05_khmeros.ttf ../data/06_code2000.ttf
propObbWorlds ../data/World.mwm ../data/WorldCoasts.mwm