//引入插件
apply plugin: 'com.android.application' android {
compileSdkVersion 29
buildToolsVersion "29.0.0"
defaultConfig {
applicationId "com.example.myapplication"
minSdkVersion 28
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
} dependencies {
//implementation定义项目主源代码的依赖 //配置依赖libs目录下的所有jar包
implementation fileTree(dir: 'libs', include: ['*.jar'])
//配置从中央仓库下载依赖jar包
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
//testImplementation定义项目测试代码(test目录下的代码)的依赖
testImplementation 'junit:junit:4.12'
//androidTestImplementation定义androidTest目录下的代码依赖
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}