Skip to content

Commit 35c3d3f

Browse files
committed
Add Kotlin support
As Android team we've agreed to only use Kotlin for new code. Let's get the ball rolling for Notes too. Signed-off-by: Álvaro Brey <alvaro.brey@nextcloud.com>
1 parent cac2498 commit 35c3d3f

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: 'com.android.application'
2+
apply plugin: 'org.jetbrains.kotlin.android'
23

34
android {
45
compileSdkVersion 33
@@ -89,6 +90,7 @@ dependencies {
8990

9091
// Android X
9192
implementation 'androidx.appcompat:appcompat:1.6.0'
93+
implementation 'androidx.core:core-ktx:1.9.0'
9294
implementation 'androidx.core:core-splashscreen:1.0.0'
9395
implementation 'androidx.fragment:fragment:1.5.5'
9496
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'

build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4+
ext {
5+
kotlinVersion = '1.8.0'
6+
}
47
repositories {
58
mavenCentral()
69
google()
710
}
811
dependencies {
912
classpath 'com.android.tools.build:gradle:7.4.0'
13+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
1014

1115
// NOTE: Do not place your application dependencies here; they belong
1216
// in the individual module build.gradle files
@@ -19,10 +23,16 @@ allprojects {
1923
google()
2024
maven { url "https://jitpack.io" }
2125
}
26+
2227
}
2328

2429
subprojects {
2530
tasks.withType(Test) {
2631
maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1
2732
}
28-
}
33+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) {
34+
kotlinOptions {
35+
jvmTarget = "11"
36+
}
37+
}
38+
}

0 commit comments

Comments
 (0)