diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..319de1a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,22 @@ +sudo: false +language: scala +stages: + - test + - name: deploy + if: branch = master AND NOT type IN (pull_request) + +script: sbt +test + +jobs: + include: + - stage: test + jdk: oraclejdk8 + - stage: test + jdk: openjdk8 + script: sbt clean coverage +test && sbt coverageReport coveralls + - stage: deploy + jdk: openjdk8 + script: | + openssl aes-256-cbc -K $encrypted_3b6b964f9930_key -iv $encrypted_3b6b964f9930_iv -in travis/secrets.tar.enc -out travis/local.secrets.tar -d && + tar xv -C travis -f travis/local.secrets.tar && + sbt +releaseEarly diff --git a/README.md b/README.md index e4cb202..5bfcc39 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ # shapeless-feat +[![Maven Central](https://img.shields.io/maven-central/v/org.combinators/shapeless-feat_2.12.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.combinators%22%20AND%20%22shapeless-feat%22) +[![build status](https://travis-ci.org/combinators/cls-scala.svg?branch=master)](https://travis-ci.org/combinators/shapeless-feat) +[![Coverage Status](https://coveralls.io/repos/github/combinators/shapeless-feat/badge.svg?branch=master)](https://coveralls.io/github/combinators/shapeless-feat?branch=master) +[![Join the chat at https://gitter.im/combinators/cls-scala](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/combinators/cls-scala) ## Shapeless Generic Functional Enumeration of Algebraic Data Types for Scala This project brings [testing-feat](http://hackage.haskell.org/package/testing-feat) from Haskell over to Scala. The generics approach used in feat fits well with [shapeless](https://github.com/milessabin/shapeless), hence the name and out of the box support for generic programming. @@ -12,16 +16,16 @@ To obtain the latest version, clone the reopsitory and run sbt and publishLocal. The current release is available at maven central, just add ```scala -libraryDependencies += "de.tu_dortmund.cs.ls14" %% "shapeless-feat" % "0.2.1" +libraryDependencies += "org.combinators" %% "shapeless-feat" % "0.2.1" ``` Currently, Scala 2.11 and 2.12 are supported in the released version. ## Examples -Can be found in the [examples project](https://github.com/JanBessai/shapeless-feat/tree/master/examples/src/main/scala) and the [tests](https://github.com/JanBessai/shapeless-feat/tree/master/core/src/test/scala/shapeless/feat). +Can be found in the [examples project](https://github.com/combinators/shapeless-feat/tree/master/examples/src/main/scala) and the [tests](https://github.com/combinators/shapeless-feat/tree/master/src/test/scala/shapeless/feat). ## Help and Contributions -There is no Gitter/IRC channel yet, but you might try [shapeless](https://gitter.im/milessabin/shapeless) and find a contributor there. +Try the Gitter channel of [cls-scala](https://gitter.im/combinators/cls-scala). ### Contributers - Jan Bessai diff --git a/build.sbt b/build.sbt index caa551e..1462345 100644 --- a/build.sbt +++ b/build.sbt @@ -1,44 +1,29 @@ -/* - * Copyright (c) 2015 Jan Bessai - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +import sbt.{Credentials, Developer, ScmInfo} lazy val commonSettings = Seq( organization := "de.tu_dortmund.cs.ls14", - releaseVersionBump := sbtrelease.Version.Bump.Minor, - releaseIgnoreUntrackedFiles := true, + + scalaVersion := "2.12.4", + crossScalaVersions := Seq("2.11.12", scalaVersion.value), resolvers ++= Seq( Resolver.sonatypeRepo("releases"), Resolver.sonatypeRepo("snapshots") ), - scalaVersion := "2.12.4", - crossScalaVersions := Seq("2.11.12", "2.12.4"), - releaseCrossBuild := true, + headerLicense := Some(HeaderLicense.ALv2("2018", "Jan Bessai")), + scalacOptions ++= Seq( "-unchecked", "-deprecation", "-feature", "-language:implicitConversions" - //,"-Xlog-implicits" ), javaOptions in Test := Seq("-Xss16m"), fork in Test := true ) ++ publishSettings -lazy val core = Project(id = "shapeless-feat", base = file("core")). +lazy val root = Project(id = "shapeless-feat", base = file(".")). settings(commonSettings: _*). settings( moduleName := "shapeless-feat", @@ -50,52 +35,29 @@ lazy val core = Project(id = "shapeless-feat", base = file("core")). lazy val examples = Project(id = "shapeless-feat-examples", base = file("examples")). settings(commonSettings: _*). settings(noPublishSettings: _*). - dependsOn(core). + dependsOn(root). settings( moduleName := "shapeless-feat-examples" ) -lazy val root = (project in file(".")). - settings(commonSettings: _*). - settings(noPublishSettings: _*). - aggregate(core, examples). - settings( - moduleName := "shapeless-feat-root" - ) lazy val publishSettings = Seq( - publishMavenStyle := true, - publishArtifact in Test := false, - pomIncludeRepository := { _ => false }, - releasePublishArtifactsAction := PgpKeys.publishSigned.value, - publishTo := { version { (v: String) => - val nexus = "https://oss.sonatype.org/" - if (v.trim.endsWith("SNAPSHOT")) - Some("snapshots" at nexus + "content/repositories/snapshots") - else - Some("releases" at nexus + "service/local/staging/deploy/maven2") - }.value }, - homepage := Some(url("https://www.github.com/JanBessai/shapeless-feat")), - licenses := Seq("Apache 2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")), - scmInfo := Some(ScmInfo(url("https://github.com/JanBessai/shapeless-feat"), "scm:git:git@github.com:JanBessai/shapeless-feat.git")), - pomExtra := ( - - - JanBessai - Jan Bessai - http://janbessai.github.io/ - - - ) - ) + homepage := Some(url("https://www.github.com/JanBessai/shapeless-feat")), + licenses := Seq("Apache 2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")), + scmInfo := Some(ScmInfo(url("https://github.com/JanBessai/shapeless-feat"), "scm:git:git@github.com:JanBessai/shapeless-feat.git")), + developers := List( + Developer("JanBessai", "Jan Bessai", "jan.bessai@tu-dortmund.de", url("http://janbessai.github.io")) + ), + + pgpPublicRing := file("travis/local.pubring.asc"), + pgpSecretRing := file("travis/local.secring.asc"), +) lazy val noPublishSettings = Seq( - publish := (), - publishLocal := (), + publish := Seq.empty, + publishLocal := Seq.empty, publishArtifact := false - ) - - +) credentials in ThisBuild ++= (for { username <- Option(System.getenv().get("SONATYPE_USERNAME")) diff --git a/project/plugins.sbt b/project/plugins.sbt index edb98ef..8c53b62 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,3 +1,6 @@ +logLevel := Level.Warn +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.5.1") +addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.2.2") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.7") - +addSbtPlugin("ch.epfl.scala" % "sbt-release-early" % "2.1.1") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "4.0.0") \ No newline at end of file diff --git a/core/src/main/scala/shapeless/feat/Enumerable.scala b/src/main/scala/shapeless/feat/Enumerable.scala similarity index 100% rename from core/src/main/scala/shapeless/feat/Enumerable.scala rename to src/main/scala/shapeless/feat/Enumerable.scala diff --git a/core/src/main/scala/shapeless/feat/Enumeration.scala b/src/main/scala/shapeless/feat/Enumeration.scala similarity index 100% rename from core/src/main/scala/shapeless/feat/Enumeration.scala rename to src/main/scala/shapeless/feat/Enumeration.scala diff --git a/core/src/test/scala/shapeless/feat/AlgebraTest.scala b/src/test/scala/shapeless/feat/AlgebraTest.scala similarity index 100% rename from core/src/test/scala/shapeless/feat/AlgebraTest.scala rename to src/test/scala/shapeless/feat/AlgebraTest.scala diff --git a/core/src/test/scala/shapeless/feat/Enumerables.scala b/src/test/scala/shapeless/feat/Enumerables.scala similarity index 100% rename from core/src/test/scala/shapeless/feat/Enumerables.scala rename to src/test/scala/shapeless/feat/Enumerables.scala diff --git a/core/src/test/scala/shapeless/feat/KnownInstanceTest.scala b/src/test/scala/shapeless/feat/KnownInstanceTest.scala similarity index 100% rename from core/src/test/scala/shapeless/feat/KnownInstanceTest.scala rename to src/test/scala/shapeless/feat/KnownInstanceTest.scala diff --git a/core/src/test/scala/shapeless/feat/MatcherUtil.scala b/src/test/scala/shapeless/feat/MatcherUtil.scala similarity index 100% rename from core/src/test/scala/shapeless/feat/MatcherUtil.scala rename to src/test/scala/shapeless/feat/MatcherUtil.scala diff --git a/core/src/test/scala/shapeless/feat/PerformanceTest.scala b/src/test/scala/shapeless/feat/PerformanceTest.scala similarity index 100% rename from core/src/test/scala/shapeless/feat/PerformanceTest.scala rename to src/test/scala/shapeless/feat/PerformanceTest.scala diff --git a/core/src/test/scala/shapeless/feat/PrimitiveTest.scala b/src/test/scala/shapeless/feat/PrimitiveTest.scala similarity index 100% rename from core/src/test/scala/shapeless/feat/PrimitiveTest.scala rename to src/test/scala/shapeless/feat/PrimitiveTest.scala diff --git a/version.sbt b/version.sbt deleted file mode 100644 index 87c01ed..0000000 --- a/version.sbt +++ /dev/null @@ -1 +0,0 @@ -version in ThisBuild := "0.3.0-SNAPSHOT"