首页 > 移动平台 > 详细

下一代Android渠道打包工具

时间:2015-12-16 12:09:00      阅读:198      评论:0      收藏:0      [点我收藏+]

下一代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)

下一代Android渠道打包工具

原文:http://www.cnblogs.com/weidingqiang/p/5050672.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!