Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update lolhtml, lolhttp, loljson to 0.13.5 #676

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 30 additions & 27 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ val VERSION = "0.12.4"
lazy val catsCore = "1.6.1"
lazy val circe = "0.11.1"
lazy val doobie = "0.7.0"
lazy val lolhttp = "0.13.1"
lazy val lolhttp = "0.13.5"

lazy val commonSettings = Seq(
organization := "com.criteo.cuttle",
Expand Down Expand Up @@ -164,34 +164,37 @@ def removeDependencies(groups: String*)(xml: scala.xml.Node) = {
}

def webpackSettings(project: String) = List(
resourceGenerators in Compile += Def.task {
import scala.sys.process._
val streams0 = streams.value
val webpackOutputDir: File = (resourceManaged in Compile).value / "public" / project
if (devMode.value) {
streams0.log.warn(s"Skipping webpack resource generation.")
Nil
} else {
def listFiles(dir: File): Seq[File] =
IO.listFiles(dir)
.flatMap(
f =>
if (f.isDirectory) listFiles(f)
else Seq(f)
)
val logger = new ProcessLogger {
override def err(s: => String): Unit = streams0.log.info(s"ERR, $s")
override def buffer[T](f: => T): T = f
override def out(s: => String): Unit = streams0.log.info(s)
resourceGenerators in Compile += Def
.task {
import scala.sys.process._
val streams0 = streams.value
val webpackOutputDir: File = (resourceManaged in Compile).value / "public" / project
if (devMode.value) {
streams0.log.warn(s"Skipping webpack resource generation.")
Nil
} else {
def listFiles(dir: File): Seq[File] =
IO.listFiles(dir)
.flatMap(
f =>
if (f.isDirectory) listFiles(f)
else Seq(f)
)
val logger = new ProcessLogger {
override def err(s: => String): Unit = streams0.log.info(s"ERR, $s")
override def buffer[T](f: => T): T = f
override def out(s: => String): Unit = streams0.log.info(s)
}
logger.out(s"Generating UI assets to $webpackOutputDir...")
assert(
s"node node_modules/webpack/bin/webpack.js --output-path $webpackOutputDir --bail --project $project" ! logger == 0,
"webpack failed"
)
listFiles(webpackOutputDir)
}
logger.out(s"Generating UI assets to $webpackOutputDir...")
assert(
s"node node_modules/webpack/bin/webpack.js --output-path $webpackOutputDir --bail --project $project" ! logger == 0,
"webpack failed"
)
listFiles(webpackOutputDir)
}
}.dependsOn(cuttle / yarnInstall).taskValue
.dependsOn(cuttle / yarnInstall)
.taskValue
)

lazy val localdb = {
Expand Down
Loading