mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-03 12:05:59 +01:00
Move to sbt 1.0
This commit is contained in:
22
build.sbt
22
build.sbt
@@ -4,7 +4,7 @@ val GitBucketVersion = "4.17.0-SNAPSHOT"
|
|||||||
val ScalatraVersion = "2.5.0"
|
val ScalatraVersion = "2.5.0"
|
||||||
val JettyVersion = "9.3.19.v20170502"
|
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
|
sourcesInBase := false
|
||||||
organization := Organization
|
organization := Organization
|
||||||
@@ -87,17 +87,17 @@ assemblyMergeStrategy in assembly := {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// JRebel
|
// JRebel
|
||||||
Seq(jrebelSettings: _*)
|
//Seq(jrebelSettings: _*)
|
||||||
|
|
||||||
jrebel.webLinks += (target in webappPrepare).value
|
//jrebel.webLinks += (target in webappPrepare).value
|
||||||
jrebel.enabled := System.getenv().get("JREBEL") != null
|
//jrebel.enabled := System.getenv().get("JREBEL") != null
|
||||||
javaOptions in Jetty ++= Option(System.getenv().get("JREBEL")).toSeq.flatMap { path =>
|
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
|
// Create executable war file
|
||||||
val executableConfig = config("executable").hide
|
val ExecutableConfig = config("executable-config").hide
|
||||||
Keys.ivyConfigurations += executableConfig
|
Keys.ivyConfigurations += ExecutableConfig
|
||||||
libraryDependencies ++= Seq(
|
libraryDependencies ++= Seq(
|
||||||
"org.eclipse.jetty" % "jetty-security" % JettyVersion % "executable",
|
"org.eclipse.jetty" % "jetty-security" % JettyVersion % "executable",
|
||||||
"org.eclipse.jetty" % "jetty-webapp" % JettyVersion % "executable",
|
"org.eclipse.jetty" % "jetty-webapp" % JettyVersion % "executable",
|
||||||
@@ -126,7 +126,7 @@ executableKey := {
|
|||||||
IO delete temp
|
IO delete temp
|
||||||
|
|
||||||
// include jetty classes
|
// 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 =>
|
jettyJars foreach { jar =>
|
||||||
IO unzip (jar, temp, (name:String) =>
|
IO unzip (jar, temp, (name:String) =>
|
||||||
(name startsWith "javax/") ||
|
(name startsWith "javax/") ||
|
||||||
@@ -158,17 +158,17 @@ executableKey := {
|
|||||||
s"https://github.com/gitbucket/${plugin}/releases/download/${version}/${plugin}_${scalaBinaryVersion.value}-${version}.jar"
|
s"https://github.com/gitbucket/${plugin}/releases/download/${version}/${plugin}_${scalaBinaryVersion.value}-${version}.jar"
|
||||||
}
|
}
|
||||||
log info s"Download: ${url}"
|
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
|
// zip it up
|
||||||
IO delete (temp / "META-INF" / "MANIFEST.MF")
|
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
|
val manifest = new JarManifest
|
||||||
manifest.getMainAttributes put (AttrName.MANIFEST_VERSION, "1.0")
|
manifest.getMainAttributes put (AttrName.MANIFEST_VERSION, "1.0")
|
||||||
manifest.getMainAttributes put (AttrName.MAIN_CLASS, "JettyLauncher")
|
manifest.getMainAttributes put (AttrName.MAIN_CLASS, "JettyLauncher")
|
||||||
val outputFile = workDir / warName
|
val outputFile = workDir / warName
|
||||||
IO jar (contentMappings, outputFile, manifest)
|
IO jar (contentMappings.map { case (file, path) => (file, path.toString) } , outputFile, manifest)
|
||||||
|
|
||||||
// generate checksums
|
// generate checksums
|
||||||
Seq(
|
Seq(
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
import scala.annotation._
|
import scala.annotation._
|
||||||
import sbt._
|
import sbt._
|
||||||
|
import io._
|
||||||
|
|
||||||
object Checksums {
|
object Checksums {
|
||||||
private val bufferSize = 2048
|
private val bufferSize = 2048
|
||||||
|
|
||||||
def generate(source:File, target:File, algorithm:String):Unit =
|
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 =
|
def compute(file:File, algorithm:String):String =
|
||||||
hex(raw(file, algorithm))
|
hex(raw(file, algorithm))
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
sbt.version=0.13.15
|
sbt.version=1.0.2
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ scalacOptions ++= Seq("-unchecked", "-deprecation", "-feature")
|
|||||||
|
|
||||||
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.3.7")
|
addSbtPlugin("com.typesafe.sbt" % "sbt-twirl" % "1.3.7")
|
||||||
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
|
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5")
|
||||||
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.0")
|
//addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.0.0")
|
||||||
addSbtPlugin("fi.gekkio.sbtplugins" % "sbt-jrebel-plugin" % "0.10.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("com.jsuereth" % "sbt-pgp" % "1.1.0")
|
||||||
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC11")
|
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC11")
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M15")
|
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-RC11")
|
||||||
|
|||||||
Reference in New Issue
Block a user