diff --git a/CHANGELOG.md b/CHANGELOG.md index c0ddd0d2f1..2be6e8a8ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## Unreleased + * New: "compile" subcommand in 'zipline-cli' compiles `.js` files to `.zipline` files. + ## [1.17.0] - 2024-08-28 [1.17.0]: https://github.com/cashapp/zipline/releases/tag/1.17.0 diff --git a/zipline-cli/build.gradle.kts b/zipline-cli/build.gradle.kts index e58d48df46..aa38f23cb3 100644 --- a/zipline-cli/build.gradle.kts +++ b/zipline-cli/build.gradle.kts @@ -38,16 +38,19 @@ artifacts { kotlin { sourceSets { all { + languageSettings.optIn("app.cash.zipline.EngineApi") languageSettings.optIn("kotlinx.serialization.ExperimentalSerializationApi") } } } dependencies { - api(projects.ziplineApiValidator) - api(projects.ziplineLoader) + implementation(projects.ziplineApiValidator) + implementation(projects.ziplineBytecode) + implementation(projects.ziplineLoader) implementation(libs.clikt) implementation(libs.okHttp.core) + implementation(libs.kotlinx.serialization.json) testImplementation(projects.ziplineLoaderTesting) testImplementation(libs.assertk) diff --git a/zipline-cli/src/main/kotlin/app/cash/zipline/cli/Compile.kt b/zipline-cli/src/main/kotlin/app/cash/zipline/cli/Compile.kt new file mode 100644 index 0000000000..5df3871c2a --- /dev/null +++ b/zipline-cli/src/main/kotlin/app/cash/zipline/cli/Compile.kt @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2024 Cash App + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package app.cash.zipline.cli + +import app.cash.zipline.loader.ManifestSigner +import app.cash.zipline.loader.SignatureAlgorithmId +import com.github.ajalt.clikt.core.CliktCommand +import com.github.ajalt.clikt.parameters.options.associate +import com.github.ajalt.clikt.parameters.options.convert +import com.github.ajalt.clikt.parameters.options.flag +import com.github.ajalt.clikt.parameters.options.help +import com.github.ajalt.clikt.parameters.options.multiple +import com.github.ajalt.clikt.parameters.options.option +import com.github.ajalt.clikt.parameters.options.required +import com.github.ajalt.clikt.parameters.types.file +import okio.ByteString.Companion.decodeHex + +internal class Compile : CliktCommand( + name = "compile", + help = "Compile .js files to .zipline files", +) { + private val inputDir by option("--input").file().required() + .help("Directory from which .js files will be loaded.") + + private val outputDir by option("--output").file().required() + .help("Directory into which .zipline files will be written.") + + private val addedFiles by option("--added").file().multiple() + .help("Input files added since the last compile. This will trigger incremental compilation.") + private val removedFiles by option("--removed").file().multiple() + .help("Input files removed since the last compile. This will trigger incremental compilation.") + private val modifiedFiles by option("--modified").file().multiple() + .help("Input files modified since the last compile. This will trigger incremental compilation.") + + private val mainFunction by option() + private val mainModuleId by option() + private val version by option() + private val stripLineNumbers by option().flag() + + private val signatures by option("--signature") + .help( + """ + |Signature to sign outputs. + | + |Format: "id:name:key" where 'id' is one of ${SignatureAlgorithmId.entries} and 'key' is a hex-encoded private key. + """.trimMargin(), + ) + .convert { + val (idName, name, keyHex) = it.split(':', limit = 3) + val id = SignatureAlgorithmId.valueOf(idName) + val key = keyHex.decodeHex() + Triple(id, name, key) + } + .multiple() + + private val metadata by option().associate() + + override fun run() { + val manifestSigner = if (signatures.isEmpty()) { + null + } else { + ManifestSigner.Builder() + .apply { + for ((id, name, key) in signatures) { + add(id, name, key) + } + } + .build() + } + + val compiler = ZiplineCompiler( + outputDir = outputDir, + mainFunction = mainFunction, + mainModuleId = mainModuleId, + manifestSigner = manifestSigner, + version = version, + metadata = metadata, + stripLineNumbers = stripLineNumbers, + ) + + if (addedFiles.size or removedFiles.size or modifiedFiles.size != 0) { + compiler.incrementalCompile( + modifiedFiles = modifiedFiles, + addedFiles = addedFiles, + removedFiles = removedFiles, + ) + } else { + compiler.compile(inputDir) + } + } +} diff --git a/zipline-cli/src/main/kotlin/app/cash/zipline/cli/Main.kt b/zipline-cli/src/main/kotlin/app/cash/zipline/cli/Main.kt index 478279b14f..410d45c6ed 100644 --- a/zipline-cli/src/main/kotlin/app/cash/zipline/cli/Main.kt +++ b/zipline-cli/src/main/kotlin/app/cash/zipline/cli/Main.kt @@ -30,6 +30,7 @@ fun main(vararg args: String) { NoOpCliktCommand() .subcommands( + Compile(), Download(), GenerateKeyPair(), ValidateZiplineApi(NAME_CHECK), diff --git a/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplineCompiler.kt b/zipline-cli/src/main/kotlin/app/cash/zipline/cli/ZiplineCompiler.kt similarity index 99% rename from zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplineCompiler.kt rename to zipline-cli/src/main/kotlin/app/cash/zipline/cli/ZiplineCompiler.kt index 505db5583a..8746abc294 100644 --- a/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplineCompiler.kt +++ b/zipline-cli/src/main/kotlin/app/cash/zipline/cli/ZiplineCompiler.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package app.cash.zipline.gradle +package app.cash.zipline.cli import app.cash.zipline.QuickJs import app.cash.zipline.ZiplineManifest diff --git a/zipline-gradle-plugin/src/test/kotlin/app/cash/zipline/gradle/ZiplineCompilerTest.kt b/zipline-cli/src/test/kotlin/app/cash/zipline/cli/ZiplineCompilerTest.kt similarity index 99% rename from zipline-gradle-plugin/src/test/kotlin/app/cash/zipline/gradle/ZiplineCompilerTest.kt rename to zipline-cli/src/test/kotlin/app/cash/zipline/cli/ZiplineCompilerTest.kt index b0c7ac0cb2..f430a7dba9 100644 --- a/zipline-gradle-plugin/src/test/kotlin/app/cash/zipline/gradle/ZiplineCompilerTest.kt +++ b/zipline-cli/src/test/kotlin/app/cash/zipline/cli/ZiplineCompilerTest.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package app.cash.zipline.gradle +package app.cash.zipline.cli import app.cash.zipline.QuickJs import app.cash.zipline.ZiplineManifest diff --git a/zipline-gradle-plugin/src/test/resources/happyPath/jsBuild/hello.js b/zipline-cli/src/test/resources/happyPath/jsBuild/hello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/happyPath/jsBuild/hello.js rename to zipline-cli/src/test/resources/happyPath/jsBuild/hello.js diff --git a/zipline-gradle-plugin/src/test/resources/happyPath/jsBuild/hello.js.map b/zipline-cli/src/test/resources/happyPath/jsBuild/hello.js.map similarity index 100% rename from zipline-gradle-plugin/src/test/resources/happyPath/jsBuild/hello.js.map rename to zipline-cli/src/test/resources/happyPath/jsBuild/hello.js.map diff --git a/zipline-gradle-plugin/src/test/resources/happyPath/jsBuild/jello.js b/zipline-cli/src/test/resources/happyPath/jsBuild/jello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/happyPath/jsBuild/jello.js rename to zipline-cli/src/test/resources/happyPath/jsBuild/jello.js diff --git a/zipline-gradle-plugin/src/test/resources/happyPath/jsBuild/jello.js.map b/zipline-cli/src/test/resources/happyPath/jsBuild/jello.js.map similarity index 100% rename from zipline-gradle-plugin/src/test/resources/happyPath/jsBuild/jello.js.map rename to zipline-cli/src/test/resources/happyPath/jsBuild/jello.js.map diff --git a/zipline-gradle-plugin/src/test/resources/happyPathNoSourceMap/jsBuild/hello.js b/zipline-cli/src/test/resources/happyPathNoSourceMap/jsBuild/hello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/happyPathNoSourceMap/jsBuild/hello.js rename to zipline-cli/src/test/resources/happyPathNoSourceMap/jsBuild/hello.js diff --git a/zipline-gradle-plugin/src/test/resources/happyPathNoSourceMap/jsBuild/jello.js b/zipline-cli/src/test/resources/happyPathNoSourceMap/jsBuild/jello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/happyPathNoSourceMap/jsBuild/jello.js rename to zipline-cli/src/test/resources/happyPathNoSourceMap/jsBuild/jello.js diff --git a/zipline-gradle-plugin/src/test/resources/incremental/added/bello.js b/zipline-cli/src/test/resources/incremental/added/bello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/incremental/added/bello.js rename to zipline-cli/src/test/resources/incremental/added/bello.js diff --git a/zipline-gradle-plugin/src/test/resources/incremental/base/jsBuild/hello.js b/zipline-cli/src/test/resources/incremental/base/jsBuild/hello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/incremental/base/jsBuild/hello.js rename to zipline-cli/src/test/resources/incremental/base/jsBuild/hello.js diff --git a/zipline-gradle-plugin/src/test/resources/incremental/base/jsBuild/jello.js b/zipline-cli/src/test/resources/incremental/base/jsBuild/jello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/incremental/base/jsBuild/jello.js rename to zipline-cli/src/test/resources/incremental/base/jsBuild/jello.js diff --git a/zipline-gradle-plugin/src/test/resources/incremental/base/jsBuild/yello.js b/zipline-cli/src/test/resources/incremental/base/jsBuild/yello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/incremental/base/jsBuild/yello.js rename to zipline-cli/src/test/resources/incremental/base/jsBuild/yello.js diff --git a/zipline-gradle-plugin/src/test/resources/incremental/modified/hello.js b/zipline-cli/src/test/resources/incremental/modified/hello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/incremental/modified/hello.js rename to zipline-cli/src/test/resources/incremental/modified/hello.js diff --git a/zipline-gradle-plugin/src/test/resources/incremental/removed/jello.js b/zipline-cli/src/test/resources/incremental/removed/jello.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/incremental/removed/jello.js rename to zipline-cli/src/test/resources/incremental/removed/jello.js diff --git a/zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/88b0986a7186d029-atomicfu-js-ir.js b/zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/88b0986a7186d029-atomicfu-js-ir.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/88b0986a7186d029-atomicfu-js-ir.js rename to zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/88b0986a7186d029-atomicfu-js-ir.js diff --git a/zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/kotlin-kotlin-stdlib-js-ir.js b/zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/kotlin-kotlin-stdlib-js-ir.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/kotlin-kotlin-stdlib-js-ir.js rename to zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/kotlin-kotlin-stdlib-js-ir.js diff --git a/zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/kotlinx-serialization-kotlinx-serialization-core-js-ir.js b/zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/kotlinx-serialization-kotlinx-serialization-core-js-ir.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/kotlinx-serialization-kotlinx-serialization-core-js-ir.js rename to zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/kotlinx-serialization-kotlinx-serialization-core-js-ir.js diff --git a/zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/kotlinx-serialization-kotlinx-serialization-json-js-ir.js b/zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/kotlinx-serialization-kotlinx-serialization-json-js-ir.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/kotlinx-serialization-kotlinx-serialization-json-js-ir.js rename to zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/kotlinx-serialization-kotlinx-serialization-json-js-ir.js diff --git a/zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js b/zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js rename to zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/kotlinx.coroutines-kotlinx-coroutines-core-js-ir.js diff --git a/zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/zipline-root-testing.js b/zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/zipline-root-testing.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/zipline-root-testing.js rename to zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/zipline-root-testing.js diff --git a/zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/zipline-root-zipline.js b/zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/zipline-root-zipline.js similarity index 100% rename from zipline-gradle-plugin/src/test/resources/jsWithImportsExports/jsBuild/zipline-root-zipline.js rename to zipline-cli/src/test/resources/jsWithImportsExports/jsBuild/zipline-root-zipline.js diff --git a/zipline-gradle-plugin/build.gradle.kts b/zipline-gradle-plugin/build.gradle.kts index bd406965ac..0b0339fe92 100644 --- a/zipline-gradle-plugin/build.gradle.kts +++ b/zipline-gradle-plugin/build.gradle.kts @@ -21,14 +21,12 @@ kotlin { dependencies { implementation(kotlin("gradle-plugin-api")) implementation(projects.zipline) - implementation(projects.ziplineBytecode) implementation(projects.ziplineKotlinPlugin) implementation(projects.ziplineLoader) implementation(libs.http4k.core) implementation(libs.http4k.server.jetty) implementation(libs.http4k.client.websocket) implementation(libs.kotlin.gradle.plugin) - implementation(libs.kotlinx.serialization.json) implementation(libs.okHttp.core) implementation(libs.okio.core) testImplementation(projects.ziplineLoaderTesting) diff --git a/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplineCompileTask.kt b/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplineCompileTask.kt index 1bf8d5d703..c69d6a8822 100644 --- a/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplineCompileTask.kt +++ b/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplineCompileTask.kt @@ -16,23 +16,28 @@ package app.cash.zipline.gradle -import app.cash.zipline.loader.ManifestSigner import app.cash.zipline.loader.SignatureAlgorithmId -import java.io.File import java.io.Serializable +import javax.inject.Inject import okio.ByteString import okio.ByteString.Companion.decodeHex import org.gradle.api.DefaultTask +import org.gradle.api.artifacts.Configuration +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.DirectoryProperty import org.gradle.api.provider.ListProperty import org.gradle.api.provider.MapProperty import org.gradle.api.provider.Property +import org.gradle.api.tasks.Classpath import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputDirectory import org.gradle.api.tasks.Optional import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.TaskAction -import org.gradle.work.ChangeType +import org.gradle.process.ExecOperations +import org.gradle.work.ChangeType.ADDED +import org.gradle.work.ChangeType.MODIFIED +import org.gradle.work.ChangeType.REMOVED import org.gradle.work.Incremental import org.gradle.work.InputChanges import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode @@ -40,7 +45,9 @@ import org.jetbrains.kotlin.gradle.targets.js.dsl.KotlinJsBinaryMode /** * Compiles `.js` files to `.zipline` files. */ -abstract class ZiplineCompileTask : DefaultTask() { +abstract class ZiplineCompileTask @Inject constructor( + private val execOperations: ExecOperations, +) : DefaultTask() { @get:Incremental @get:InputDirectory @@ -72,13 +79,19 @@ abstract class ZiplineCompileTask : DefaultTask() { @get:Input abstract val stripLineNumbers: Property + @get:Classpath + abstract val classpath: ConfigurableFileCollection + internal fun configure( outputDirectoryName: String, jsProductionTask: JsProductionTask, extension: ZiplineExtension, + cliConfiguration: Configuration, ) { description = "Compile .js to .zipline" + classpath.setFrom(cliConfiguration) + inputDir.fileProvider(jsProductionTask.outputFile.map { it.asFile.parentFile }) outputDir.set(project.layout.buildDirectory.dir("zipline/$outputDirectoryName")) @@ -109,51 +122,63 @@ abstract class ZiplineCompileTask : DefaultTask() { @TaskAction fun task(inputChanges: InputChanges) { - val inputDirFile = inputDir.get().asFile - val outputDirFile = outputDir.get().asFile - val mainModuleId = mainModuleId.orNull - val mainFunction = mainFunction.orNull - val signingKeys = signingKeys.get() - val manifestSigner = when { - signingKeys.isNotEmpty() -> { - val builder = ManifestSigner.Builder() - for (signingKey in signingKeys) { - builder.add(signingKey.algorithm, signingKey.name, signingKey.privateKey) + val args = buildList { + add("compile") + add("--input") + add(inputDir.get().asFile.toString()) + add("--output") + add(outputDir.get().asFile.toString()) + mainModuleId.orNull?.let { + add("--main-module-id") + add(it) + } + mainFunction.orNull?.let { + add("--main-function") + add(it) + } + for (signingKey in signingKeys.get()) { + add("--signer") + add( + buildString { + append(signingKey.algorithm.name) + append(':') + append(signingKey.name) + append(':') + append(signingKey.privateKey.hex()) + }, + ) + } + version.orNull?.let { + add("--version") + add(it) + } + metadata.orNull?.let { + for ((key, value) in it) { + add("--metadata") + add("$key=$value") } - builder.build() } - else -> null - } - val version = version.orNull - val metadata = metadata.orNull ?: mapOf() - val stripLineNumbers = stripLineNumbers.orNull ?: false - - val ziplineCompiler = ZiplineCompiler( - outputDir = outputDirFile, - mainFunction = mainFunction, - mainModuleId = mainModuleId, - manifestSigner = manifestSigner, - version = version, - metadata = metadata, - stripLineNumbers = stripLineNumbers, - ) - - if (inputChanges.isIncremental) { - fun filterByChangeType(filter: (ChangeType) -> Boolean): List { - return inputChanges.getFileChanges(inputDir) - .filter { filter(it.changeType) } - .map { outputDir.file(it.normalizedPath).get().asFile } + if (stripLineNumbers.getOrElse(false)) { + add("--strip-line-numbers") } + if (inputChanges.isIncremental) { + for (fileChange in inputChanges.getFileChanges(inputDir)) { + add( + when (fileChange.changeType) { + ADDED -> "--added" + MODIFIED -> "--modified" + REMOVED -> "--removed" + }, + ) + add(fileChange.file.toString()) + } + } + } - ziplineCompiler.incrementalCompile( - modifiedFiles = filterByChangeType { changeType -> changeType == ChangeType.MODIFIED }, - addedFiles = filterByChangeType { changeType -> changeType == ChangeType.ADDED }, - removedFiles = filterByChangeType { changeType -> changeType == ChangeType.REMOVED }, - ) - } else { - ziplineCompiler.compile( - inputDir = inputDirFile, - ) + execOperations.javaexec { exec -> + exec.classpath = classpath + exec.mainClass.set("app.cash.zipline.cli.Main") + exec.setArgs(args) } } diff --git a/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplinePlugin.kt b/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplinePlugin.kt index 2343ccb748..ab092d2d6f 100644 --- a/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplinePlugin.kt +++ b/zipline-gradle-plugin/src/main/kotlin/app/cash/zipline/gradle/ZiplinePlugin.kt @@ -58,12 +58,23 @@ class ZiplinePlugin : KotlinCompilerPluginSupportPlugin { val ziplineExtension = target.extensions.create("zipline", ZiplineExtension::class.java) ziplineExtension.apiTracking.convention(true) + val cliConfiguration: Configuration = target.configurations.create("ziplineCli") + .apply { + isCanBeConsumed = false + isVisible = false + } + target.dependencies.add( + cliConfiguration.name, + target.ziplineDependency("zipline-cli"), + ) + kotlinExtension.targets.withType(KotlinJsIrTarget::class.java).all { kotlinTarget -> kotlinTarget.binaries.withType(JsIrBinary::class.java).all { kotlinBinary -> registerCompileZiplineTask( project = target, jsProductionTask = kotlinBinary.asJsProductionTask(), extension = ziplineExtension, + cliConfiguration = cliConfiguration, ) } } @@ -77,6 +88,7 @@ class ZiplinePlugin : KotlinCompilerPluginSupportPlugin { project = target, jsProductionTask = jsProductionTask, extension = ziplineExtension, + cliConfiguration = cliConfiguration, ) ziplineCompileTask.configure { it.dependsOn(kotlinWebpack) @@ -89,16 +101,6 @@ class ZiplinePlugin : KotlinCompilerPluginSupportPlugin { kotlinWebpack.dependsOn(writeWebpackConfigTask) } - val cliConfiguration: Configuration = target.configurations.create("ziplineCli") - .apply { - isCanBeConsumed = false - isVisible = false - } - target.dependencies.add( - cliConfiguration.name, - target.ziplineDependency("zipline-cli"), - ) - target.afterEvaluate { if (ziplineExtension.apiTracking.get()) { val ziplineApiCheck = target.tasks.register("ziplineApiCheck") @@ -121,6 +123,7 @@ class ZiplinePlugin : KotlinCompilerPluginSupportPlugin { project: Project, jsProductionTask: JsProductionTask, extension: ZiplineExtension, + cliConfiguration: Configuration, ): TaskProvider { val target = (if (jsProductionTask.targetName == "js") "" else jsProductionTask.targetName) val mode = jsProductionTask.mode.name @@ -133,9 +136,8 @@ class ZiplinePlugin : KotlinCompilerPluginSupportPlugin { val ziplineCompileTask = project.tasks.register( "${jsProductionTask.name}Zipline", ZiplineCompileTask::class.java, - ) - ziplineCompileTask.configure { - it.configure(outputDirectoryName, jsProductionTask, extension) + ) { + it.configure(outputDirectoryName, jsProductionTask, extension, cliConfiguration) } val serveTaskName = "serve${target.capitalize()}${mode.capitalize()}${toolName}Zipline"