Skip to content

Commit 1487407

Browse files
committed
Add Kotlin to the project
- Added the 'org.jetbrains.kotlin.android' plugin to all module build.gradle files and configured the Kotlin compiler JVM target to 1.8 in the root build.gradle. - Updated the buildscript to use Kotlin version 2.2.0 and included the Kotlin Gradle plugin classpath.
1 parent c447d32 commit 1487407

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

build.gradle

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
import java.time.Duration
21
import com.android.build.gradle.BaseExtension
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
34

45
// Top-level build file where you can add configuration options common to all sub-projects/modules.
56

67
buildscript {
8+
ext {
9+
kotlin_version = '2.2.0'
10+
}
711
repositories {
812
mavenCentral()
913
google()
@@ -14,6 +18,7 @@ buildscript {
1418
// For displaying method/field counts when building with Gradle:
1519
// https://github.com/KeepSafe/dexcount-gradle-plugin
1620
classpath("com.getkeepsafe.dexcount:dexcount-gradle-plugin:4.0.0")
21+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1722

1823
// NOTE: Do not place your application dependencies here; they belong
1924
// in the individual module build.gradle files
@@ -71,6 +76,11 @@ subprojects { subproject ->
7176
plugins.withId("com.android.library") {
7277
configureAndroidModule(subproject)
7378
}
79+
tasks.withType(KotlinCompile).configureEach {
80+
compilerOptions {
81+
jvmTarget = JvmTarget.JVM_1_8
82+
}
83+
}
7484
tasks.withType(JavaCompile).configureEach {
7585
// enable deprecation checks
7686
options.compilerArgs += "-Xlint:deprecation"

contract-tests/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id("com.android.application")
33
// make sure this line comes *after* you apply the Android plugin
44
id("com.getkeepsafe.dexcount")
5+
id 'org.jetbrains.kotlin.android'
56
}
67

78
android {

example/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ plugins {
22
id("com.android.application")
33
// make sure this line comes *after* you apply the Android plugin
44
id("com.getkeepsafe.dexcount")
5+
id 'org.jetbrains.kotlin.android'
56
}
67

78
android {

launchdarkly-android-client-sdk/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id("signing")
44
id("maven-publish")
55
id("com.getkeepsafe.dexcount")
6+
id 'org.jetbrains.kotlin.android'
67
}
78

89
group = "com.launchdarkly"

shared-test-code/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
21
plugins {
32
id("com.android.library")
43
id("com.getkeepsafe.dexcount")
4+
id 'org.jetbrains.kotlin.android'
55
}
66

77
group = "com.launchdarkly"

0 commit comments

Comments
 (0)