diff --git a/.gitignore b/.gitignore index f660530..8921e9f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ build/ .gradle/ out/ + +target/ diff --git a/.travis.yml b/.travis.yml index dff5f3a..d2f9b55 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,18 @@ -language: java +language: scala +jdk: openjdk8 +git: + depth: false +cache: + directories: + - $HOME/.cache + - $HOME/.ivy2/cache + - $HOME/.sbt +stages: + - name: test + - name: release + if: (branch = master AND type = push) OR (tag IS present) +jobs: + include: + - script: sbt test + - stage: release + script: sbt ci-release diff --git a/build.sbt b/build.sbt new file mode 100644 index 0000000..1944176 --- /dev/null +++ b/build.sbt @@ -0,0 +1,36 @@ + +inThisBuild(List( + organization := "org.jupyter", + homepage := Some(url("https://github.com/jupyter/jvm-repr")), + licenses := List("BSD-3-Clause" -> url("https://opensource.org/licenses/BSD-3-Clause")), + developers := List( + Developer( + "jvm-repr", + "jvm-repr contributors", + "", + url("https://github.com/jupyter/jvm-repr/graphs/contributors") + ) + ) +)) + +name := "jvm-repr" + +// pure java project +autoScalaLibrary := false +crossVersion := CrossVersion.disabled + +// test stuff +libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test" +fork.in(Test) := true // seems required for the tests to run fine + +// sbt-dynver doesn't generate correct versions, because tags don't have a +// 'v' prefix, so we're overriding its logic here +version := { + import sys.process._ + val describe = Seq("git", "describe", "--tags").!!.trim + val latestTag = Seq("git", "describe", "--tags", "--abbrev=0").!!.trim + if (describe == latestTag) + describe + else + describe + "-SNAPSHOT" +} diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 0000000..c0bab04 --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=1.2.8 diff --git a/project/plugins.sbt b/project/plugins.sbt new file mode 100644 index 0000000..d4f2c52 --- /dev/null +++ b/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2")