您的位置:首页 > 移动开发 > Android开发

下一代Android渠道打包工具

2015-12-16 11:49 323 查看
下一代Android渠道打包工具 https://github.com/mcxiaoke/packer-ng-plugin

另一个地址 http://www.open-open.com/lib/view/open1440248204395.html
apply plugin: 'com.android.application'

apply plugin: 'packer'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.weidingqiang.customnetroid"
minSdkVersion 17
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
//    buildTypes {
//        release {
//            minifyEnabled false
//            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//        }
//    }

signingConfigs {
release {
storeFile file("key.jks")
storePassword "123456"
keyAlias "hello"
keyPassword "123456"
}
}

buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
}

beta {
signingConfig signingConfigs.release
minifyEnabled false
debuggable true
}

}
}

packer {    // 指定渠道打包输出目录

// archiveOutput = file(new File(project.rootProject.buildDir.path, "archives"))
// 指定渠道打包输出文件名格式
archiveNameFormat = '${flavorName}-v${versionName}-${versionCode}-${buildTime}'
//appPkg = ''
// 指定渠道打包需要修改的AndroidManifest文件项
//manifestMatcher = ['UMENG_CHANNEL','Google_Play']

}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.duowan.android.netroid:netroid:1.2.1'

compile 'com.mcxiaoke.gradle:packer-helper:1.0.2'
}


配置完成后 配合友盟使用即可

在友盟中

如不想在manifest里配置友盟的channel,

可在Activity中配置:只需在程序启动时的Activity中调用此接口:

AnalyticsConfig.setChannel(String channel)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: