Skip to content
Permalink
Browse files

Initial project structure

  • Loading branch information...
djspiewak committed Jan 1, 2017
0 parents commit aa94ca372301092e131c7848bbc15d58d5c61022
Showing with 170 additions and 0 deletions.
  1. +7 −0 .gitignore
  2. +25 −0 .scalafmt.conf
  3. +18 −0 .travis.yml
  4. +112 −0 build.sbt
  5. +1 −0 project/build.properties
  6. +6 −0 project/plugins.sbt
  7. +1 −0 src/main/scala/package.scala
@@ -0,0 +1,7 @@
target/

# vim
*.sw?

# Ignore [ce]tags files
tags
@@ -0,0 +1,25 @@
# tune this file as appropriate to your style! see: https://olafurpg.github.io/scalafmt/#Configuration

maxColumn = 80

continuationIndent.callSite = 2

newlines {
sometimesBeforeColonInMethodReturnType = false
}

align {
arrowEnumeratorGenerator = false
ifWhileOpenParen = false
openParenCallSite = false
openParenDefnSite = false

tokens = ["%", "%%"]
}

docstrings = JavaDoc

rewrite {
rules = [SortImports, RedundantBraces]
redundantBraces.maxLines = 1
}
@@ -0,0 +1,18 @@
sudo: false
language: scala

scala:
- 2.12.1

before_cache:
- find $HOME/.sbt -name "*.lock" -type f -delete
- find $HOME/.ivy2/cache -name "ivydata-*.properties" -type f -delete

cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.coursier/cache
- $HOME/.sbt

jdk:
- oraclejdk8
112 build.sbt
@@ -0,0 +1,112 @@
organization := "com.codecommit"

name := "parseback"

/*
* Compatibility version. Use this to declare what version with
* which `master` remains in compatibility. This is literally
* backwards from how -SNAPSHOT versioning works, but it avoids
* the need to pre-declare (before work is done) what kind of
* compatibility properties the next version will have (i.e. major
* or minor bump).
*
* As an example, the builds of a project might go something like
* this:
*
* - 0.1-hash1
* - 0.1-hash2
* - 0.1-hash3
* - 0.1
* - 0.1-hash1
* - 0.2-hash2
* - 0.2
* - 0.2-hash1
* - 0.2-hash2
* - 1.0-hash3
* - 1.0-hash4
* - 1.0
*
* The value of BaseVersion starts at 0.1 and remains there until
* compatibility with the 0.1 line is lost, which happens just
* prior to the release of 0.2. Then the base version again remains
* 0.2-compatible until that compatibility is broken, with the major
* version bump of 1.0. Again, this is all to avoid pre-committing
* to a major/minor bump before the work is done (see: Scala 2.8).
*/
val BaseVersion = "0.1"

licenses += ("Apache-2.0", url("http://www.apache.org/licenses/"))

/***********************************************************************\
Boilerplate below these lines
\***********************************************************************/

coursierUseSbtCredentials := true
coursierChecksums := Nil // workaround for nexus sync bugs

addCompilerPlugin("org.spire-math" % "kind-projector" % "0.9.3" cross CrossVersion.binary)

// Adapted from Rob Norris' post at https://tpolecat.github.io/2014/04/11/scalac-flags.html
scalacOptions ++= Seq(
"-language:_",
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-feature",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Ywarn-dead-code"
)

scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, major)) if major >= 11 => Seq(
"-Ywarn-unused-import", // Not available in 2.10
"-Ywarn-numeric-widen" // In 2.10 this produces a some strange spurious error
)
case _ => Seq.empty
}
}

scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, major)) if major >= 12 || scalaVersion.value == "2.11.9" =>
Seq("-Ypartial-unification")

case _ => Seq.empty
}
}

scalacOptions in Test += "-Yrangepos"

scalacOptions in (Compile, console) ~= (_ filterNot (Set("-Xfatal-warnings", "-Ywarn-unused-import").contains))

scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value

libraryDependencies ++= {
scalaVersion.value match {
case "2.11.8" => Seq(compilerPlugin("com.milessabin" % "si2712fix-plugin" % "1.2.0" cross CrossVersion.full))
case "2.10.6" => Seq(compilerPlugin("com.milessabin" % "si2712fix-plugin" % "1.2.0" cross CrossVersion.full))
case _ => Seq.empty
}
}

enablePlugins(GitVersioning)

val ReleaseTag = """^v([\d\.]+)$""".r

git.baseVersion := BaseVersion

git.gitTagToVersionNumber := {
case ReleaseTag(version) => Some(version)
case _ => None
}

git.formattedShaVersion := {
val suffix = git.makeUncommittedSignifierSuffix(git.gitUncommittedChanges.value, git.uncommittedSignifier.value)

git.gitHeadCommit.value map { _.substring(0, 7) } map { sha =>
git.baseVersion.value + "-" + sha + suffix
}
}
@@ -0,0 +1 @@
sbt.version=0.13.13
@@ -0,0 +1,6 @@
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-M15-1")
addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.0.0-M4")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5")

addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")
@@ -0,0 +1 @@
package object parseback

0 comments on commit aa94ca3

Please sign in to comment.
You can’t perform that action at this time.