Skip to content

remove Context boiler plate from build files #137

@cvogt

Description

@cvogt

In order to remove noise from build files we could have Context be concrete, but undefined on the BasicBuild and then inject it later

class BasicBuild{
  def context: Context = throw new Exception("Context is injected by CBT via refinement")
}

A concrete build.scala would then simply look like this:

class Build extends BasicBuild{ ... }

instead of this

class Build(context: Context) extends BasicBuild(context){ ... }

cbt would have another source file that it would compile together with the user provided source files for every build:

class BuildWithContext(override val context: Context) extends Build

cbt would then instantiate BuildWithContext instead of Buildas it is now.

We could also make Build a trait, but this would obfuscate compile errors in case of unimplemented abstract members. They would show as missing in BuildWithContext instead of missing inBuild where they make more sense for the user.

(cc @densh)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions