Gradle: update gradle config

This commit is contained in:
zt515 2017-12-14 23:55:15 +08:00
parent 07d1d44c11
commit 548e0c6e72
3 changed files with 25 additions and 6 deletions

View File

@ -2,12 +2,12 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
android { android {
compileSdkVersion 26 compileSdkVersion rootProject.ext.android.COMPILE_SDK_VERSION
buildToolsVersion "26.0.2" buildToolsVersion rootProject.ext.android.BUILD_TOOL_VERSION
defaultConfig { defaultConfig {
applicationId "io.neoterm" applicationId "io.neoterm"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 26 targetSdkVersion rootProject.ext.android.TARGET_SDK_VERSION
versionCode 32 versionCode 32
versionName "2.0.0" versionName "2.0.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
@ -53,7 +53,7 @@ dependencies {
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" compile rootProject.ext.deps["kotlin-stdlib"]
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2' compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'org.greenrobot:eventbus:3.0.0' compile 'org.greenrobot:eventbus:3.0.0'

View File

@ -1,7 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules. // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript { buildscript {
ext.kotlin_version = '1.2.0'
ext.getGitHeadRefsSuffix = { ext.getGitHeadRefsSuffix = {
try { try {
def headFile = new File('.git/HEAD') def headFile = new File('.git/HEAD')
@ -22,6 +21,26 @@ buildscript {
return "" return ""
} }
ext.android = [
ANDROID_SUPPORT_VERSION: '27.0.2',
KOTLIN_VERSION : '1.2.0',
COMPILE_SDK_VERSION : 27,
TARGET_SDK_VERSION : 27,
BUILD_TOOL_VERSION : '27.0.2',
]
ext.deps =
[
"appcompat-v7": "com.android.support:appcompat-v7: ${ext.android.ANDROID_SUPPORT_VERSION}",
"design" : "com.android.support:design: ${ext.android.ANDROID_SUPPORT_VERSION}",
"cardview-v7" : "com.android.support:cardview-v7: ${ext.android.ANDROID_SUPPORT_VERSION}",
"kotlin-stdlib": "org.jetbrains.kotlin:kotlin-stdlib-jre7:${ext.android.KOTLIN_VERSION}"
]
repositories { repositories {
maven { url 'https://dl.google.com/dl/android/maven2/' } maven { url 'https://dl.google.com/dl/android/maven2/' }
@ -29,7 +48,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.0.1' classpath 'com.android.tools.build:gradle:3.0.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${rootProject.ext.android.KOTLIN_VERSION}"
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

0
config.gradle Normal file
View File