From 6c0853d49a8849d9a37211b6ed12ec368d8f0272 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 10 Apr 2019 00:33:05 +0200 Subject: [PATCH] kotlin support --- app/build.gradle | 7 +++++++ build.gradle | 2 ++ 2 files changed, 9 insertions(+) diff --git a/app/build.gradle b/app/build.gradle index 5cdb5bfd6a..8637ac27d8 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -10,6 +10,8 @@ buildscript { } } apply plugin: "com.android.application" +apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-android' apply plugin: 'com.google.gms.google-services' apply plugin: "io.fabric" apply plugin: "jacoco-android" @@ -27,6 +29,7 @@ ext { repositories { maven { url 'https://maven.fabric.io/public' } jcenter { url "https://jcenter.bintray.com/" } + mavenCentral() } def generateGitBuild = { -> @@ -75,6 +78,9 @@ android { moduleName "BleCommandUtil" } } + kotlinOptions { + jvmTarget = '1.8' + } lintOptions { // TODO remove once wear dependency com.google.android.gms:play-services-wearable:7.3.0 // has been upgraded (requiring significant code changes), which currently fails release @@ -233,6 +239,7 @@ dependencies { androidTestImplementation "org.mockito:mockito-core:2.8.47" androidTestImplementation "com.google.dexmaker:dexmaker:${dexmakerVersion}" androidTestImplementation "com.google.dexmaker:dexmaker-mockito:${dexmakerVersion}" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } task unzip(type: Copy) { diff --git a/build.gradle b/build.gradle index 57745d34ab..6826c29a13 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { + ext.kotlin_version = '1.3.21' repositories { google() jcenter() @@ -16,6 +17,7 @@ buildscript { // in the individual module build.gradle files classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } }