| /* |
| * Copyright 2017-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
| */ |
| buildscript { |
| ext.serialization_version = mainLibVersion |
| |
| repositories { |
| mavenLocal() |
| mavenCentral() |
| maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" } |
| } |
| } |
| |
| // see ../settings.gradle so this plugins could be resolved |
| plugins { |
| id 'kotlin-multiplatform' |
| id 'kotlinx-serialization' |
| id 'org.jetbrains.kotlin.kapt' |
| } |
| |
| repositories { |
| mavenLocal() |
| mavenCentral() |
| maven { url "https://cache-redirector.jetbrains.com/maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" } |
| } |
| |
| group 'com.example' |
| version '0.0.1' |
| |
| apply plugin: 'maven-publish' |
| |
| kotlin { |
| // Switching module kind for JS is required to run tests |
| js { |
| nodejs {} |
| configure([compilations.main, compilations.test]) { |
| kotlinOptions { |
| sourceMap = true |
| moduleKind = "umd" |
| metaInfo = true |
| } |
| } |
| } |
| jvm { |
| withJava() |
| } |
| // For ARM, should be changed to iosArm32 or iosArm64 |
| // For Linux, should be changed to e.g. linuxX64 |
| // For MacOS, should be changed to e.g. macosX64 |
| // For Windows, should be changed to e.g. mingwX64 |
| macosX64("macos") |
| linuxX64("linux") |
| sourceSets { |
| commonMain { |
| dependencies { |
| implementation kotlin('stdlib-common') |
| implementation "org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization_version" |
| implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization_version" |
| implementation "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$serialization_version" |
| implementation "org.jetbrains.kotlinx:kotlinx-serialization-cbor:$serialization_version" |
| } |
| } |
| commonTest { |
| dependencies { |
| implementation kotlin('test-common') |
| implementation kotlin('test-annotations-common') |
| } |
| } |
| jvmMain { |
| dependencies { |
| implementation kotlin('stdlib-jdk8') |
| implementation 'com.google.dagger:dagger:2.13' |
| } |
| } |
| jvmTest { |
| dependencies { |
| implementation kotlin('test') |
| implementation kotlin('test-junit') |
| } |
| } |
| jsMain { |
| dependencies { |
| implementation kotlin('stdlib-js') |
| |
| } |
| } |
| jsTest { |
| dependencies { |
| implementation kotlin('test-js') |
| } |
| } |
| macosMain { |
| dependencies { |
| } |
| } |
| macosTest {} |
| linuxMain { |
| kotlin.srcDirs = ["src/macosMain/kotlin"] |
| } |
| linuxTest { |
| kotlin.srcDirs = ["src/macosTest/kotlin"] |
| } |
| } |
| sourceSets.all { |
| languageSettings { |
| useExperimentalAnnotation('kotlin.Experimental') // annotation FQ-name |
| } |
| } |
| } |
| |
| dependencies { |
| kapt 'com.google.dagger:dagger-compiler:2.13' |
| } |
| |
| task run dependsOn "check" |