diff --git a/.scalafmt.conf b/.scalafmt.conf index e661d6c..f216dbf 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1 +1,2 @@ +version = "1.5.1" maxColumn = 120 \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index c3542ec..f130242 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,8 +7,14 @@ addons: language: scala +scala: + - 2.10.7 + - 2.11.12 + - 2.12.8 + - 2.13.0 + jdk: - - oraclejdk8 + - openjdk8 before_cache: - find $HOME/.sbt -name '*.lock' -delete @@ -18,18 +24,16 @@ cache: directories: - $HOME/.ivy2/cache - $HOME/.sbt/boot/ + - $HOME/.coursier/ before_script: -script: - - sbt +test - before_deploy: deploy: - skip_cleanup: true - provider: script - script: sbt "release with-defaults" - on: - condition: -e ./deploy.sbt - all_branches: true + - provider: script + script: sbt ++$TRAVIS_SCALA_VERSION "sonatypeOpen \"Travis Job $TRAVIS_JOB_NAME $TRAVIS_JOB_NUMBER ($TRAVIS_JOB_WEB_URL)\"" publishSigned sonatypeRelease + skip_cleanup: true + on: + all_branches: true + condition: $GITHUB_PERSONAL_ACCESS_TOKEN diff --git a/build.sbt b/build.sbt index ca00735..8ce3c2b 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,5 @@ import scala.util.matching.Regex.{Groups, Match} -crossScalaVersions in ThisBuild := Seq("2.10.7", "2.11.12", "2.12.6", "2.13.0-RC2") - val CovariantRegex = """extends TryTInstances0|covariant|\+\s*([A_])\b""".r def copySource(fromProject: Project) = { @@ -45,11 +43,12 @@ lazy val covariantJS = covariant.js organization in ThisBuild := "com.thoughtworks.tryt" -publishArtifact := false +publish / skip := false + +enablePlugins(ScalaUnidocPlugin) + +unidocProjectFilter in ScalaUnidoc in unidoc := inProjects(invariantJVM, covariantJVM) + +addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3") -lazy val unidoc = project - .enablePlugins(ScalaUnidocPlugin) - .settings( - addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.1"), - scalacOptions += "-Xexperimental" - ) +scalacOptions += "-Xexperimental" diff --git a/covariant/build.sbt.shared b/covariant/build.sbt.shared index 74940d4..5d2a766 100644 --- a/covariant/build.sbt.shared +++ b/covariant/build.sbt.shared @@ -7,9 +7,9 @@ libraryDependencies += "org.scalaz" %%% "scalaz-core" % "7.2.27" libraryDependencies += "org.scalaz" %%% "scalaz-effect" % "7.2.27" -libraryDependencies += "org.scalatest" %%% "scalatest" % "3.1.0-SNAP11" % Test +libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.8" % Test -addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.1") +addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3") sourceGenerators in Test := { (sourceGenerators in Test).value.filterNot { sourceGenerator => diff --git a/deploy.sbt.disabled b/deploy.sbt.disabled deleted file mode 100644 index 1fc7c83..0000000 --- a/deploy.sbt.disabled +++ /dev/null @@ -1,20 +0,0 @@ -enablePlugins(Travis) - -enablePlugins(SonatypeRelease) - -lazy val secret = project.settings(publishArtifact := false).in { - val secretDirectory = file(sourcecode.File()).getParentFile / "secret" - sys.env.get("GITHUB_PERSONAL_ACCESS_TOKEN").foreach { token => - IO.delete(secretDirectory) - org.eclipse.jgit.api.Git - .cloneRepository() - .setURI("https://github.com/ThoughtWorksInc/tw-data-china-continuous-delivery-password.git") - .setDirectory(secretDirectory) - .setCredentialsProvider( - new org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider(token, "") - ) - .call() - .close() - } - secretDirectory -} diff --git a/invariant/build.sbt.shared b/invariant/build.sbt.shared index 6dcb7bc..0341092 100644 --- a/invariant/build.sbt.shared +++ b/invariant/build.sbt.shared @@ -7,11 +7,11 @@ libraryDependencies += "org.scalaz" %%% "scalaz-core" % "7.2.27" libraryDependencies += "org.scalaz" %%% "scalaz-effect" % "7.2.27" -libraryDependencies += "org.scalatest" %%% "scalatest" % "3.1.0-SNAP11" % Test +libraryDependencies += "org.scalatest" %%% "scalatest" % "3.0.8" % Test libraryDependencies += "org.scalaz" %% "scalaz-concurrent" % "7.2.27" % Test -addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.1") +addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3") sourceGenerators in Test := { (sourceGenerators in Test).value.filterNot { sourceGenerator => diff --git a/project/build.properties b/project/build.properties index 64cf32f..c0bab04 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.1.4 +sbt.version=1.2.8 diff --git a/project/coursier.sbt b/project/coursier.sbt new file mode 100644 index 0000000..3a2d48e --- /dev/null +++ b/project/coursier.sbt @@ -0,0 +1 @@ +addSbtCoursier diff --git a/project/plugins.sbt b/project/plugins.sbt index ad390b9..03198f1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,15 @@ -addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "7.0.1") +addSbtPlugin("com.thoughtworks.sbt-best-practice" % "sbt-best-practice" % "7.0.1+28-0b91b5bf") + +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5") + +addSbtPlugin("com.dwijnand" % "sbt-dynver" % "3.3.0+19-f9a4262c") + +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2") addSbtPlugin("org.lyranthe.sbt" % "partial-unification" % "1.1.2") +addSbtPlugin("com.thoughtworks.example" % "sbt-example" % "6.0.1") + addSbtPlugin("com.thoughtworks.sbt-scala-js-map" % "sbt-scala-js-map" % "4.0.0") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28") - -addSbtPlugin("com.thoughtworks.example" % "sbt-example" % "6.0.0") diff --git a/project/project/plugins.sbt b/project/project/plugins.sbt new file mode 100644 index 0000000..bb02ff0 --- /dev/null +++ b/project/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.1.0-M14-3") diff --git a/secret.sbt b/secret.sbt new file mode 100644 index 0000000..3279570 --- /dev/null +++ b/secret.sbt @@ -0,0 +1,19 @@ +lazy val secret = { + for (token <- sys.env.get("GITHUB_PERSONAL_ACCESS_TOKEN")) yield { + val secret = project.settings(publishArtifact := false).in { + val secretDirectory = file(sourcecode.File()).getParentFile / "secret" + IO.delete(secretDirectory) + org.eclipse.jgit.api.Git + .cloneRepository() + .setURI("https://github.com/ThoughtWorksInc/tw-data-china-continuous-delivery-password.git") + .setDirectory(secretDirectory) + .setCredentialsProvider( + new org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider(token, "") + ) + .call() + .close() + secretDirectory + } + secret + } +}.getOrElse(null) diff --git a/version.sbt b/version.sbt deleted file mode 100644 index cb02a29..0000000 --- a/version.sbt +++ /dev/null @@ -1 +0,0 @@ -version in ThisBuild := "2.1.1-SNAPSHOT"