/* * Copyright 2017-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. */ apply plugin: 'kotlinx-atomicfu' apply plugin: 'kotlin-multiplatform' kotlin { // This flag is enabled to be able using JVM IR compiled dependencies (when build is ran with -Penable_jvm_ir) jvm() { compilations.all { kotlinOptions.freeCompilerArgs += '-Xallow-jvm-ir-dependencies' } } js() sourceSets { commonMain.dependencies { implementation 'org.jetbrains.kotlin:kotlin-stdlib-common' compileOnly atomicfuMetadata } commonTest.dependencies { implementation 'org.jetbrains.kotlin:kotlin-test-common' implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common' runtimeOnly atomicfuMetadata } jsMain.dependencies { implementation 'org.jetbrains.kotlin:kotlin-stdlib-js' compileOnly atomicfuJs } jsTest.dependencies { implementation 'org.jetbrains.kotlin:kotlin-test-js' runtimeOnly atomicfuJs } jvmMain.dependencies { implementation 'org.jetbrains.kotlin:kotlin-stdlib' compileOnly atomicfuJvm } jvmTest.dependencies { implementation 'org.jetbrains.kotlin:kotlin-test' implementation 'org.jetbrains.kotlin:kotlin-test-junit' implementation "junit:junit:4.12" runtimeOnly atomicfuJvm } } } def File classpathFile(String platform, String fileName) { def dir = file("$buildDir/classpath/$platform") dir.mkdirs() return file("$dir/$fileName") } compileTestKotlinJvm.doLast { classpathFile("jvm", "test_compile.txt").text = classpath.files.join("\n") } jvmTest.doLast { classpathFile("jvm", "test_runtime.txt").text = classpath.files.join("\n") } compileTestKotlinJs.doLast { classpathFile("js", "test_compile.txt").text = classpath.files.join("\n") } jsTest.dependsOn(":compileTestKotlinJs") jsTest.dependsOn(":transformJsTestAtomicfu") check.dependsOn(":jsTest")