Blame view

XPadAppRD/app/build.gradle 2.83 KB
3ae7ffc5   孙向锦   project init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
  apply plugin: 'com.android.application'
  
  
  def buildTime() {
      def date = new Date()
      def formattedDate = date.format('yyyyMMdd')
      return formattedDate
  }
  
  
  android {
      compileSdkVersion 26
      buildToolsVersion "26.0.2"
      defaultConfig {
          minSdkVersion 21
          targetSdkVersion 26
          applicationId "com.sunvote.xpadapp"
  
          ndk {
              abiFilters "armeabi-v7a"
              abiFilters "x86"
              abiFilters "armeabi"
              abiFilters "arm64-v8a"
              abiFilters "x86_64"
          }
      }
  //    signingConfigs {
  //        release {
  //            // 此处是相对路径,可以在module app下新建一个key文件夹把keystore文件拷贝进去
  //            storeFile file('key/xpad.keystore')
  //        }
  //        debug {
  //            storeFile file('key/debug.keystore')
  //        }
  //    }
      buildTypes {
          release {
              minifyEnabled false
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
  
              //Zipalign优化
              zipAlignEnabled true
  
              // 移除无用的resource文件
  //            shrinkResources true
  
              applicationVariants.all { variant ->
                  variant.outputs.each { output ->
                      if (output.outputFile != null && output.outputFile.name.endsWith('.apk')) {
                          System.out.println("apk filename${output.outputFile.name}")
                          def apkFile = new File(
                                  output.outputFile.getParent(),
                                  "会议表决系统${variant.flavorName}_v${variant.versionName}_${buildTime()}.apk")
                          output.outputFile.renameTo(apkFile)
                      }
                  }
              }
          }
          debug {
              debuggable true
          }
      }
  //    externalNativeBuild {
  //        cmake {
  //            path 'CMakeLists.txt'
  //        }
  //    }
      productFlavors {
      }
  
  }
  
  repositories   {
  
      flatDir {
          dirs 'libs'
      }
  }
  
  dependencies {
      compile 'com.android.support:appcompat-v7:23.4.0'
      compile 'com.android.support:support-v4:23.4.0'
      compile files('libs/ant.jar')
      compile project(':udpmodule')
      compile project(':xpadprotocal')
      compile(name: 'ycanfilereadfunc-release', ext: 'aar')
      compile(name: 'ycanreaderfileshow-release', ext: 'aar')
      compile(name: 'ycan-release', ext: 'aar')
      compile 'com.bm.photoview:library:1.4.1'
      compile 'com.github.barteksc:android-pdf-viewer:2.7.0'
      compile 'cn.yipianfengye.android:zxing-library:2.2'
      compile 'com.jaredrummler:android-processes:1.1.1'
  }
  
  //#解决某些输入文件使用或覆盖了已过时的 API
  allprojects {
      gradle.projectsEvaluated {
          tasks.withType(JavaCompile) {
              options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
          }
      }
  }