diff --git a/build.sbt b/build.sbt index e0b7897..06e5eeb 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ val ScalatraVersion = "2.5.0" val JettyVersion = "9.3.19.v20170502" -lazy val root = (project in file(".")).enablePlugins(SbtTwirl, JettyPlugin) +lazy val root = (project in file(".")).enablePlugins(SbtTwirl, ScalatraPlugin, JRebelPlugin) sourcesInBase := false organization := Organization @@ -87,17 +87,17 @@ } // JRebel -Seq(jrebelSettings: _*) +//Seq(jrebelSettings: _*) -jrebel.webLinks += (target in webappPrepare).value -jrebel.enabled := System.getenv().get("JREBEL") != null +//jrebel.webLinks += (target in webappPrepare).value +//jrebel.enabled := System.getenv().get("JREBEL") != null javaOptions in Jetty ++= Option(System.getenv().get("JREBEL")).toSeq.flatMap { path => - Seq("-noverify", "-XX:+UseConcMarkSweepGC", "-XX:+CMSClassUnloadingEnabled", s"-javaagent:${path}") + Seq("-noverify", "-XX:+UseConcMarkSweepGC", "-XX:+CMSClassUnloadingEnabled", s"-javaagent:${path}") } // Create executable war file -val executableConfig = config("executable").hide -Keys.ivyConfigurations += executableConfig +val ExecutableConfig = config("executable-config").hide +Keys.ivyConfigurations += ExecutableConfig libraryDependencies ++= Seq( "org.eclipse.jetty" % "jetty-security" % JettyVersion % "executable", "org.eclipse.jetty" % "jetty-webapp" % JettyVersion % "executable", @@ -126,7 +126,7 @@ IO delete temp // include jetty classes - val jettyJars = Keys.update.value select configurationFilter(name = executableConfig.name) + val jettyJars = Keys.update.value select configurationFilter(name = ExecutableConfig.name) jettyJars foreach { jar => IO unzip (jar, temp, (name:String) => (name startsWith "javax/") || @@ -158,17 +158,17 @@ s"https://github.com/gitbucket/${plugin}/releases/download/${version}/${plugin}_${scalaBinaryVersion.value}-${version}.jar" } log info s"Download: ${url}" - IO download(new java.net.URL(url), pluginsDir / s"${plugin}_${scalaBinaryVersion.value}-${version}.jar") + IO transfer(new java.net.URL(url).openStream, pluginsDir / s"${plugin}_${scalaBinaryVersion.value}-${version}.jar") } // zip it up IO delete (temp / "META-INF" / "MANIFEST.MF") - val contentMappings = (temp.*** --- PathFinder(temp)).get pair relativeTo(temp) + val contentMappings = (temp.allPaths --- PathFinder(temp)).get pair { file => IO.relativizeFile(temp, file) } val manifest = new JarManifest manifest.getMainAttributes put (AttrName.MANIFEST_VERSION, "1.0") manifest.getMainAttributes put (AttrName.MAIN_CLASS, "JettyLauncher") val outputFile = workDir / warName - IO jar (contentMappings, outputFile, manifest) + IO jar (contentMappings.map { case (file, path) => (file, path.toString) } , outputFile, manifest) // generate checksums Seq( diff --git a/project/Checksums.scala b/project/Checksums.scala index 6153714..0f4d52c 100644 --- a/project/Checksums.scala +++ b/project/Checksums.scala @@ -1,12 +1,13 @@ import java.security.MessageDigest import scala.annotation._ import sbt._ +import io._ object Checksums { private val bufferSize = 2048 def generate(source:File, target:File, algorithm:String):Unit = - IO write (target, compute(source, algorithm)) + sbt.IO write (target, compute(source, algorithm)) def compute(file:File, algorithm:String):String = hex(raw(file, algorithm)) diff --git a/project/build.properties b/project/build.properties index 64317fd..b7dd3cb 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.15 +sbt.version=1.0.2 diff --git a/project/plugins.sbt b/project/plugins.sbt index d251b0b..29d7171 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,8 @@ addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.3.7") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5") -addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.0") -addSbtPlugin("fi.gekkio.sbtplugins" % "sbt-jrebel-plugin" % "0.10.0") +//addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.0") +//addSbtPlugin("fi.gekkio.sbtplugins" % "sbt-jrebel-plugin" % "0.10.0") +addSbtPlugin("org.scalatra.sbt" % "sbt-scalatra" % "1.0.0") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC11") diff --git a/project/project/plugins.sbt b/project/project/plugins.sbt index 5b48d85..4bca283 100644 --- a/project/project/plugins.sbt +++ b/project/project/plugins.sbt @@ -1 +1 @@ -addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M15") +addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC11")