package framework
- Alphabetic
- Public
- All
Type Members
-
trait
CheckableApp extends AnyRef
Represents
distage
apps that can be checked by izumi.distage.framework.PlanCheck at compile-time.Represents
distage
apps that can be checked by izumi.distage.framework.PlanCheck at compile-time.CheckableApp
must be inherited in a top-level object to be usable withPlanCheck
Role-based applications automatically inherit from RoleCheckableApp and can be checked out of the box.
Apps assembled directly using
distage-core
'sdistage.Injector
will need to implement the interface manually, using CoreCheckableApp or CoreCheckableAppSimple - abstract class CoreCheckableApp[F[_]] extends CheckableApp
- abstract class CoreCheckableAppSimple[F[_]] extends CoreCheckableApp[[_]F[_]]
-
final
class
PlanCheckConfig[Roles <: String, ExcludeActivations <: String, Config <: String, CheckConfig <: Boolean, PrintBindings <: Boolean, OnlyWarn <: Boolean] extends AnyRef
Options to alter the behavior of izumi.distage.framework.PlanCheck
Options to alter the behavior of izumi.distage.framework.PlanCheck
If on Scala
2.12
you're getting errors such as[error] type mismatch; [error] found : String("mode:test") [error] required: izumi.fundamentals.platform.language.literals.LiteralString{type T = String("mode:test")} with izumi.fundamentals.platform.language.literals.LiteralString
Then you'll have to refactor your instance of
PlanCheck.Main
(or similar) to make sure that PlanCheckConfig is defined in a separate val. You may do this by moving it from constructor parameter to early initializer.Example:
object WiringTest extends PlanCheck.Main(MyApp, PlanCheckConfig(...)) // [error]
Fix:
object WiringTest extends { val config = PlanCheckConfig( ... ) } with PlanCheck.Main(MyApp, config)
Note that such an issue does not exist on 2.13+, it is caused by a bug in Scala 2.12's treatment of implicits in class-parameter scope.
-
final
case class
PlanCheckMaterializer[AppMain <: CheckableApp, -Cfg <: Any](checkPassed: Boolean, checkedPlugins: Seq[PluginBase], app: AppMain, roles: String, excludeActivations: String, config: String, checkConfig: Option[Boolean], printBindings: Option[Boolean], onlyWarn: Option[Boolean]) extends Product with Serializable
This implicit performs a compile-time check for a given
distage
-basedApp
when materialized.This implicit performs a compile-time check for a given
distage
-basedApp
when materialized.The reason to use an implicit macro for this, instead of a direct def-macro is because implicit macros are more compositional – you may write new functions using the implicit without writing new macros, by contrast macros can only be composed inside new macros – and this in turn requires separating them into different
sbt
modules.- AppMain
The application to check, this should be a static object, most often a
main
object inherited from izumi.distage.roles.RoleAppMain- Cfg
Additional configuration options for compile-time checker
- See also
- abstract class RoleCheckableApp[F[_]] extends CheckableApp
Value Members
- object CheckableApp
- object DebugProperties extends fundamentals.platform.properties.DebugProperties
-
object
PlanCheck
API for performing compile-time and runtime checks of correctness for
distage
applications.API for performing compile-time and runtime checks of correctness for
distage
applications.The easiest way to add compile-time safety to your application is to add an object inheriting PlanCheck.Main in test scope of the same module where you define your Role Launcher
import izumi.distage.framework.PlanCheck import com.example.myapp.MainLauncher object WiringCheck extends PlanCheck.Main(MainLauncher)
This object will emit compile-time errors for any issues or omissions in your
ModuleDefs
- See also
Example: - object PlanCheckConfig
- object PlanCheckMaterializer extends Serializable