Skip to content

Commit

Permalink
Revised build process to use bundled publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Smith authored and dantb committed Oct 7, 2019
1 parent e84ad2c commit 087e721
Show file tree
Hide file tree
Showing 22 changed files with 121 additions and 273 deletions.
2 changes: 1 addition & 1 deletion .sbtopts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-J-XX:MaxMetaspaceSize=512M
-J-XX:MaxMetaspaceSize=1024M
133 changes: 64 additions & 69 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,67 +1,54 @@
val compilerOptions212 = scalacOptions ++= Seq(
lazy val compilerOptions212 = scalacOptions ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"-encoding",
"utf-8", // Specify character encoding used by source files.
"-explaintypes", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
"-language:implicitConversions", // Allow definition of implicit functions called views
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
"-Xfatal-warnings", // Fail the compilation if there are any warnings.
"-Xfuture", // Turn on future language features.
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
"utf-8", // Specify character encoding used by source files.
"-explaintypes", // Explain type errors in more detail.
"-feature", // Emit warning and location for usages of features that should be imported explicitly.
"-language:existentials", // Existential types (besides wildcard types) can be written and inferred
"-language:experimental.macros", // Allow macro definition (besides implementation and application)
"-language:higherKinds", // Allow higher-kinded types
"-language:implicitConversions", // Allow definition of implicit functions called views
"-unchecked", // Enable additional warnings where generated code depends on assumptions.
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access.
"-Xfatal-warnings", // Fail the compilation if there are any warnings.
"-Xfuture", // Turn on future language features.
"-Xlint:adapted-args", // Warn if an argument list is modified to match the receiver.
"-Xlint:by-name-right-associative", // By-name parameter of right associative operator.
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
"-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
"-Xlint:option-implicit", // Option.apply used implicit view.
"-Xlint:package-object-classes", // Class or object defined in package object.
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
"-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
"-Xlint:unsound-match", // Pattern match may not be typesafe.
"-Yno-adapted-args", // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
"-Ypartial-unification", // Enable partial unification in type constructor inference
"-Ywarn-dead-code", // Warn when dead code is identified.
"-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
"-Ywarn-inaccessible", // Warn about inaccessible types in method signatures.
"-Ywarn-infer-any", // Warn when a type argument is inferred to be `Any`.
"-Ywarn-nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
"-Ywarn-nullary-unit", // Warn when nullary methods return Unit.
"-Ywarn-numeric-widen", // Warn when numerics are widened.
"-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.
"-Ywarn-unused:params", // Warn if a value parameter is unused.
"-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
"-Ywarn-unused:privates", // Warn if a private member is unused.
"-Ywarn-value-discard" // Warn when non-Unit expression results are unused.
)

addCommandAlias(
"quickcompile",
";shared/compile;core/compile;argonaut62/compile;http4s016a/compile;pactSpec/compile;pluginShared/compile;plugin/compile;pluginNoDeps/compile;standalone/compile;framework/compile;testsWithDeps/compile"
)
addCommandAlias(
"quicktest",
";shared/test;core/test;argonaut62/test;http4s016a/test;pactSpec/test;pluginShared/test;plugin/test;pluginNoDeps/test;standalone/test;framework/test;testsWithDeps/test"
)
addCommandAlias(
"quickpublish",
";shared/publishLocal;core/publishLocal;argonaut62/publishLocal;circe08/publishLocal;circe09/publishLocal;circe10/publishLocal;circe11/publishLocal;circe12/publishLocal;http4s016a/publishLocal;http4s017/publishLocal;http4s018/publishLocal;http4s020/publishLocal;pluginShared/publishLocal;plugin/publishLocal;pluginNoDeps/publishLocal;standalone/publishLocal;framework/publishLocal"
"-Xlint:constant", // Evaluation of a constant arithmetic expression results in an error.
"-Xlint:delayedinit-select", // Selecting member of DelayedInit.
"-Xlint:doc-detached", // A Scaladoc comment appears to be detached from its element.
"-Xlint:inaccessible", // Warn about inaccessible types in method signatures.
"-Xlint:infer-any", // Warn when a type argument is inferred to be `Any`.
"-Xlint:missing-interpolator", // A string literal appears to be missing an interpolator id.
"-Xlint:nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
"-Xlint:nullary-unit", // Warn when nullary methods return Unit.
"-Xlint:option-implicit", // Option.apply used implicit view.
"-Xlint:package-object-classes", // Class or object defined in package object.
"-Xlint:poly-implicit-overload", // Parameterized overloaded implicit methods are not visible as view bounds.
"-Xlint:private-shadow", // A private field (or class parameter) shadows a superclass field.
"-Xlint:stars-align", // Pattern sequence wildcard must align with sequence component.
"-Xlint:type-parameter-shadow", // A local type parameter shadows a type already in scope.
"-Xlint:unsound-match", // Pattern match may not be typesafe.
"-Yno-adapted-args", // Do not adapt an argument list (either by inserting () or creating a tuple) to match the receiver.
"-Ypartial-unification", // Enable partial unification in type constructor inference
"-Ywarn-dead-code", // Warn when dead code is identified.
"-Ywarn-extra-implicit", // Warn when more than one implicit parameter section is defined.
"-Ywarn-inaccessible", // Warn about inaccessible types in method signatures.
"-Ywarn-infer-any", // Warn when a type argument is inferred to be `Any`.
"-Ywarn-nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'.
"-Ywarn-nullary-unit", // Warn when nullary methods return Unit.
"-Ywarn-numeric-widen", // Warn when numerics are widened.
"-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.
"-Ywarn-unused:params", // Warn if a value parameter is unused.
"-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused.
"-Ywarn-unused:privates", // Warn if a private member is unused.
"-Ywarn-value-discard" // Warn when non-Unit expression results are unused.
)

