Gradle - how to specify different Android *.apk build location for each flavor? -
is there way specify android *.apk files build location other ../build/apk/ ? possible specify different location each flavour?
i using android studio.
thats work me:
android.applicationvariants.all { variant -> def outputname = // filename variant.outputfile = file(path_to_filename) }
but "clean" task not drop apk, should extend clean task below:
task cleanextra(type: delete) { delete outputpathname } clean.dependson(cleanextra)
full sample:
apply plugin: 'android' def outputpathname = "d:\\some.apk" android { compilesdkversion 19 buildtoolsversion "19.0.3" defaultconfig { minsdkversion 8 targetsdkversion 19 versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } applicationvariants.all { variant -> variant.outputfile = file(outputpathname) } } dependencies { compile 'com.android.support:appcompat-v7:19.+' compile filetree(dir: 'libs', include: ['*.jar']) } task cleanextra(type: delete) { delete outputpathname } clean.dependson(cleanextra)
Comments
Post a Comment