Skip to content

Commit f3858b2

Browse files
Add support for Kotlin in unit tests
1 parent d098bd7 commit f3858b2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

build.gradle

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1+
buildscript {
2+
ext.kotlin_version = '1.2.61'
3+
repositories {
4+
mavenCentral()
5+
}
6+
dependencies {
7+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
8+
}
9+
}
110
plugins {
211
id 'com.github.kt3k.coveralls' version '2.6.3'
312
id 'com.jfrog.bintray' version '1.7.3'
413
}
514

615
apply plugin: 'checkstyle'
16+
apply plugin: 'kotlin'
717
apply plugin: 'jacoco'
818
apply plugin: 'java-library'
919
apply plugin: 'maven'
@@ -25,6 +35,7 @@ dependencies {
2535
testImplementation 'junit:junit:4.12' // Testing
2636
testImplementation 'org.mockito:mockito-core:2.8.47' // Mocking
2737
testImplementation 'com.squareup.retrofit2:retrofit-mock:2.3.0' // Helpers for Retrofit
38+
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
2839

2940
compile 'com.squareup.okhttp3:okhttp:3.8.0' // Low-level HTTP client
3041
compile 'com.squareup.retrofit2:retrofit:2.3.0' // High-level HTTP client
@@ -35,7 +46,8 @@ dependencies {
3546
exclude group: 'com.google.code.findbugs', module: 'jsr305'
3647
})
3748

38-
compile 'io.reactivex.rxjava2:rxjava:2.1.2' // Observable pattern for async methods
49+
compile 'io.reactivex.rxjava2:rxjava:2.1.2'
50+
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" // Observable pattern for async methods
3951
}
4052

4153
javadoc {
@@ -150,3 +162,9 @@ jacocoTestReport {
150162
html.enabled = true
151163
}
152164
}
165+
166+
compileTestKotlin {
167+
kotlinOptions {
168+
jvmTarget = "1.8"
169+
}
170+
}

0 commit comments

Comments
 (0)