diff --git a/tools/kotlin-native-gradle-plugin/src/test/groovy/org/jetbrains/kotlin/gradle/plugin/test/IncrementalSpecification.groovy b/tools/kotlin-native-gradle-plugin/src/test/groovy/org/jetbrains/kotlin/gradle/plugin/test/IncrementalSpecification.groovy index 6a5f6897b8e..a4bb21b028a 100644 --- a/tools/kotlin-native-gradle-plugin/src/test/groovy/org/jetbrains/kotlin/gradle/plugin/test/IncrementalSpecification.groovy +++ b/tools/kotlin-native-gradle-plugin/src/test/groovy/org/jetbrains/kotlin/gradle/plugin/test/IncrementalSpecification.groovy @@ -116,8 +116,6 @@ class IncrementalSpecification extends Specification { "enableAssertions" | "enableAssertions()" "enableDebug" | "enableDebug true" "outputName" | "outputName 'foo'" - - } def 'inputFiles change for a compilation task should cause only recompilation'() { @@ -305,8 +303,13 @@ class IncrementalSpecification extends Specification { } else { throw new IllegalStateException("Unknown host platform") } + def project = KonanInteropProject.createEmpty(tmpFolder) { KonanInteropProject it -> + it.generateSrcFile('main.kt') + it.propertiesFile.append("konan.build.targets=all\n") + } - def results = buildTwiceEmpty { KonanInteropProject project -> + + def results = buildTwice(project) { KonanInteropProject it -> project.buildFile.append("konanArtifacts['main'].target '$newTarget'\n") project.buildFile.append("konanInterop['stdio'].target '$newTarget'\n") } @@ -315,8 +318,5 @@ class IncrementalSpecification extends Specification { recompilationAndInteropProcessingHappened(*results) } - //endregion } - - diff --git a/tools/kotlin-native-gradle-plugin/src/test/groovy/org/jetbrains/kotlin/gradle/plugin/test/PathSpecifiaction.groovy b/tools/kotlin-native-gradle-plugin/src/test/groovy/org/jetbrains/kotlin/gradle/plugin/test/PathSpecifiaction.groovy new file mode 100644 index 00000000000..a13b1ee39ca --- /dev/null +++ b/tools/kotlin-native-gradle-plugin/src/test/groovy/org/jetbrains/kotlin/gradle/plugin/test/PathSpecifiaction.groovy @@ -0,0 +1,32 @@ +package org.jetbrains.kotlin.gradle.plugin.test + +import org.junit.Rule +import org.junit.rules.TemporaryFolder +import spock.lang.Specification + + +class PathSpecification extends Specification { + @Rule + TemporaryFolder tmpFolder = new TemporaryFolder() + + def 'Plugin should create all necessary directories'() { + when: + def project = KonanInteropProject.create(tmpFolder) + def result = project.createRunner().withArguments('build').build() + + then: + def konan = "${tmpFolder.root}/build/konan" + new File("$konan/bin").listFiles().findAll { + File it -> it.file && it.name.matches('^main\\.[^.]+') + }.size() > 0 + def klib = new File("$konan/interopCompiledStubs/stdioInteropStubs/stdioInteropStubs.klib") + klib.exists() && klib.file + def stdioKt = new File("$konan/interopStubs/genStdioInteropStubs/stdio/stdio.kt") + stdioKt.exists() && stdioKt.file + def manifest = new File("$konan/interopStubs/genStdioInteropStubs/manifest.properties") + manifest.exists() && manifest.file + def nativeLib = new File("$konan/nativelibs/genStdioInteropStubs/stdiostubs.bc") + nativeLib.exists() && nativeLib.file + } + +}