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 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264
| apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt'
android { compileSdkVersion build_versions.target_sdk buildToolsVersion build_versions.build_tools_sdk
defaultConfig { applicationId "com.wangmh.mhproject" minSdkVersion build_versions.min_sdk targetSdkVersion build_versions.target_sdk versionCode build_versions.version_code versionName build_versions.version_name
multiDexEnabled true
buildConfigField "String", "GIT_SHA", "\"${commitSha()}\"" buildConfigField "String", "BUILD_DATE", "\"${buildDate()}\""
sourceSets { main { jniLibs.srcDirs = ['libs'] } }
ndk { abiFilters 'armeabi' }
android.applicationVariants.all { variant -> renameAPK(variant, defaultConfig) }
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" }
signingConfigs { debug {
}
}
flavorDimensions "default"
androidExtensions { experimental = true }
dexOptions { javaMaxHeapSize "4g" }
compileOptions { sourceCompatibility build_versions.jvmTarget targetCompatibility build_versions.jvmTarget } kotlinOptions { jvmTarget = build_versions.jvmTarget }
}
dependencies { implementation deps.kotlin.stdlib implementation deps.x.multidex implementation deps.x.design implementation deps.x.android_ktx implementation deps.x.app_compat implementation deps.x.recyclerview implementation deps.x.constraintlayout implementation deps.x.viewpager2
implementation deps.dagger.runtime kapt deps.dagger.compiler implementation deps.dagger.android implementation deps.dagger.android_support kapt deps.dagger.android_processor
implementation deps.rx.java implementation deps.rx.kotlin implementation deps.rx.android
implementation deps.autodispose.runtime implementation deps.autodispose.lifecycle
implementation deps.autodispose.android
implementation deps.autodispose.android_arch
implementation deps.okio implementation deps.okhttp.runtime implementation deps.okhttp.logging_interceptor
implementation deps.retrofit.runtime implementation deps.retrofit.adapter_rxjava implementation deps.retrofit.converter_moshi
implementation deps.timber
implementation deps.lifecycle.runtime implementation deps.lifecycle.extensions implementation deps.lifecycle.java8 kapt deps.lifecycle.compiler
implementation deps.moshi.runtime kapt deps.moshi.kotlin_codegen
implementation deps.xcodescanner
implementation deps.amap.map implementation deps.amap.location
implementation deps.autosize
implementation deps.rxpermissions
implementation deps.recyclerviewadapter
implementation deps.smartrefresh.layout implementation deps.smartrefresh.header
implementation deps.pickerview
implementation 'com.yanzhenjie:permission:1.0.8' implementation fileTree(include: ['*.jar'], dir: 'libs') implementation deps.qrcode_zxing
implementation deps.glide.glide kapt deps.glide.compiler
implementation deps.numberbutton implementation deps.androidutilcode
implementation project(':baseLib') implementation project(':mainLib') implementation project(':userLib') }
def commitSha() { def value = '' try { def git = new File(project.rootDir, ".git") def head = new File(git, "HEAD") def ref = new File(git, head.text .replace("\n", "") .split(" ")[1]) value = ref.text.substring(0, 7)
} catch (Exception e) { e.printStackTrace() } return value }
static def buildDate() { return new Date().format("yyyy-MM-dd") }
def renameAPK(variant, defaultConfig) { variant.outputs.all { output -> def applicationName = "youxuan_helper" applicationName += "_${variant.buildType.name}" def formattedDate = new Date().format('yyyyMMdd') def fileName = applicationName + "_v" + defaultConfig.versionName + "_" + formattedDate + ".apk" outputFileName = fileName } }
|