Skip to content

Commit

Permalink
Merge 78cfe2c into 15f0863
Browse files Browse the repository at this point in the history
  • Loading branch information
alexflav23 committed Oct 3, 2019
2 parents 15f0863 + 78cfe2c commit 7638307
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 86 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,6 @@ language: scala
sudo: required
dist: trusty
scala:
- 2.10.6
- 2.11.12
python: 2.7.13
cache:
Expand Down
80 changes: 34 additions & 46 deletions build.sbt
Expand Up @@ -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.
Expand All @@ -87,17 +87,15 @@ 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"
val json4s = "3.6.2"
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"
Expand All @@ -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) {
Expand All @@ -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"
}
}
Expand All @@ -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 = {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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: _*
)
Expand All @@ -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,
Expand All @@ -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)
),
Expand All @@ -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)
Expand All @@ -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"))
Expand All @@ -345,21 +345,19 @@ 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"))
.settings(sharedSettings: _*)
.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),
Expand All @@ -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"))
Expand All @@ -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"))
Expand All @@ -403,26 +397,24 @@ 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 (
ExclusionRule("org.slf4j", "slf4j-log4j12"),
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),
Expand All @@ -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"))
Expand All @@ -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,
Expand All @@ -479,4 +467,4 @@ lazy val phantomExample = (project in file("phantom-example"))
sharedSettings: _*
).dependsOn(
phantomDsl % "compile->compile;test->test;"
)
)
8 changes: 1 addition & 7 deletions build/publish_develop.sh
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/run_tests.sh
Expand Up @@ -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
}
Expand Down
1 change: 0 additions & 1 deletion docs/basics/tables.md
Expand Up @@ -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._
Expand Down
Expand Up @@ -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
Expand Down
14 changes: 3 additions & 11 deletions project/Publishing.scala
Expand Up @@ -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."))
Expand All @@ -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

Expand All @@ -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
}
Expand Down Expand Up @@ -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 :=
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=0.13.16
sbt.version=1.3.0

0 comments on commit 7638307

Please sign in to comment.