关于 kotlinForAndroid 和 lambda 的环境搭建

来源:互联网 发布:网络病毒软件下载 编辑:程序博客网 时间:2024/04/29 18:33

app: build.gradle

buildscript {    ext.support_version = '23.1.1'    ext.kotlin_version = '1.1.2'    ext.anko_version = '0.8.2'    repositories {        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:2.3.2'        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"    }}allprojects {    repositories {        jcenter()    }}task clean(type: Delete) {    delete rootProject.buildDir}


model :build.gradle

plugins {    //lambda    id "me.tatarka.retrolambda" version "3.2.4"}apply plugin: 'com.android.application'//butterknifeapply plugin: 'android-apt'//kotlinapply plugin: 'kotlin-android'apply plugin: 'kotlin-android-extensions'android {    compileSdkVersion 25    buildToolsVersion "25.0.3"    defaultConfig {        applicationId "com.tesiro.tesiro"        minSdkVersion 18        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'        }    }    //lambda    compileOptions {        targetCompatibility 1.8        sourceCompatibility 1.8    }}dependencies {    compile fileTree(include: ['*.jar'], dir: 'libs')    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {        exclude group: 'com.android.support', module: 'support-annotations'    })    compile 'com.android.support:appcompat-v7:25.3.1'    compile 'com.android.support.constraint:constraint-layout:1.0.2'    testCompile 'junit:junit:4.12'
    compile 'com.jakewharton:butterknife:8.1.0'    apt 'com.jakewharton:butterknife-compiler:8.1.0'//kotlin    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"}repositories {    mavenCentral()}


原创粉丝点击