Skip to content

Commit 32ab2a0

Browse files
committed
Add configuration id
1 parent c4bb20a commit 32ab2a0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

kfc/kfc-gradle-plugin/src/main/kotlin/io/github/turansky/kfc/gradle/plugin/BundlerRunConfiguration.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import org.gradle.internal.service.ServiceRegistry
44
import org.gradle.process.ExecOperations
55

66
internal data class BundlerRunConfiguration(
7-
val bundler: Bundler,
7+
private val bundler: Bundler,
88
val options: ExecOptions,
99
val execOperations: ExecOperations,
1010
val services: ServiceRegistry,
1111
val continuous: Boolean = false,
12-
)
12+
) {
13+
val id: String
14+
get() = bundler.toolName
15+
}

kfc/kfc-gradle-plugin/src/main/kotlin/io/github/turansky/kfc/gradle/plugin/SimpleBundlerRunner.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ internal data class SimpleBundlerRunner(
1212
private val execOperations: ExecOperations
1313
get() = configuration.execOperations
1414

15-
private val bundler: Bundler
16-
get() = configuration.bundler
17-
1815
fun run() {
1916
if (configuration.continuous) {
2017
startNonBlocking()
@@ -24,17 +21,17 @@ internal data class SimpleBundlerRunner(
2421
}
2522

2623
override fun start(): ExecAsyncHandle {
27-
return execOperations.execAsync(bundler.toolName) { execSpec ->
24+
return execOperations.execAsync(configuration.id) { execSpec ->
2825
configureExec(execSpec)
2926
}.start()
3027
}
3128

3229
private fun startNonBlocking() {
3330
val deploymentRegistry = configuration.services.get(DeploymentRegistry::class.java)
34-
val deploymentHandle = deploymentRegistry.get(bundler.toolName, BundlerHandle::class.java)
31+
val deploymentHandle = deploymentRegistry.get(configuration.id, BundlerHandle::class.java)
3532
if (deploymentHandle == null) {
3633
deploymentRegistry.start(
37-
bundler.toolName,
34+
configuration.id,
3835
DeploymentRegistry.ChangeBehavior.BLOCK,
3936
BundlerHandle::class.java,
4037
this,

0 commit comments

Comments
 (0)