1/* 2 * Copyright 2017-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 5apply plugin: 'kotlinx-atomicfu' 6apply plugin: 'kotlin-multiplatform' 7 8kotlin { 9 // This flag is enabled to be able using JVM IR compiled dependencies (when build is ran with -Penable_jvm_ir) 10 jvm() { 11 compilations.all { 12 kotlinOptions.freeCompilerArgs += '-Xallow-jvm-ir-dependencies' 13 } 14 } 15 js() 16 17 sourceSets { 18 commonMain.dependencies { 19 implementation 'org.jetbrains.kotlin:kotlin-stdlib-common' 20 compileOnly atomicfuMetadata 21 22 } 23 commonTest.dependencies { 24 implementation 'org.jetbrains.kotlin:kotlin-test-common' 25 implementation 'org.jetbrains.kotlin:kotlin-test-annotations-common' 26 runtimeOnly atomicfuMetadata 27 28 } 29 jsMain.dependencies { 30 implementation 'org.jetbrains.kotlin:kotlin-stdlib-js' 31 compileOnly atomicfuJs 32 33 } 34 jsTest.dependencies { 35 implementation 'org.jetbrains.kotlin:kotlin-test-js' 36 runtimeOnly atomicfuJs 37 } 38 jvmMain.dependencies { 39 implementation 'org.jetbrains.kotlin:kotlin-stdlib' 40 compileOnly atomicfuJvm 41 } 42 jvmTest.dependencies { 43 implementation 'org.jetbrains.kotlin:kotlin-test' 44 implementation 'org.jetbrains.kotlin:kotlin-test-junit' 45 implementation "junit:junit:4.12" 46 runtimeOnly atomicfuJvm 47 } 48 } 49} 50 51def File classpathFile(String platform, String fileName) { 52 def dir = file("$buildDir/classpath/$platform") 53 dir.mkdirs() 54 return file("$dir/$fileName") 55} 56 57 58compileTestKotlinJvm.doLast { 59 classpathFile("jvm", "test_compile.txt").text = classpath.files.join("\n") 60} 61 62jvmTest.doLast { 63 classpathFile("jvm", "test_runtime.txt").text = classpath.files.join("\n") 64} 65 66 67compileTestKotlinJs.doLast { 68 classpathFile("js", "test_compile.txt").text = classpath.files.join("\n") 69} 70 71jsTest.dependsOn(":compileTestKotlinJs") 72jsTest.dependsOn(":transformJsTestAtomicfu") 73check.dependsOn(":jsTest")