lazy val commonSettings = Seq(
version := "2.3.11-SNAPSHOT",
version := "2.3.11",
organization := "com.itv",
scalaVersion := scala212,
libraryDependencies ++= Seq(
Expand Down Expand Up @@ -100,6 +87,7 @@ lazy val publishSettings = Seq(
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishTo := sonatypePublishToBundle.value,
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { _ =>
Expand All @@ -124,7 +112,7 @@ lazy val publishSettings = Seq(
</developers>
)

val scala212: String = "2.12.8"
lazy val scala212: String = "2.12.8"

lazy val shared =
(project in file("scalapact-shared"))
Expand Down Expand Up @@ -221,7 +209,7 @@ lazy val testShared =
.settings(commonSettings: _*)
.settings(
name := "scalapact-test-shared",
publish := {}
skip in publish := true
)
.dependsOn(shared)
.settings(compilerOptions212: _*)
Expand Down Expand Up @@ -288,7 +276,6 @@ lazy val circe10 =
.dependsOn(testShared % "test->compile")
.settings(compilerOptions212: _*)


lazy val circe11 =
(project in file("scalapact-circe-0-11"))
.settings(commonSettings: _*)
Expand Down Expand Up @@ -382,8 +369,9 @@ lazy val standalone =
publish := {},
assemblyJarName in assembly := "pactstubber.jar",
libraryDependencies ++= Seq(
"ch.qos.logback" % "logback-classic" % "1.2.3"
)
"ch.qos.logback" % "logback-classic" % "1.2.3"
),
skip in publish := true
)
.dependsOn(core)
.dependsOn(circe09)
Expand All @@ -395,7 +383,8 @@ lazy val pactSpec =
.settings(commonSettings: _*)
.settings(
name := "pact-spec-tests",
scalaVersion := scala212
scalaVersion := scala212,
skip in publish := true
)
.settings(
libraryDependencies ++= Seq(
Expand All @@ -412,10 +401,11 @@ lazy val testsWithDeps =
libraryDependencies ++= Seq(
"org.scalaj" %% "scalaj-http" % "2.3.0" % "test",
"org.json4s" %% "json4s-native" % "3.5.0" % "test",
"com.github.tomakehurst" % "wiremock" % "1.56" % "test",
"com.github.tomakehurst" % "wiremock" % "1.56" % "test",
"fr.hmil" %% "roshttp" % "2.0.1" % "test",
"io.argonaut" %% "argonaut" % "6.2"
)
"io.argonaut" %% "argonaut" % "6.2"
),
skip in publish := true
)
.dependsOn(framework)
.dependsOn(circe11)
Expand All @@ -432,14 +422,19 @@ lazy val docs =
paradoxTheme := Some(builtinParadoxTheme("generic")),
name := "scalapact-docs",
git.remoteRepo := "[email protected]:ITV/scala-pact.git",
sourceDirectory in Paradox := sourceDirectory.value / "main" / "paradox"
sourceDirectory in Paradox := sourceDirectory.value / "main" / "paradox",
skip in publish := true
)

lazy val scalaPactProject =
(project in file("."))
.settings(commonSettings: _*)
.aggregate(shared, core, pluginShared, plugin, pluginNoDeps, framework, standalone, testShared)
.settings(
skip in publish := true
)
.aggregate(shared, core, pluginShared, plugin, pluginNoDeps, framework, testShared)
.aggregate(http4s016a, http4s017, http4s018, http4s020)
.aggregate(argonaut62, circe08, circe09, circe10, circe11, circe12)
.aggregate(standalone)
.aggregate(docs)
.aggregate(pactSpec, testsWithDeps)
21 changes: 21 additions & 0 deletions commands.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
addCommandAlias(
"prepareScalaPactPublish",
List(
"clean",
"update",
"compile",
"test",
"publishSigned"
).mkString(";", ";", "")
)

addCommandAlias(
"localPublishScalaPact",
List(
"clean",
"update",
"compile",
"test",
"publishLocal"
).mkString(";", ";", "")
)
8 changes: 4 additions & 4 deletions example/consumer/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ name := "consumer"

organization := "com.example"

scalaVersion := "2.12.7"
scalaVersion := "2.12.8"

version := "0.0.1"

enablePlugins(ScalaPactPlugin)

libraryDependencies ++=
Seq(
"com.itv" %% "scalapact-circe-0-9" % "2.3.11-SNAPSHOT" % "test",
"com.itv" %% "scalapact-http4s-0-18" % "2.3.11-SNAPSHOT" % "test",
"com.itv" %% "scalapact-scalatest" % "2.3.11-SNAPSHOT" % "test",
"com.itv" %% "scalapact-circe-0-9" % "2.3.11" % "test",
"com.itv" %% "scalapact-http4s-0-18" % "2.3.11" % "test",
"com.itv" %% "scalapact-scalatest" % "2.3.11" % "test",
"org.scalaj" %% "scalaj-http" % "2.3.0",
"org.slf4j" % "slf4j-simple" % "1.6.4",
"org.json4s" %% "json4s-native" % "3.5.0",
Expand Down
2 changes: 1 addition & 1 deletion example/consumer/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.2.6
sbt.version = 1.3.2
3 changes: 1 addition & 2 deletions example/consumer/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

addSbtPlugin("com.itv" % "sbt-scalapact" % "2.3.11-SNAPSHOT")
addSbtPlugin("com.itv" % "sbt-scalapact" % "2.3.11")
2 changes: 1 addition & 1 deletion example/provider/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name := "provider"

version := "0.0.1"

scalaVersion := "2.12.7"
scalaVersion := "2.12.8"

libraryDependencies ++= Seq(
"org.http4s" %% "http4s-blaze-server" % "0.17.6",
Expand Down
4 changes: 2 additions & 2 deletions example/provider/delivered_pacts/Consumer_Provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"version" : "2.0.0"
},
"scala-pact" : {
"version" : "2.3.11-SNAPSHOT"
"version" : "2.3.11"
}
}
}
}
2 changes: 1 addition & 1 deletion example/provider/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.2.6
sbt.version = 1.3.2
6 changes: 3 additions & 3 deletions example/provider/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
libraryDependencies ++= Seq(
"com.itv" %% "scalapact-argonaut-6-2" % "2.3.11-SNAPSHOT",
"com.itv" %% "scalapact-http4s-0-16a" % "2.3.11-SNAPSHOT"
"com.itv" %% "scalapact-argonaut-6-2" % "2.3.11",
"com.itv" %% "scalapact-http4s-0-16a" % "2.3.11"
)

