2015-01-15 3 views

ответ

0

1/ определить где-то в вашем приложении построить Gradle скрипт код версии, имя пакета:

def lVersionCode = 20 
def lApplicationId = 'com.xxx.android.app' 

2/ выбрать место для размещения файлов, которые будут находиться в файле расширения. В моем случае я создал этот один:

ExpansionFiles/SRC

3/ затем включить в приложение построить Gradle скрипт следующий код:

def destFile = new StringBuilder().append('main.') 
     .append(lVersionCode) 
     .append('.') 
     .append(lApplicationId) 
     .append('.zip') 
     .toString() 

task expansionFileZip(type: Zip) { 
    from('../../ExpansionFile/src') // Replace with your expansion file source 
    include '*.mp3' // Replace with the extension of the files 
    archiveName destFile // note that this specifies path *in* the archive 
    destinationDir file('build/outputs/apk') // directory that you want your archive to be placed in 
} 

4/ вызов Gradle expansionFileZip в той же папке, где находится ваш файл градиента сборки.

Смежные вопросы