Android Gradle 基础认识

来源:互联网 发布:win7cf网络出现异常 编辑:程序博客网 时间:2024/06/06 07:40

项目全局的Gradle

buildscript {    repositories {        jcenter()    }    dependencies {    //指定以来的Gradle版本        classpath 'com.android.tools.build:gradle:2.2.2'        // NOTE: Do not place your application dependencies here; they belong        // in the individual module build.gradle files    }}allprojects {    repositories {    //制定Gradle的代码仓库        jcenter()    }}

Model gradle

//表示这个model是一个Android Application,这包括了Android项目所用到的所有工具apply plugin: 'com.android.application'//表示该model构建过程中所用到的所有参数,android {    //SDK版本    compileSdkVersion 23    //Android build tools版本    buildToolsVersion "23.0.3"    defaultConfig {        applicationId "com.pp.fanqie"        minSdkVersion 14        targetSdkVersion 23        versionCode 1        versionName "1.0"        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'        }    }}//表示Android model构建中所用到的依赖库dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {        exclude group: 'com.android.support', module: 'support-annotations'    })    testCompile 'junit:junit:4.12'}

local.properties

这里配置了Android Gradle插件所使用的Android SDK路径。

0 0
原创粉丝点击