addSbtPlugin("com.itv" % "sbt-scalapact-nodeps" % "2.3.11-SNAPSHOT")
addSbtPlugin("com.itv" % "sbt-scalapact-nodeps" % "2.3.11")
8 changes: 4 additions & 4 deletions example/provider_tests/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name := "provider_tests"

version := "0.0.1"

scalaVersion := "2.12.7"
scalaVersion := "2.12.8"

libraryDependencies ++=
Seq(
Expand All @@ -13,9 +13,9 @@ libraryDependencies ++=
"org.http4s" %% "http4s-circe" % "0.18.9",
"org.slf4j" % "slf4j-simple" % "1.6.4",
"org.scalatest" %% "scalatest" % "3.0.1" % "test",
"com.itv" %% "scalapact-circe-0-9" % "2.3.11-SNAPSHOT" % "test",
"com.itv" %% "scalapact-http4s-0-18" % "2.3.11-SNAPSHOT" % "test",
"com.itv" %% "scalapact-scalatest" % "2.3.11-SNAPSHOT" % "test",
"com.itv" %% "scalapact-circe-0-9" % "2.3.11" % "test",
"com.itv" %% "scalapact-http4s-0-18" % "2.3.11" % "test",
"com.itv" %% "scalapact-scalatest" % "2.3.11" % "test",
// Optional for auto-derivation of JSON codecs
"io.circe" %% "circe-generic" % "0.9.0",
// Optional for string interpolation to JSON model
Expand Down
4 changes: 2 additions & 2 deletions example/provider_tests/delivered_pacts/Consumer_Provider.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"version" : "2.0.0"
},
"scala-pact" : {
"version" : "2.3.11-SNAPSHOT"
"version" : "2.3.11"
}
}
}
}
2 changes: 1 addition & 1 deletion example/provider_tests/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.2.6
sbt.version = 1.3.2
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.2.7
sbt.version = 1.3.2
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.4")

addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0")

Expand Down
59 changes: 0 additions & 59 deletions scripts/localpublish-libs.sh

This file was deleted.

Loading

0 comments on commit 087e721

Please sign in to comment.