diff --git a/.travis.yml b/.travis.yml index aa2675bf8..154bf4fb5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: scala sudo: required dist: trusty scala: -- 2.10.6 - 2.11.12 python: 2.7.13 cache: diff --git a/build.sbt b/build.sbt index b3b4599d1..678da434d 100644 --- a/build.sbt +++ b/build.sbt @@ -61,7 +61,7 @@ val XLintOptions = Seq( val Scala212Options = Seq( "-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`. "-Ypartial-unification", // Enable partial unification in type constructor inference, - "-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined. + //"-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined. "-Ywarn-unused:implicits", // Warn if an implicit parameter is unused. "-Ywarn-unused:imports", // Warn if an import selector is not referenced. "-Ywarn-unused:locals", // Warn if a local definition is unused. @@ -87,8 +87,6 @@ val scalacOptionsFn: String => Seq[String] = { s => } } -scalacOptions in Global ++= scalacOptionsFn(scalaVersion.value) - lazy val Versions = new { val logback = "1.2.3" val util = "0.48.0" @@ -96,8 +94,8 @@ lazy val Versions = new { val datastax = "3.6.0" val scalatest = "3.0.5" val shapeless = "2.3.3" - val thrift = "0.8.0" - val finagle = "17.12.0" + val thrift = "0.10.0" + val finagle = "19.1.0" val scalameter = "0.8.2" val scalacheck = "1.14.0" val slf4j = "1.7.25" @@ -114,10 +112,13 @@ lazy val Versions = new { val scala211 = "2.11.12" val scala212 = "2.12.8" val monix = "2.3.3" - val scalaAll = Seq(scala210, scala211, scala212) val scala = new { - val all = Seq(scala210, scala211, scala212) + val all = Seq( + //scala210, + scala211, + scala212 + ) } val typesafeConfig: String = if (Publishing.isJdk8) { @@ -128,7 +129,7 @@ lazy val Versions = new { val twitterUtil: String => String = { s => CrossVersion.partialVersion(s) match { - case Some((_, minor)) if minor >= 12 => "6.45.0" + case Some((_, minor)) if minor >= 12 => "19.1.0" case _ => "6.34.0" } } @@ -149,9 +150,9 @@ lazy val Versions = new { val scrooge: String => String = { s => CrossVersion.partialVersion(s) match { - case Some((_, minor)) if minor >= 11 && Publishing.isJdk8 => "4.18.0" - case Some((_, minor)) if minor >= 11 && !Publishing.isJdk8 => "4.7.0" - case _ => "4.7.0" + //case Some((_, minor)) if minor >= 11 && Publishing.isJdk8 => "4.18.0" + //case Some((_, minor)) if minor >= 11 && !Publishing.isJdk8 => "4.7.0" + case _ => "19.1.0" } } val play: String => String = { @@ -193,7 +194,7 @@ val releaseSettings = Seq( releaseStepTask((tut in Tut) in readme), setReleaseVersion, Publishing.commitTutFilesAndVersion, - releaseStepCommandAndRemaining("such publishSigned"), + releaseStepCommandAndRemaining("+publishSigned"), releaseStepCommandAndRemaining("sonatypeReleaseAll"), tagRelease, setNextVersion, @@ -236,7 +237,9 @@ val sharedSettings: Seq[Def.Setting[_]] = Defaults.coreDefaultSettings ++ Seq( ), envVars := Map("SCALACTIC_FILL_FILE_PATHNAMES" -> "yes"), parallelExecution in ThisBuild := false -) ++ Publishing.effectiveSettings ++ releaseSettings +) ++ Publishing.effectiveSettings ++ releaseSettings ++ Seq { + scalacOptions := scalacOptionsFn((scalaVersion in ThisBuild).value) +} lazy val baseProjectList: Seq[ProjectReference] = Seq( phantomDsl, @@ -257,7 +260,8 @@ lazy val phantom = (project in file(".")) sharedSettings ++ Publishing.noPublishSettings ).settings( name := "phantom", - moduleName := "phantom" + moduleName := "phantom", + crossScalaVersions := Versions.scala.all ).aggregate( fullProjectList: _* ) @@ -269,13 +273,13 @@ lazy val readme = (project in file("readme")) tutSourceDirectory := sourceDirectory.value / "main" / "tut", tutTargetDirectory := phantom.base / "docs", libraryDependencies ++= Seq( - "org.typelevel" %% "macro-compat" % Versions.macrocompat % "tut", - "org.scala-lang" % "scala-compiler" % scalaVersion.value % "tut", + "org.typelevel" %% "macro-compat" % Versions.macrocompat, + "org.scala-lang" % "scala-compiler" % scalaVersion.value, compilerPlugin("org.scalamacros" % "paradise" % Versions.macrosVersion(scalaVersion.value) cross CrossVersion.full), - "com.outworkers" %% "util-samplers" % Versions.util % "tut", - "io.circe" %% "circe-parser" % Versions.circe % "tut", - "io.circe" %% "circe-generic" % Versions.circe % "tut", - "org.scalatest" %% "scalatest" % Versions.scalatest % "tut" + "com.outworkers" %% "util-samplers" % Versions.util, + "io.circe" %% "circe-parser" % Versions.circe, + "io.circe" %% "circe-generic" % Versions.circe, + "org.scalatest" %% "scalatest" % Versions.scalatest ) ).dependsOn( phantomDsl, @@ -285,14 +289,14 @@ lazy val readme = (project in file("readme")) phantomFinagle, phantomStreams, phantomThrift - ).enablePlugins(TutPlugin, CrossPerProjectPlugin) + ).enablePlugins(TutPlugin) lazy val phantomDsl = (project in file("phantom-dsl")) .settings(sharedSettings: _*) .settings( name := "phantom-dsl", moduleName := "phantom-dsl", - crossScalaVersions := Versions.scalaAll, + crossScalaVersions := Versions.scala.all, concurrentRestrictions in Test := Seq( Tags.limit(Tags.ForkedTestGroup, defaultConcurrency) ), @@ -315,15 +319,13 @@ lazy val phantomDsl = (project in file("phantom-dsl")) ) ).dependsOn( phantomConnectors - ).enablePlugins( - CrossPerProjectPlugin ) lazy val phantomJdk8 = (project in file("phantom-jdk8")) .settings( name := "phantom-jdk8", moduleName := "phantom-jdk8", - crossScalaVersions := Versions.scalaAll, + crossScalaVersions := Versions.scala.all, testOptions in Test += Tests.Argument("-oF"), concurrentRestrictions in Test := Seq( Tags.limit(Tags.ForkedTestGroup, defaultConcurrency) @@ -335,8 +337,6 @@ lazy val phantomJdk8 = (project in file("phantom-jdk8")) sharedSettings: _* ).dependsOn( phantomDsl % "compile->compile;test->test" - ).enablePlugins( - CrossPerProjectPlugin ) lazy val phantomConnectors = (project in file("phantom-connectors")) @@ -345,13 +345,11 @@ lazy val phantomConnectors = (project in file("phantom-connectors")) ).settings( name := "phantom-connectors", moduleName := "phantom-connectors", - crossScalaVersions := Versions.scalaAll, + crossScalaVersions := Versions.scala.all, libraryDependencies ++= Seq( "com.datastax.cassandra" % "cassandra-driver-core" % Versions.datastax, "com.outworkers" %% "util-testing" % Versions.util % Test ) - ).enablePlugins( - CrossPerProjectPlugin ) lazy val phantomFinagle = (project in file("phantom-finagle")) @@ -359,7 +357,7 @@ lazy val phantomFinagle = (project in file("phantom-finagle")) .settings( name := "phantom-finagle", moduleName := "phantom-finagle", - crossScalaVersions := Versions.scalaAll, + crossScalaVersions := Versions.scala.all, testFrameworks in Test ++= Seq(new TestFramework("org.scalameter.ScalaMeterFramework")), libraryDependencies ++= Seq( compilerPlugin("org.scalamacros" % "paradise" % Versions.macrosVersion(scalaVersion.value) cross CrossVersion.full), @@ -369,8 +367,6 @@ lazy val phantomFinagle = (project in file("phantom-finagle")) ) ).dependsOn( phantomDsl % "compile->compile;test->test" - ).enablePlugins( - CrossPerProjectPlugin ) lazy val phantomThrift = (project in file("phantom-thrift")) @@ -393,8 +389,6 @@ lazy val phantomThrift = (project in file("phantom-thrift")) ).dependsOn( phantomDsl % "compile->compile;test->test;", phantomFinagle - ).enablePlugins( - CrossPerProjectPlugin ) lazy val phantomSbtPlugin = (project in file("phantom-sbt")) @@ -403,10 +397,10 @@ lazy val phantomSbtPlugin = (project in file("phantom-sbt")) ).settings( name := "phantom-sbt", moduleName := "phantom-sbt", - crossScalaVersions := Seq(Versions.scala210), + crossScalaVersions := Seq(Versions.scala212), publishMavenStyle := false, sbtPlugin := true, - publishArtifact := scalaVersion.value.startsWith("2.10"), + publishArtifact := scalaVersion.value.startsWith("2.12"), libraryDependencies ++= Seq( "com.datastax.cassandra" % "cassandra-driver-core" % Versions.datastax, "org.cassandraunit" % "cassandra-unit" % Versions.cassandraUnit excludeAll ( @@ -414,15 +408,13 @@ lazy val phantomSbtPlugin = (project in file("phantom-sbt")) ExclusionRule("org.slf4j", "slf4j-jdk14") ) ) - ).enablePlugins( - CrossPerProjectPlugin ) lazy val phantomStreams = (project in file("phantom-streams")) .settings( name := "phantom-streams", moduleName := "phantom-streams", - crossScalaVersions := Versions.scalaAll, + crossScalaVersions := Versions.scala.all, testFrameworks in Test ++= Seq(new TestFramework("org.scalameter.ScalaMeterFramework")), libraryDependencies ++= Seq( compilerPlugin("org.scalamacros" % "paradise" % Versions.macrosVersion(scalaVersion.value) cross CrossVersion.full), @@ -438,8 +430,6 @@ lazy val phantomStreams = (project in file("phantom-streams")) sharedSettings: _* ).dependsOn( phantomDsl % "compile->compile;test->test" - ).enablePlugins( - CrossPerProjectPlugin ) lazy val phantomExample = (project in file("phantom-example")) @@ -460,14 +450,12 @@ lazy val phantomExample = (project in file("phantom-example")) ).dependsOn( phantomDsl % "test->test;compile->compile;", phantomThrift - ).enablePlugins( - CrossPerProjectPlugin ) lazy val phantomMonix = (project in file("phantom-monix")) .settings( name := "phantom-monix", - crossScalaVersions := Versions.scalaAll, + crossScalaVersions := Versions.scala.all, moduleName := "phantom-monix", libraryDependencies ++= Seq( "com.outworkers" %% "util-testing" % Versions.util % Test, @@ -479,4 +467,4 @@ lazy val phantomExample = (project in file("phantom-example")) sharedSettings: _* ).dependsOn( phantomDsl % "compile->compile;test->test;" - ) \ No newline at end of file + ) diff --git a/build/publish_develop.sh b/build/publish_develop.sh index 25c19813d..93460d16d 100755 --- a/build/publish_develop.sh +++ b/build/publish_develop.sh @@ -42,7 +42,7 @@ function prepare_maven_release { function publish_to_bintray { export MAVEN_PUBLISH="false" echo "Publishing new version to bintray" - sbt "such publish" + sbt "+publish" } function setup_credentials { @@ -107,12 +107,6 @@ then setup_git_credentials prepare_maven_release - #sbt "project readme" tut - #git add docs - #git commit -m "Added compiled tut documentation [ci skip]" - - # git status - sbt "release with-defaults" else diff --git a/build/run_tests.sh b/build/run_tests.sh index 4ab2fe816..0126f8ca7 100755 --- a/build/run_tests.sh +++ b/build/run_tests.sh @@ -27,7 +27,7 @@ function run_test_suite { fi else echo "Running tests without attempting to submit coverage reports or run tut" - sbt "plz $TRAVIS_SCALA_VERSION test" + sbt "++$TRAVIS_SCALA_VERSION test" exit $? fi } diff --git a/docs/basics/tables.md b/docs/basics/tables.md index 9d6edd38c..a2de57d04 100644 --- a/docs/basics/tables.md +++ b/docs/basics/tables.md @@ -345,7 +345,6 @@ So the new type of the generated store method will now be: The new table definition to store the above is: ```scala - import com.outworkers.phantom.dsl._ import com.outworkers.phantom.builder.query.InsertQuery import scala.concurrent.duration._ diff --git a/phantom-dsl/src/main/scala/com/outworkers/phantom/macros/TableHelper.scala b/phantom-dsl/src/main/scala/com/outworkers/phantom/macros/TableHelper.scala index 90c6b63be..b6d254299 100644 --- a/phantom-dsl/src/main/scala/com/outworkers/phantom/macros/TableHelper.scala +++ b/phantom-dsl/src/main/scala/com/outworkers/phantom/macros/TableHelper.scala @@ -29,8 +29,7 @@ import scala.annotation.implicitNotFound import scala.collection.immutable.ListMap import scala.reflect.macros.whitebox -@implicitNotFound( - """ +@implicitNotFound(msg = """ | Table ${T} is most likely missing a PartitionKey column. | Also check that the fields in your table match types inside ${R}. """.stripMargin diff --git a/project/Publishing.scala b/project/Publishing.scala index ed6ef5847..ed23db10e 100644 --- a/project/Publishing.scala +++ b/project/Publishing.scala @@ -30,12 +30,6 @@ object Publishing { val ciSkipSequence = "[ci skip]" - private def toProcessLogger(st: State): ProcessLogger = new ProcessLogger { - override def error(s: => String): Unit = st.log.error(s) - override def info(s: => String): Unit = st.log.info(s) - override def buffer[T](f: => T): T = st.log.buffer(f) - } - def vcs(state: State): Vcs = { Project.extract(state).get(releaseVcs) .getOrElse(sys.error("Aborting release. Working directory is not a repository of a recognized VCS.")) @@ -49,7 +43,6 @@ object Publishing { val logger = ConsoleLogger() logger.info(s"Found modified files: ${vcs(st).hasModifiedFiles}") - val log = toProcessLogger(st) val versionsFile = settings.get(releaseVersionFile).getCanonicalFile val docsFolder = settings.get(releaseTutFolder).getCanonicalFile @@ -76,19 +69,19 @@ object Publishing { } } - vcs(st).add(commitablePaths: _*) !! log + vcs(st).add(commitablePaths: _*) val status = (vcs(st).status !!) trim val newState = if (status.nonEmpty) { val (state, msg) = settings.runTask(releaseCommitMessage, st) - val x = vcs(state).commit(msg, sign) + val x = vcs(state).commit(msg, sign, false) state } else { // nothing to commit. this happens if the version.sbt file hasn't changed or no docs have been added. st } - vcs(newState).status !! log + vcs(newState).status newState } @@ -140,7 +133,6 @@ object Publishing { Some("releases" at nexus + "service/local/staging/deploy/maven2") } }, - externalResolvers := Resolver.withDefaultResolvers(resolvers.value, mavenCentral = true), publishArtifact in Test := false, pomIncludeRepository := { _ => true }, pomExtra := diff --git a/project/build.properties b/project/build.properties index c091b86ca..72f902892 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.16 +sbt.version=1.2.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index 30db6ec3b..20db04813 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -28,36 +28,32 @@ lazy val isCi = sys.env.get("CI").exists("true" == ) lazy val Versions = new { val scrooge = if (isCi) { - if (sys.props("java.specification.version") == "1.8" && !isScala210) "4.18.0" else "4.7.0" + if (sys.props("java.specification.version") == "1.8" && !isScala210) "19.3.0" else "19.3.0" } else { - if (sys.props("java.specification.version") == "1.8") "4.18.0" else "4.7.0" + if (sys.props("java.specification.version") == "1.8") "19.3.0" else "19.3.0" } } -addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.5.0") +addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "1.5.1") -addSbtPlugin("org.scoverage" %% "sbt-coveralls" % "1.1.0") +addSbtPlugin("org.scoverage" %% "sbt-coveralls" % "1.2.7") -addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.3") +// addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.1.0-M13-1") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1") -if (sys.env.get("MAVEN_PUBLISH").exists("true" ==)) { - addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3") -} else { - addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") -} +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5") -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5") +addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("com.twitter" % "scrooge-sbt-plugin" % Versions.scrooge) -dependencyOverrides += "org.apache.thrift" % "libthrift" % "0.8.0" +dependencyOverrides += "org.apache.thrift" % "libthrift" % "0.10.0" -addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.5.6") +addSbtPlugin("org.tpolecat" % "tut-plugin" % "0.6.10") -addSbtPlugin("com.eed3si9n" % "sbt-doge" % "0.1.5") +// addSbtPlugin("com.eed3si9n" % "sbt-doge" % "0.1.5") libraryDependencies += "org.slf4j" % "slf4j-nop" % "1.7.22" -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.5") +addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11") diff --git a/readme/src/main/tut/basics/tables.md b/readme/src/main/tut/basics/tables.md index 9bac4d55d..0df47366c 100644 --- a/readme/src/main/tut/basics/tables.md +++ b/readme/src/main/tut/basics/tables.md @@ -345,7 +345,6 @@ So the new type of the generated store method will now be: The new table definition to store the above is: ```tut:silent - import com.outworkers.phantom.dsl._ import com.outworkers.phantom.builder.query.InsertQuery import scala.concurrent.duration._