Skip to content

Commit

Permalink
Enable JS IR backend
Browse files Browse the repository at this point in the history
  • Loading branch information
arkivanov committed Mar 26, 2021
1 parent cba3858 commit 1a1b916
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ org.gradle.caching=true
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

kotlin.js.compiler=both
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import com.badoo.reaktive.dependencies.Deps
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.tasks.SourceSet
import org.jetbrains.kotlin.gradle.dsl.KotlinJsOptions
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
import org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile

@Suppress("UnstableApiUsage")
class JsPlugin : Plugin<Project> {
Expand Down Expand Up @@ -46,26 +44,9 @@ class JsPlugin : Plugin<Project> {
}
}
}
target.tasks.named(TASK_COMPILE_KOTLIN_JS, Kotlin2JsCompile::class.java) {
kotlinOptions.configure()
}
target.tasks.named(TASK_COMPILE_KOTLIN_JS_TEST, Kotlin2JsCompile::class.java) {
kotlinOptions.configure()
}
}

private fun KotlinJsOptions.configure() {
metaInfo = true
sourceMap = true
sourceMapEmbedSources = "always"
moduleKind = "umd"
main = "call"
}

companion object {
private const val TASK_COMPILE_KOTLIN_JS = "compileKotlinJs"
private const val TASK_COMPILE_KOTLIN_JS_TEST = "compileTestKotlinJs"

const val TARGET_NAME_JS = "js"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ import com.badoo.reaktive.single.Single
* @param assertSuccess when provided, it will be called in case of [Single] success.
* This gives an opportunity to assert the result.
*/
expect fun <T> Single<T>.testAwait(assertError: ((Throwable) -> Unit)? = null, assertSuccess: (T) -> Unit = {})
expect fun <T> Single<T>.testAwait(assertError: ((Throwable) -> Unit)? = null, assertSuccess: (T) -> Unit)

0 comments on commit 1a1b916

Please sign in to comment.