Skip to content

Commit

Permalink
Update Xitrum from 3.26.0 to 3.26.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ngocdaothanh committed May 30, 2016
1 parent 5ba6c01 commit 4805e0a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
19 changes: 9 additions & 10 deletions build.sbt
Expand Up @@ -2,36 +2,35 @@ organization := "tv.cntt"
name := "comy"
version := "1.7-SNAPSHOT"

scalaVersion := "2.11.7"

scalaVersion := "2.11.8"
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked")

// Xitrum requires Java 8
javacOptions ++= Seq("-source", "1.8", "-target", "1.8")

//------------------------------------------------------------------------------

libraryDependencies += "tv.cntt" %% "xitrum" % "3.26.0"
libraryDependencies += "tv.cntt" %% "xitrum" % "3.26.1"

// An implementation of SLF4J must be provided for Xitrum
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.3"
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.1.7"

// For writing condition in logback.xml
libraryDependencies += "org.codehaus.janino" % "janino" % "2.7.8"

libraryDependencies += "org.mongodb" % "mongo-java-driver" % "3.2.0"
libraryDependencies += "org.mongodb" % "mongo-java-driver" % "3.2.2"

// Scalate template engine config for Xitrum -----------------------------------

libraryDependencies += "tv.cntt" %% "xitrum-scalate" % "2.5"

// Precompile Scalate templates
seq(scalateSettings:_*)
Seq(scalateSettings:_*)

ScalateKeys.scalateTemplateConfig in Compile := Seq(TemplateConfig(
baseDirectory.value / "src" / "main" / "scalate",
Seq(),
Seq(Binding("helper", "xitrum.Action", true))
Seq.empty,
Seq(Binding("helper", "xitrum.Action", importMembers = true))
))

// xgettext i18n translation key string extractor is a compiler plugin ---------
Expand All @@ -43,10 +42,10 @@ scalacOptions += "-P:xgettext:xitrum.I18n"
// Put config directory in classpath for easier development --------------------

// For "sbt console"
unmanagedClasspath in Compile <+= (baseDirectory) map { bd => Attributed.blank(bd / "config") }
unmanagedClasspath in Compile <+= baseDirectory map { bd => Attributed.blank(bd / "config") }

// For "sbt run"
unmanagedClasspath in Runtime <+= (baseDirectory) map { bd => Attributed.blank(bd / "config") }
unmanagedClasspath in Runtime <+= baseDirectory map { bd => Attributed.blank(bd / "config") }

// Copy these to target/xitrum when sbt/sbt xitrum-package is run
XitrumPackage.copy("config", "public", "script")
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=0.13.9
sbt.version=0.13.11
5 changes: 2 additions & 3 deletions src/main/scala/comy/action/Users.scala
@@ -1,7 +1,6 @@
package comy.action

import io.netty.handler.codec.http.HttpHeaders
import HttpHeaders.Names.CONTENT_TYPE
import io.netty.handler.codec.http.HttpHeaderNames.CONTENT_TYPE
import xitrum.annotation.{GET, POST}

import comy.model.{DB, SaveUrlResult, QRCode}
Expand All @@ -19,7 +18,7 @@ class UserQRcode extends AppAction {
// See: http://www.hascode.com/2010/05/playing-around-with-qr-codes/
val url = param("url")
val bytes = QRCode.render(url)
HttpHeaders.setHeader(response, CONTENT_TYPE, "image/png")
response.headers.set(CONTENT_TYPE, "image/png")
respondBinary(bytes)
}
}
Expand Down

0 comments on commit 4805e0a

Please sign in to comment.