前言
工作随笔,方便记起
控制
在工程的build.gradle文件中加入
allprojects {
repositories {
google()
jcenter()
}
def supportVersion = "27.1.0"
//版本控制
ext {
COMPILE_SDK_VERSION = 26
BUILD_TOOLS_VERSION = "27.0.0"
MIN_SDK_VERSION = 19
TARGET_SDK_VERSION = 26
libSupportAppcompat_v7 = "com.android.support:appcompat-v7:${supportVersion}"
libSupportAppcompat_v4 = "com.android.support:support-v4:${supportVersion}"
libSupportRecyclerView = "com.android.support:recyclerview-v7:${supportVersion}"
libSupportCardView = "com.android.support:cardview-v7:${supportVersion}"
libSupportDesign = "com.android.support:design:${supportVersion}"
libSupportAnnotations = "com.android.support:support-annotations:${supportVersion}"
}
}
使用
在工程Module的build.gradle文件中
apply plugin: 'com.android.application'
android {
compileSdkVersion COMPILE_SDK_VERSION
buildToolsVersion BUILD_TOOLS_VERSION
defaultConfig {
minSdkVersion MIN_SDK_VERSION
targetSdkVersion TARGET_SDK_VERSION
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile libSupportAppcompat_v7
compile libSupportAppcompat_v4
compile libSupportRecyclerView
}
网友评论