Last active
August 29, 2015 14:00
-
-
Save JohnMurray/11116775 to your computer and use it in GitHub Desktop.
Code snippets for scala-project blog post on www.johnmurray.io
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
language: scala | |
scala: | |
- 2.10.3 | |
script: | |
- sbt compile test:compile | |
- sbt scalastyle | |
- sbt test | |
jdk: | |
- oraclejdk7 | |
- openjdk7 | |
- oraclejdk8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sbt._ | |
import Keys._ | |
import spray.revolver.RevolverPlugin._ | |
object Resolvers { | |
} | |
object Dependencies { | |
val appDependencies = Seq( | |
) | |
} | |
object BuildSettings { | |
val buildOrganization = "johnmurray.io" | |
val appName = "CHANGE_ME" | |
val buildVersion = "0.0.1-SNAPSHOT" | |
val buildScalaVersion = "2.10.4" | |
val buildScalaOptions = Seq("-unchecked", "-deprecation", "-encoding", "utf8") | |
import Resolvers._ | |
import Dependencies._ | |
val buildSettings = Defaults.defaultSettings ++ Seq( | |
organization := buildOrganization, | |
version := buildVersion, | |
scalaVersion := buildScalaVersion, | |
libraryDependencies := appDependencies, | |
scalacOptions := buildScalaOptions | |
) ++ Revolver.settings | |
} | |
object ApplicationBuild extends Build { | |
import BuildSettings._ | |
lazy val main = Project( | |
appName, | |
file("."), | |
settings = buildSettings) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Dependencies { | |
val appDependencies = Seq( | |
"org.specs2" %% "specs2" % "2.3.10" % "test" | |
) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/JohnMurray/basic-scala-template.git YOUR_PROJECT_NAME |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── bin | |
│ └── sbt-launch.jar | |
└── sbt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
├── .gitignore | |
├── .travis.yml | |
├── bin | |
│ └── sbt-launch.jar | |
├── project | |
│ ├── Build.scala | |
│ └── plugins.sbt | |
├── readme.md | |
├── sbt | |
└── scalastyle-config.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addSbtPlugin("io.spray" % "sbt-revolver" % "0.7.2") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.6.0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "0.4.0") | |
resolvers += "sonatype-releases" at "https://oss.sonatype.org/content/repositories/releases/" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
JAVA=java | |
JAVA_OPTS="-Xmx512m -XX:MaxPermSize=256M" | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
$JAVA $JAVA_OPTS -jar "${DIR}/bin/sbt-launch.jar" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala-new my-new-project | |
cd my-new-project | |
# start working! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val buildSettings = Defaults.defaultSettings ++ Seq( | |
organization := buildOrganization, | |
version := buildVersion, | |
scalaVersion := buildScalaVersion, | |
libraryDependencies := appDependencies, | |
scalacOptions := buildScalaOptions | |
) ++ Revolver.settings ++ ScalastylePlugin.Settings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment