Removed the SBT stuff from OBP-API

This commit is contained in:
Marko Milić 2018-11-29 13:24:36 +01:00
parent fe7bacc8aa
commit 08ca9f7711
4 changed files with 0 additions and 135 deletions

View File

@ -1,2 +0,0 @@
#Project properties
sbt.version=0.13.9

View File

@ -1,96 +0,0 @@
import sbt._
import Keys._
import com.earldouglas.xwp._
import com.earldouglas.xwp.WebappPlugin
import com.earldouglas.xwp.ContainerPlugin.autoImport._
object LiftProjectBuild extends Build {
override lazy val settings = super.settings ++ buildSettings
lazy val buildSettings = Seq(
organization := pom.groupId,
version := pom.version
)
lazy val openBank = Project(
pom.artifactId,
base = file("."),
settings = defaultSettings ++ pom.settings)
.enablePlugins(JettyPlugin)
object pom {
val pomFile = "pom.xml"
lazy val pom = xml.XML.loadFile(pomFile)
lazy val pomProperties = (for{
props <- (pom \ "properties")
p <- props.child
} yield {
p.label -> p.text
}).toMap
private lazy val PropertiesExpr = """.*\$\{(.*?)\}.*""".r
def populateProps(t: String) = t match {
case PropertiesExpr(p) => {
val replaceWith = pomProperties.get(p)
t.replace("${"+p+"}", replaceWith.getOrElse(throw new Exception("Cannot find property: '" + p + "' required by: '" + t + "' in: " + pomFile)))
}
case _ => t
}
lazy val pomDeps = (for{
dep <- pom \ "dependencies" \ "dependency"
} yield {
val scope = (dep \ "scope")
val groupId = (dep \ "groupId").text
val noScope = populateProps(groupId) % populateProps((dep \ "artifactId").text) % populateProps((dep \ "version").text)
val nonCustom = if (scope.nonEmpty) noScope % populateProps(scope.text)
else noScope
if (groupId.endsWith("jetty")) Seq(noScope % "container", nonCustom) //hack to add jetty deps in container scope as it is required by the web plugin
else Seq(nonCustom)
}).flatten
lazy val pomRepos = for {
rep <- pom \ "repositories" \ "repository"
} yield {
populateProps((rep \ "url").text) at populateProps((rep \ "url").text)
}
lazy val pomScalaVersion = (pom \ "properties" \ "scala.compiler").text
lazy val artifactId = (pom \ "artifactId").text
lazy val groupId = (pom \ "groupId").text
lazy val version = (pom \ "version").text
lazy val name = (pom \ "name").text
lazy val settings = Seq(
scalaVersion := pomScalaVersion,
libraryDependencies ++= pomDeps,
resolvers ++= pomRepos,
containerPort := 8080
)
}
lazy val defaultSettings = Defaults.defaultSettings ++ Seq(
name := pom.name,
resolvers ++= Seq(
"Typesafe Repo" at "http://repo.typesafe.com/typesafe/releases",
"Java.net Maven3 Repository" at "http://download.java.net/maven/3/",
"Scala-Tools Dependencies Repository for Releases" at "http://scala-tools.org/repo-releases",
"Scala-Tools Dependencies Repository for Snapshots" at "http://scala-tools.org/repo-snapshots"),
// compile options
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-Xmax-classfile-name", "78"),
javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation"),
// show full stack traces
testOptions in Test += Tests.Argument("-oF")
)
}

View File

@ -1,30 +0,0 @@
resolvers += Classpaths.typesafeResolver
// addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse" % "1.5.0")
// resolvers += "sbt-deploy-repo" at "http://reaktor.github.com/sbt-deploy/maven"
// addSbtPlugin("fi.reaktor" %% "sbt-deploy" % "0.3.1-SNAPSHOT")
//xsbt-web-plugin
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "2.1.0")
//resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"
//libraryDependencies <+= sbtVersion(v => "com.github.siasia" % "xsbt-web-plugin" % (v+"-0.2.11"))
//sbteclipse
resolvers += {
val typesafeRepoUrl = new java.net.URL("http://repo.typesafe.com/typesafe/releases")
val pattern = Patterns(false, "[organisation]/[module]/[sbtversion]/[revision]/[type]s/[module](-[classifier])-[revision].[ext]")
Resolver.url("Typesafe Repository", typesafeRepoUrl)(pattern)
}
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "4.0.0")
addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.8.2")
//sbt-idea
resolvers += "sbt-idea-repo" at "http://mpeltonen.github.com/maven/"
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0")

7
sbt.sh
View File

@ -1,7 +0,0 @@
#!/bin/sh
export SBT_OPTS="-Xmx1024m -Xms1024m -Xss2048k -XX:MaxPermSize=1024m"
echo "sbt $@"
sbt $@
#$1 $2 $3 $4