I use sbt-buildinfo to generate source containing an object with different constants depending on environment (e.g. "dev" vs "prod").
To facilitate this, I have a simple "client" project that my "dev" version extends from by directly referencing its source:
lazy val client = project.in(file("client"))
// client used for tests and development so IDE can track managedSources in usual directories inside project folder
.dependsOn(core.js)
.enablePlugins(BuildInfoPlugin)
.enablePlugins(ScalaJSBundlerPlugin)
.settings(Dependencies.client)
lazy val clientDev = project.in(file("client-dev"))
.dependsOn(core.js)
.enablePlugins(BuildInfoPlugin)
.enablePlugins(ScalaJSBundlerPlugin)
.settings(clientModuleSources)
.settings( Dependencies.client)
.settings(
buildInfoKeys := Seq[BuildInfoKey](
"uri" -> "some-dev-server"
)
)
// the above module has no code of its own, it merely sets buildInfoKeys and otherwise references all of client's code here:
lazy val clientModuleSources = Seq(
sourceDirectory in Compile := sourceDirectory.in(client, Compile).value,
resourceDirectory in Compile := resourceDirectory.in(client, Compile).value
)
This used to work with scala 2.12 and scalajs-bundler 0.17.0, where it would correctly bundle the sources and resources from client, but now my target directory under client-dev does not contain any resources under the target/scala.2.13/scalajs-bundler/main sub directory. The resources are correctly populated in target/scala.2.13/classes however.
How could scalajs-bundler not copy correctly into the scalajs-bundler/main directory if my Dependencies.client says to do so with?:
Every resource is bundled fine as expected for just building client, which doesn't have any buildInfo and doesn't try to set the resource or source directories.
my mistake, it seems sbt clean was not doing it's job, or I'm not triggering it correctly? I had to manually delete all target directories and then it worked.
Hi,
I use sbt-buildinfo to generate source containing an object with different constants depending on environment (e.g. "dev" vs "prod").
To facilitate this, I have a simple "client" project that my "dev" version extends from by directly referencing its source:
This used to work with scala 2.12 and scalajs-bundler 0.17.0, where it would correctly bundle the sources and resources from
client
, but now my target directory underclient-dev
does not contain any resources under thetarget/scala.2.13/scalajs-bundler/main
sub directory. The resources are correctly populated intarget/scala.2.13/classes
however.How could scalajs-bundler not copy correctly into the
scalajs-bundler/main
directory if myDependencies.client
says to do so with?:Every resource is bundled fine as expected for just building
client
, which doesn't have any buildInfo and doesn't try to set the resource or source directories.