diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..e64dd86 --- /dev/null +++ b/.gitignore @@ -0,0 +1,36 @@ +project/project +project/target +target +.idea +.tmp + +*.iml +/out +.idea_modules +.classpath +.project +/RUNNING_PID +.settings +.sass-cache +scalajvm/upload/* + +# temp files +.~* +*~ +*.orig + +# eclipse +.scala_dependencies +.buildpath +.cache +.target +bin/ +.ensime +.ensime_cache + +# OSX +.DS_Store + +# PGP keys +pubring.gpg +secring.gpg \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100755 index 0000000..d5d0bac --- /dev/null +++ b/.travis.yml @@ -0,0 +1,9 @@ +language: scala +scala: + - 2.11.7 +jdk: + - oraclejdk8 +script: + - sbt test +after_success: + - bash deploy.sh diff --git a/build.sbt b/build.sbt new file mode 100755 index 0000000..1ed478a --- /dev/null +++ b/build.sbt @@ -0,0 +1,56 @@ +lazy val scalacheck = (project in file(".")) +.settings(publishSettings:_*) +.enablePlugins(ExerciseCompilerPlugin) +.settings( + organization := "org.scala-exercises", + name := "exercises-scalacheck", + scalaVersion := "2.11.7", + version := "0.1.2", + resolvers ++= Seq( + Resolver.sonatypeRepo("snapshots"), + Resolver.sonatypeRepo("releases") + ), + libraryDependencies ++= Seq( + "org.scalatest" %% "scalatest" % "2.2.4", + "org.scala-exercises" %% "exercise-compiler" % version.value, + "org.scala-exercises" %% "definitions" % version.value, + "org.scalacheck" %% "scalacheck" % "1.12.5", + compilerPlugin("org.spire-math" %% "kind-projector" % "0.7.1") + ) +) + +// Distribution + +lazy val gpgFolder = sys.env.getOrElse("SE_GPG_FOLDER", ".") + +lazy val publishSettings = Seq( + organizationName := "Scala Exercises", + organizationHomepage := Some(new URL("https://scala-exercises.org")), + startYear := Some(2016), + description := "Scala Exercises: The path to enlightenment", + homepage := Some(url("http://scala-exercises.org")), + pgpPassphrase := Some(sys.env.getOrElse("SE_GPG_PASSPHRASE", "").toCharArray), + pgpPublicRing := file(s"$gpgFolder/pubring.gpg"), + pgpSecretRing := file(s"$gpgFolder/secring.gpg"), + credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", sys.env.getOrElse("PUBLISH_USERNAME", ""), sys.env.getOrElse("PUBLISH_PASSWORD", "")), + scmInfo := Some(ScmInfo(url("https://github.com/scala-exercises/exercises-scalacheck"), "https://github.com/scala-exercises/exercises-scalacheck.git")), + licenses := Seq("Apache License, Version 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")), + publishMavenStyle := true, + publishArtifact in Test := false, + pomIncludeRepository := Function.const(false), + publishTo := { + val nexus = "https://oss.sonatype.org/" + if (isSnapshot.value) + Some("Snapshots" at nexus + "content/repositories/snapshots") + else + Some("Releases" at nexus + "service/local/staging/deploy/maven2") + }, + pomExtra := + + + fedefernandez + Fede Fernández + fede.f@47deg.com + + +) diff --git a/deploy.sh b/deploy.sh new file mode 100755 index 0000000..95aabbb --- /dev/null +++ b/deploy.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +function decipherKeys { + echo $KEYS_PASSPHRASE | gpg --passphrase-fd 0 keys.tar.gpg + tar xfv keys.tar +} + +function publish { + sbt compile publishSigned +} + +function release { + decipherKeys + publish +} + +if [[ $TRAVIS_BRANCH == 'master' ]]; then + echo "Master branch, releasing..." + release +else + echo "Not in master branch, skipping release" +fi + diff --git a/keys.tar.gpg b/keys.tar.gpg new file mode 100755 index 0000000..4be048e Binary files /dev/null and b/keys.tar.gpg differ diff --git a/project/build.properties b/project/build.properties new file mode 100755 index 0000000..176a863 --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=0.13.9 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt new file mode 100755 index 0000000..f354b1b --- /dev/null +++ b/project/plugins.sbt @@ -0,0 +1,2 @@ +addSbtPlugin("org.scala-exercises" % "sbt-exercise" % "0.1.1", "0.13", "2.10") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0")