playframeworksbt-websbt-concat

Play Framework sbt-concat work partially


I was trying to use sbt-concat plugin from https://github.com/ground5hark/sbt-concat. However, I could not make it to work with wildcard. Here is my build.sbt.

name := "webapp"
version := "1.0-SNAPSHOT"
scalaVersion := "2.10.4"
lazy val root = (project in file(".")).enablePlugins(PlayScala).enablePlugins(SbtTwirl).enablePlugins(SbtWeb)

resolvers += Resolver.sonatypeRepo("releases")

libraryDependencies ++= Seq(
  cache,
  filters,
  "postgresql" % "postgresql" % "9.1-901.jdbc4",
  "com.typesafe.play" %% "play-slick" % "0.7.0-M1",
  "com.github.tminglei" %% "slick-pg" % "0.5.3",
  "com.github.tminglei" %% "slick-pg_play-json" % "0.5.3",
  "com.github.tminglei" %% "slick-pg_jts" % "0.5.3"
)

pipelineStages in Assets := Seq(concat)

Concat.groups := Seq(
  "base.css" -> group(Seq("css/vendor/bootstrap/bootstrap.css")),
  "lib.css" -> group((sourceDirectory.value / "assets" / "css" / "core" / "lib") * "*.css"),
  "core.css" -> group(Seq("css/core/layout.css")),
  "base.js" -> group(Seq("js/vendor/jquery/jquery.js", "js/vendor/jquery/jquery.qtip.js", "js/vendor/bootstrap/bootstrap.js")),
  "lib.js" -> group((sourceDirectory.value / "assets" / "js" / "core" / "lib") * "*.js"),
  "core.js" -> group(Seq("js/core/jy.js"))
)

Please note that

"base.css" -> group(Seq("css/vendor/bootstrap/bootstrap.css"))
"base.js" -> group(Seq("js/vendor/jquery/jquery.js", "js/vendor/jquery/jquery.qtip.js", "js/vendor/bootstrap/bootstrap.js")) 

worked fine.
However the one using sourceDirectory.value does not work. Anyone has any insights?


Solution

  • I think I resolve the problem myself. I defined a Task unit to print out sourceDirectory.value, it points to /src instead of /app. Once I use (sourceDirectory in Assets).value, it starts to work correctly, but it points to /app/assets.