Build.gradle commonly used summary 1

1. Set the compiled version, name

android {
    
    
    compileSdkVersion 28
    buildToolsVersion "29.0.3"
    defaultConfig {
    
    
       
        versionCode 1
        versionName "name" + buildDate()
    }
}

2. Set the specified platform.keystore

    signingConfigs {
    
    
        mykey {
    
    
            storeFile file('../platform.keystore')
            storePassword 'android1'
            keyAlias = 'platform1'
            keyPassword 'android1'
        }
    }

    buildTypes {
    
    
        release {
    
    
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        noProguardTest {
    
    
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.mykey 
        }
        proguardTest {
    
    
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.mykey 
        }
        debug {
    
    
            testCoverageEnabled true
            signingConfig signingConfigs.mykey 
        }
    }

3. Introduce the specified jar package

implementation fileTree(include: '*.jar', dir: 'libs')
implementation files('libs/AMap_Location_V4.8.0_20191210.jar')

4. Speed ​​up the compilation step
, add
maven { url'http://maven.aliyun.com/nexus/content/groups/public '} to the outermost build.gradle

    repositories {
    
    
        google()
        maven {
    
    url 'http://maven.aliyun.com/nexus/content/groups/public'}
        jcenter()
        
    }

Guess you like

Origin blog.csdn.net/weixin_41477306/article/details/113486735