代码拉取完成,页面将自动刷新
同步操作将从 songzhuozhuo/biplatform 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import java.text.SimpleDateFormat
import java.util.Date
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
import scala.util.Try
import scalariform.formatter.preferences._
import NativePackagerHelper._
enablePlugins(JavaAppPackaging)
val mySetting = Seq(
organization := "com.souo",
version := "0.0.1",
scalaVersion := "2.11.8"
) ++ universalSettings
lazy val universalSettings = commonSettings ++ testSettings
lazy val compileScalastyle = taskKey[Unit]("compileScalastyle")
lazy val commonSettings = SbtScalariform.scalariformSettings ++ Seq(
ScalariformKeys.preferences := ScalariformKeys.preferences.value
.setPreference(DoubleIndentClassDeclaration, true)
.setPreference(PreserveSpaceBeforeArguments, true)
.setPreference(CompactControlReadability, true)
.setPreference(AlignSingleLineCaseStatements, true)
.setPreference(SpacesAroundMultiImports, false)
.setPreference(AlignParameters, true)
.setPreference(AlignArguments, true)
.setPreference(RewriteArrowSymbols, true),
compileScalastyle := org.scalastyle.sbt.ScalastylePlugin.scalastyle
.in(Compile)
.toTask("")
.value,
(compile in Compile) := ((compile in Compile) dependsOn compileScalastyle).value,
scalacOptions ++= Seq(
"-deprecation",
"-unchecked",
"encode","utf-8",
"-feature",
"-language:implicitConversions",
"-language:postfixOps",
"-language:existentials",
"-language:higherKinds",
"-Ywarn-dead-code")
)
lazy val testSettings = Seq(
parallelExecution in Test := false,
fork in Test := true,
concurrentRestrictions in Global := Seq(
Tags.limit(Tags.CPU, 1),
Tags.limit(Tags.Test, 1),
Tags.limitSum(1, Tags.Test, Tags.Untagged))
)
mySetting
libraryDependencies ++= Dependencies.designer
buildInfoKeys := Seq[BuildInfoKey](
BuildInfoKey.action("buildDate")(new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date())),
BuildInfoKey.action("buildSha")(Try(Process("git rev-parse HEAD").!!.stripLineEnd).getOrElse("?"))
)
compile in Compile := {
val compilationResult = (compile in Compile).value
IO.touch(target.value / "compilationFinished")
compilationResult
}
assemblyJarName in assembly := "biplatform.jar"
//skip test
test in assembly := {}
mappings in Universal := {
// universalMappings: Seq[(File,String)]
val universalMappings = (mappings in Universal).value
val fatJar = (assembly in Compile).value
// removing means filtering
val filtered = universalMappings filter {
case (file, name) => !name.endsWith(".jar")
}
//the fat jar
filtered :+ (fatJar -> ("lib/" + fatJar.getName))
}
//add our script
mappings in Universal ++= {
contentOf("script").map{s => s._1 -> ("bin/" + s._2)}
}
scriptClasspath := Seq((assemblyJarName in assembly).value)
//Skip packageDoc task on stage
mappings in (Compile, packageDoc) := Seq()
assemblyMergeStrategy in assembly := {
case PathList("javax", "servlet", xs@_*) => MergeStrategy.first
case PathList("com", "fasterxml", xs@_*) => MergeStrategy.first
case PathList("com", "google", "protobuf", xs@_*) => MergeStrategy.first
case PathList("org", "apache", "calcite", xs@_*) => MergeStrategy.first
case PathList("org", "apache", "commons", xs@_*) => MergeStrategy.first
case PathList("org", "slf4j", xs@_*) => MergeStrategy.first
case PathList(ps@_*) if ps.last endsWith ".html" => MergeStrategy.first
case "application.conf" => MergeStrategy.concat
case "unwanted.txt" => MergeStrategy.discard
case x =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
addCommandAlias("zip", "universal:packageBin")
addCommandAlias("tgz", "universal:packageZipTarball")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。