1

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?

acjay
  • 34,571
  • 6
  • 57
  • 100
JMC
  • 393
  • 1
  • 12
  • One idea would be to specify a separate taskKey[Unit] and just println the result of that pathfinder to see if looks where you expect it to look in your project filesystem. – johanandren Sep 07 '14 at 19:09
  • Could you please give an example? Not very familiar with what you are talking about. – JMC Sep 08 '14 at 01:49
  • Thanks for the hint, I figured the issue by using what you suggested. – JMC Sep 08 '14 at 02:33

1 Answers1

2

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.

JMC
  • 393
  • 1
  • 12
  • Could you show the source of your solution? I'm experiencing a similar problem – acjay Feb 14 '15 at 09:23
  • Hi, I no longer use this plugin. But, here is what I had as reference before. http://www.scala-sbt.org/0.12.2/docs/Detailed-Topics/Tasks.html. – JMC Feb 16 '15 at 19:12