Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

Commit

Permalink
Per bootique/bootique#344 BQModuleProvider is deprecated and unneeded
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Dec 5, 2023
1 parent eae1066 commit 37f826e
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@ package io.bootique.kotlin.sample
import io.bootique.ConfigModule
import io.bootique.config.ConfigurationFactory
import io.bootique.di.Provides
import io.bootique.jetty.JettyModuleProvider
import io.bootique.kotlin.config.modules.KotlinConfigModuleProvider
import io.bootique.kotlin.core.KotlinBQModuleProvider
import io.bootique.kotlin.extra.config
import io.bootique.logback.LogbackModule
import javax.inject.Singleton

data class AppConfiguration(
Expand All @@ -35,11 +32,6 @@ data class AppConfiguration(

class KotlinSampleModuleProvider : KotlinBQModuleProvider {
override val module = KotlinSampleModule()
override val dependencies = listOf(
JettyModuleProvider(),
LogbackModule(),
KotlinConfigModuleProvider()
)
}

class KotlinSampleModule : ConfigModule() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@

package io.bootique.kotlin.core

import io.bootique.BQModule
import io.bootique.BQModuleProvider
import io.bootique.ModuleCrate
import io.bootique.di.BQModule
import java.lang.Deprecated
import java.lang.reflect.Type
import kotlin.reflect.KClass
Expand All @@ -34,29 +33,37 @@ import kotlin.reflect.KClass
interface KotlinBQModuleProvider : BQModuleProvider {
val module: BQModule

override fun moduleCrate(): ModuleCrate {
return ModuleCrate.of(module)
.providerName(name)
.configs(configs)
.overrides(overrides.map { it.java })
.build();
override fun module(): BQModule {
return module
}

val configs: Map<String, Type>
get() = mapOf()

override fun configs(): Map<String, Type> {
return configs
}

/**
* Property for more native to Kotlin usage.
*/
val name: String
get() = ""

override fun name(): String {
return name
}

/**
* Provide property instead of function to use [KClass] instead of [Class].
*/
val overrides: Collection<KClass<out BQModule>>
get() = listOf()

override fun overrides(): Collection<Class<out BQModule>> {
return overrides.map { it.java }
}

/**
* Property for more native to Kotlin usage.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@

package io.bootique.kotlin.core

import io.bootique.BQModuleOverrideBuilder
import io.bootique.BQModuleProvider
import io.bootique.BQRuntime
import io.bootique.Bootique
import io.bootique.*
import io.bootique.command.CommandOutcome
import io.bootique.di.BQModule
import io.bootique.di.Key
import io.bootique.log.BootLogger
import io.bootique.shutdown.ShutdownManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package io.bootique.kotlin.di;

import io.bootique.BQModule
import io.bootique.di.*
import javax.inject.Provider
import kotlin.reflect.KClass
Expand Down

0 comments on commit 37f826e

Please sign in to comment.