From 0e19a27e949f200ed96292e544317edf068e2957 Mon Sep 17 00:00:00 2001 From: Leonid Startsev Date: Mon, 15 Apr 2019 18:22:18 +0300 Subject: Add Dagger to dependencies to test integration with Kapt. Allow using UnstableDefault in tests. --- integration-test/build.gradle | 13 ++++++++++++- integration-test/settings.gradle | 4 ++++ integration-test/src/commonTest/kotlin/sample/JsonTest.kt | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'integration-test') diff --git a/integration-test/build.gradle b/integration-test/build.gradle index 196104c1..8209baf6 100644 --- a/integration-test/build.gradle +++ b/integration-test/build.gradle @@ -15,6 +15,7 @@ buildscript { plugins { id 'kotlin-multiplatform' id 'kotlinx-serialization' + id 'org.jetbrains.kotlin.kapt' } repositories { @@ -31,9 +32,9 @@ version '0.0.1' apply plugin: 'maven-publish' kotlin { - jvm() // Switching module kind for JS is required to run tests targets { + fromPreset(presets.jvmWithJava, 'jvm') fromPreset(presets.js, 'js') { configure([compilations.main, compilations.test]) { tasks.getByName(compileKotlinTaskName).kotlinOptions { @@ -66,6 +67,7 @@ kotlin { dependencies { implementation kotlin('stdlib-jdk8') implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:$serialization_version" + implementation 'com.google.dagger:dagger:2.13' } } jvmTest { @@ -93,6 +95,15 @@ kotlin { macosTest { } } + sourceSets.all { + languageSettings { + useExperimentalAnnotation('kotlin.Experimental') // annotation FQ-name + } + } +} + +dependencies { + kapt 'com.google.dagger:dagger-compiler:2.13' } apply from: rootProject.file('gradle/node-js.gradle') diff --git a/integration-test/settings.gradle b/integration-test/settings.gradle index 47db7f43..ab162487 100644 --- a/integration-test/settings.gradle +++ b/integration-test/settings.gradle @@ -4,6 +4,9 @@ pluginManagement { if (requested.id.id == "kotlin-multiplatform") { useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:$mainKotlinVersion") } + if (requested.id.id == "org.jetbrains.kotlin.kapt") { + useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:$mainKotlinVersion") + } if (requested.id.id == "kotlinx-serialization") { useModule("org.jetbrains.kotlin:kotlin-serialization:$mainKotlinVersion") } @@ -11,6 +14,7 @@ pluginManagement { } repositories { + mavenLocal() mavenCentral() jcenter() maven { url 'https://dl.bintray.com/kotlin/kotlin-dev' } diff --git a/integration-test/src/commonTest/kotlin/sample/JsonTest.kt b/integration-test/src/commonTest/kotlin/sample/JsonTest.kt index 00d3df50..919d6f32 100644 --- a/integration-test/src/commonTest/kotlin/sample/JsonTest.kt +++ b/integration-test/src/commonTest/kotlin/sample/JsonTest.kt @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@file:UseExperimental(UnstableDefault::class) package sample -- cgit v1.2.3