Skip to content

Commit

Permalink
Merge branch 'feature/GH-57-ksp' into feature/objc-swift-refined
Browse files Browse the repository at this point in the history
  • Loading branch information
rickclephas committed Sep 3, 2022
2 parents 14b3195 + 8a89da5 commit d3bd8a9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
15 changes: 15 additions & 0 deletions kmp-nativecoroutines-ksp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
@Suppress("DSL_SCOPE_VIOLATION")
alias(libs.plugins.kotlin.jvm)
`kmp-nativecoroutines-publish`
}

dependencies {
Expand All @@ -19,3 +20,17 @@ tasks.compileKotlin.configure {
freeCompilerArgs = listOf("-Xjvm-default=all")
}
}

val sourcesJar by tasks.registering(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}

publishing {
publications {
create<MavenPublication>("maven") {
from(components["kotlin"])
artifact(sourcesJar)
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package com.rickclephas.kmp.nativecoroutines.ksp

import com.tschuchort.compiletesting.KotlinCompilation
import com.tschuchort.compiletesting.SourceFile
import com.tschuchort.compiletesting.kspSourcesDir
import com.tschuchort.compiletesting.symbolProcessorProviders
import com.tschuchort.compiletesting.*
import org.intellij.lang.annotations.Language
import org.junit.Rule
import org.junit.rules.TemporaryFolder
Expand All @@ -16,13 +13,15 @@ open class CompilationTests {

protected fun runKspTest(
@Language("kotlin") inputContent: String,
@Language("kotlin") outputContent: String
@Language("kotlin") outputContent: String,
kspArgs: Map<String, String> = mapOf("nativeCoroutines.suffix" to "Native")
) {
KotlinCompilation().apply {
workingDir = temporaryFolder.root
sources = listOf(SourceFile.new("Source.kt", "package test\n\n$inputContent"))
inheritClassPath = true
symbolProcessorProviders = listOf(KmpNativeCoroutinesSymbolProcessorProvider())
this.kspArgs += kspArgs
assertCompile()
assertKspSourceFile("test/SourceNative.kt", "package test\n\n$outputContent")
}
Expand Down

0 comments on commit d3bd8a9

Please sign in to comment.