WasmToolsToolchainManagementDsl

DSL for selecting and configuring the WasmToolsToolchainService used by the whole build, exposed as toolchainManagement { wasmTools { ... } } in settings.gradle.kts by the org.jetbrains.kotlin.ecosystem plugin.

At most one of toolchainService or disable may be called - the WasmToolsToolchainService is registered as a shared org.gradle.api.services.BuildService right away, under the same name every Kotlin Gradle Plugin project looks up when it registers the toolchain service for itself, so calling this more than once would silently keep only the first registration.

kotlin {
toolchainManagement {
wasmTools {
toolchainService(MyWasmToolsToolchainService::class) { //specify a service class is optional, DefaultWasmToolsToolchainService will be used by default
}
toolchainService(DefaultWasmToolsToolchainService::class) {
downloadBaseUrl("custom-url") //official wasm-tools website will be used by default
installationDir("custom location") //default <user.home>/.kotlin/toolchains/wasm-tools location will be used by default
}
toolchainService(PreInstalledWasmToolsToolchainService::class) {
wasmToolsExecutable("path_to_wasm_tools_executable") //"wasm-tools" will be used by default
}
}
}
}

Note: This interface is not intended for implementation by build script or plugin authors.

Functions

Link copied to clipboard
open fun disable()

Disables wasm-tools provisioning for the whole build - tasks that need a wasm-tools executable will fail.

Link copied to clipboard

Configures the built-in, download-based DefaultWasmToolsToolchainService.

abstract fun <P : WasmToolsToolchainService.Parameters, T : WasmToolsToolchainService<P>> toolchainService(serviceClass: KClass<T>, configure: P.() -> Unit)

Selects serviceClass as the WasmToolsToolchainService used by the whole build, and configures its parameters.

open fun <P : WasmToolsToolchainService.Parameters, T : WasmToolsToolchainService<P>> toolchainService(serviceClass: KClass<T>, configure: Action<P>)

Action based version of toolchainService above.