Do i have to specify new configuration in project definition?

29 views
Skip to first unread message

Udayakumar Rayala

unread,
Sep 16, 2012, 4:36:46 PM9/16/12
to simple-b...@googlegroups.com
In my current sbt build definition file, I defined a new configuration and added the settings of this configuration to Project settings:

  lazy val FunctionalTests = config("functional") extend(Shared)
  lazy val functionalTestSettings = configure(FunctionalTests, "functional")
  lazy val buildSettings = allOtherSettings ++ functionalTestSettings

And then added the new configuration to the Project definition as below:

  lazy val core = Project("core", file("."))
    .configs(UnitTests)
    .configs(IntegrationTests)
    .configs(FunctionalTests) // Is this required?
    .settings(buildSettings : _*)


All of this works even if skipped specifying the configuration in the Project definition. Is it necessary to specify the configuration in the Project definition? If not, how is the above definition useful?

Thanks,
Uday.

Mark Harrah

unread,
Sep 19, 2012, 12:50:30 PM9/19/12
to simple-b...@googlegroups.com
A configuration needs to be provided to the Project definition if you want delegation. For example, this definition:

lazy val FunctionalTests = config("functional") extend(Shared)

means that `functional` will delegate to `shared` for any settings that don't exist. If you don't want or need that, then no, you don't need to add the configuration to Project.

-Mark

> Thanks,
> Uday.
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/FzXyru0lQzMJ.
> To post to this group, send email to simple-b...@googlegroups.com.
> To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
>

Udayakumar Rayala

unread,
Sep 20, 2012, 3:13:57 PM9/20/12
to simple-b...@googlegroups.com
Hi Mark,

The following statement says that functional will delegate to shared for non existant settings.

  lazy val FunctionalTests = config("functional") extend(Shared)


Why do i still have to do this?

 lazy val core = Project("core", file("."))
    .configs(UnitTests)
    .configs(IntegrationTests)
    .configs(FunctionalTests) // Is this required?
    .settings(buildSettings : _*)


What will I see different if I miss the above statement?

Thanks,
Uday.

Mark Harrah

unread,
Sep 24, 2012, 6:51:45 AM9/24/12
to simple-b...@googlegroups.com
On Thu, 20 Sep 2012 12:13:57 -0700 (PDT)
Udayakumar Rayala <uday....@gmail.com> wrote:

> Hi Mark,
>
> The following statement says that functional will delegate to shared for
> non existant settings.
>
> lazy val FunctionalTests = config("functional") extend(Shared)

It only means that if it is registered with the Project as below. This information has to be provided to sbt ahead of it being used in settings.

-Mark
> > > To post to this group, send email to simple-b...@googlegroups.com<javascript:>.
> >
> > > To unsubscribe from this group, send email to
> > simple-build-t...@googlegroups.com <javascript:>.
> > > For more options, visit this group at
> > http://groups.google.com/group/simple-build-tool?hl=en.
> > >
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
> To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/LmstsBvlvFkJ.
Reply all
Reply to author
Forward
0 new messages