Skip to content

Commit

Permalink
#46 - compile core and rest JAR for JDK6.
Browse files Browse the repository at this point in the history
  • Loading branch information
veebs committed Apr 28, 2013
1 parent fd76df4 commit b8dabab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
8 changes: 5 additions & 3 deletions README.md
Expand Up @@ -55,10 +55,12 @@ Socko is an embedded [Scala](http://www.scala-lang.org/) web server powered by

## Editing the Source Code

* We are currently using [Eclipse 3.7 Indigo](http://www.eclipse.org/downloads/packages/eclipse-ide-javascript-web-developers/indigosr2)
with [Scala IDE nightly build](http://scala-ide.org/download/nightly.html)
* We are currently using [Eclipse Juno](http://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/junosr1)
with [Scala IDE 3.0](http://scala-ide.org/download/current.html)

* We are currently using Scala 2.9.1 and JDK7. You can also use JDK6 but SPDY will not be supported.
* We are currently using Scala 2.10.1 and JDK7. You will need JDK7 to build.
The core and rest projects will be compiled for use with JDK6 but SPDY will
not be supported.

* Generate eclipse project files: `sbt eclispse`

Expand Down
27 changes: 17 additions & 10 deletions project/build.scala
Expand Up @@ -20,24 +20,31 @@ object SockoBuild extends Build {
lazy val defaultSettings = Defaults.defaultSettings ++ Seq(
// Info
organization := "org.mashupbots.socko",
version := "0.2.4",
version := "0.3.0",
scalaVersion := Dependency.V.Scala,
organizationHomepage := Some(url("http://www.sockoweb.org")),

// Repositories
resolvers += "Typesafe Repository" at "http://repo.typesafe.com/typesafe/releases/",
credentials += Credentials(Path.userHome / ".sbt" / ".credentials"),

// Compile options
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-optimize", "-feature"),
javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation"),


// sbtEclipse - see examples https://github.com/typesafehub/sbteclipse/blob/master/sbteclipse-plugin/src/sbt-test/sbteclipse/02-contents/project/Build.scala
EclipseKeys.createSrc := EclipseCreateSrc.ValueSet(EclipseCreateSrc.Unmanaged, EclipseCreateSrc.Source, EclipseCreateSrc.Resource),
EclipseKeys.withSource := true
)

// Don't publish to maven
lazy val doNotPublishSettings = Seq(publish := {}, publishLocal := {})

// Compile settings
lazy val compileJdk6Settings = Seq(
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-optimize", "-feature", "-target:jvm-1.6"),
javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation", "-source", "1.6", "-target", "1.6")
)
lazy val compileJdk7Settings = Seq(
scalacOptions ++= Seq("-encoding", "UTF-8", "-deprecation", "-unchecked", "-optimize", "-feature", "-target:jvm-1.7"),
javacOptions ++= Seq("-Xlint:unchecked", "-Xlint:deprecation", "-source", "1.7", "-target", "1.7")
)

//
// Packaging to SonaType using SBT
Expand Down Expand Up @@ -93,7 +100,7 @@ object SockoBuild extends Build {

lazy val webserver = Project(id = "socko-webserver",
base = file("socko-webserver"),
settings = defaultSettings ++ Seq(
settings = defaultSettings ++ compileJdk6Settings ++ Seq(
libraryDependencies ++= Dependencies.webserver,
publishTo <<= sockoPublishTo,
publishMavenStyle := true,
Expand All @@ -105,21 +112,21 @@ object SockoBuild extends Build {
lazy val buildtools = Project(id = "socko-buildtools",
base = file("socko-buildtools"),
dependencies = Seq(webserver),
settings = defaultSettings ++ Seq(
settings = defaultSettings ++ compileJdk7Settings ++ Seq(
libraryDependencies ++= Dependencies.buildtools
))

lazy val rest = Project(id = "socko-rest",
base = file("socko-rest"),
dependencies = Seq(webserver),
settings = defaultSettings ++ Seq(
settings = defaultSettings ++ compileJdk6Settings ++ Seq(
libraryDependencies ++= Dependencies.rest
))

lazy val examples = Project(id = "socko-examples",
base = file("socko-examples"),
dependencies = Seq(webserver, rest, buildtools),
settings = defaultSettings ++ doNotPublishSettings ++ Seq(
settings = defaultSettings ++ compileJdk7Settings ++ doNotPublishSettings ++ Seq(
libraryDependencies ++= Dependencies.examples
))
}
Expand Down

0 comments on commit b8dabab

Please sign in to comment.