Browse Source

多渠道打包完毕

FANGLH 8 years ago
parent
commit
00cc48aea0
2 changed files with 21 additions and 6 deletions
  1. 18 3
      WeiChat/build.gradle
  2. 3 3
      WeiChat/src/main/AndroidManifest.xml

+ 18 - 3
WeiChat/build.gradle

@@ -24,6 +24,10 @@ android {
         }
         multiDexEnabled true
         signingConfig signingConfigs.config
+
+        // 默认是umeng的渠道
+        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+        manifestPlaceholders = [UMENG_CHANNEL_VALUE: "umeng"]
     }
 
     useLibrary 'org.apache.http.legacy'
@@ -49,16 +53,27 @@ android {
         }
     }
     productFlavors {  // Gradle 多渠道打包
-        xiaomi {}
+        wandoujia {}
         _360 {}
         baidu {}
-        wandoujia {}
+        xiaomi {}
+        tencent {}
+        taobao {}
     }
 
     productFlavors.all {
         flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
     }
-
+    //给apk添加对应的版本号:这里暂时注释但保留
+//    applicationVariants.all { variant ->
+//        variant.outputs.each { output ->
+//            def outputFile = output.outputFile
+//            if (outputFile != null && outputFile.name.endsWith('.apk')) {
+//                def fileName = outputFile.name.replace(".apk", "-${defaultConfig.versionName}.apk")
+//                output.outputFile = new File(outputFile.parent, fileName)
+//            }
+//        }
+//    }
 
 }
 

+ 3 - 3
WeiChat/src/main/AndroidManifest.xml

@@ -2,8 +2,8 @@
 <manifest
     package="com.xzjmyk.pm.activity"
     xmlns:android="http://schemas.android.com/apk/res/android"
-    android:versionCode="111"
-    android:versionName="5.8.9">
+    android:versionCode="211"
+    android:versionName="6.8.9">
 
     <uses-sdk
         android:minSdkVersion="11"
@@ -127,7 +127,7 @@
         android:theme="@style/AppTheme">
         <meta-data
             android:name="UMENG_CHANNEL"
-            android:value="baidu"/>
+            android:value="${UMENG_CHANNEL_VALUE}"/>
         <!-- 启动页面 -->
         <activity android:name=".ui.SplashActivity">
             <intent-filter>