继续浏览精彩内容
慕课网APP
程序员的梦工厂
打开
继续
感谢您的支持,我会继续努力的
赞赏金额会直接到老师账户
将二维码发送给自己后长按识别
微信支付
支付宝支付

Kotlin Android开发的基本配置

繁花如伊
关注TA
已关注
手记 227
粉丝 39
获赞 294

项目构建

app.gradle

apply plugin: 'com.android.application'apply plugin: 'kotlin-android'apply plugin: 'kotlin-android-extensions'android {    compileSdkVersion 25
    buildToolsVersion "25.0.3"
    defaultConfig {        applicationId "com.example.feint.kotlin_android_start"
        minSdkVersion 23
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {        release {            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
    testCompile 'junit:junit:4.12'//    androidTestImplementation 'com.android.support.test:runner:0.5'//    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2'}

build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {
    ext.kotlin_version = '1.1.3-2'
    repositories {//        google()//        jcenter()
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {    delete rootProject.buildDir
}

原文链接:http://www.apkbus.com/blog-822719-72357.html

打开App,阅读手记
0人推荐
发表评论
随时随地看视频慕课网APP