Skip to content

Commit

Permalink
Make the Zipline code serving port configurable (#786)
Browse files Browse the repository at this point in the history
Being locked to 8080 is not great.
  • Loading branch information
squarejesse authored Dec 21, 2022
1 parent 3ace68d commit 2894c43
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ abstract class ZiplineExtension {
abstract val mainFunction: Property<String>
abstract val version: Property<String>
abstract val signingKeys: NamedDomainObjectContainer<SigningKey>
abstract val httpServerPort: Property<Int>

abstract class SigningKey(val name: String) {
abstract val algorithmId: Property<SignatureAlgorithmId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ class ZiplinePlugin : KotlinCompilerPluginSupportPlugin {
project.tasks.register(serveTaskName, ZiplineServeTask::class.java) { createdTask ->
createdTask.description = "Serves Zipline files"
createdTask.inputDir.set(ziplineCompileTask.flatMap { it.outputDir })
createdTask.port.set(configuration.httpServerPort)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ abstract class ZiplineServeTask : DefaultTask() {
Pair("zipline", ContentType.TEXT_PLAIN)
)
)
val server = PolyHandler(http, ws).asServer(Jetty(8080))
val server = PolyHandler(http, ws).asServer(Jetty(port.orNull ?: 8080))
deploymentRegistry.start(
deploymentId,
DeploymentRegistry.ChangeBehavior.BLOCK,
Expand Down

0 comments on commit 2894c43

Please sign in to comment.