| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- apply plugin: 'com.android.application'
- Properties props = new Properties()
- props.load(new FileInputStream(file("signing.properties")))
- Properties serverProps = new Properties()
- def propFile = file('server_url.properties')
- def testApiUrl, proApiUrl
- if (propFile.canRead()) {
- serverProps.load(new FileInputStream(propFile))
- if (serverProps != null) {
- testApiUrl = serverProps['testApiUrl']
- proApiUrl = serverProps['proApiUrl']
- }
- }
- android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- buildToolsVersion rootProject.ext.buildToolsVersion
- defaultConfig {
- applicationId "com.webrain.happywork"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- multiDexEnabled true
- versionCode 117
- versionName "1.1.7"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- flavorDimensions "versionCode"
- ndk {
- abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "arm64-v8a", "x86_64"
- }
- }
- productFlavors {
- hwpro {
- applicationId "com.webrain.happywork"
- buildConfigField('String', 'VERIFY_URL', "\"http://cw.dal-pay.com/captcha/captcha?phone=\"")
- buildConfigField('int', 'PLATFORM_ID', "1")
- buildConfigField('String', 'baseApiUrl', proApiUrl)
- }
- hwtest {
- applicationId "com.webrain.happywork.test"
- buildConfigField('String', 'VERIFY_URL', "\"http://yz.hap-job.com/captcha/captcha?phone=\"")
- buildConfigField('int', 'PLATFORM_ID', "5")
- buildConfigField('String', 'baseApiUrl', testApiUrl)
- }
- }
- signingConfigs {
- debug {
- keyAlias props['KEY_ALIAS']
- keyPassword props['KEY_PASSWORD']
- storeFile file(props['KEYSTORE_FILE'])
- storePassword props['KEYSTORE_PASSWORD']
- }
- release {
- keyAlias props['KEY_ALIAS']
- keyPassword props['KEY_PASSWORD']
- storeFile file(props['KEYSTORE_FILE'])
- storePassword props['KEYSTORE_PASSWORD']
- }
- }
- //自动生成指定名称的release发布版的 apk文件
- android.applicationVariants.all { variant ->
- variant.outputs.all { output ->
- outputFileName = "happyWork_${variant.productFlavors[0].name}_${buildType.getName()}_${defaultConfig.versionName}.apk"
- }
- }
- buildTypes {
- release {
- //混淆
- minifyEnabled true
- //Zipalign优化
- zipAlignEnabled true
- // 移除无用的resource文件
- shrinkResources true
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- signingConfig signingConfigs.release
- }
- debug {
- signingConfig signingConfigs.release
- }
- }
- }
- dependencies {
- implementation fileTree(dir: 'libs', include: ['*.jar'])
- implementation project(':baselibrary')
- implementation 'com.jakewharton:butterknife:8.0.1'
- annotationProcessor 'com.jakewharton:butterknife-compiler:8.0.1'
- }
|