This repository was archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
initial pass at splitting the project into modules #69
Open
agaro1121
wants to merge
12
commits into
master
Choose a base branch
from
feature/split-modules
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
51ce89e
initial pass at splitting the project into modules
agaro1121 e767de7
fixes test dep in core module
agaro1121 29fe237
unit tests mostly compiling for now
agaro1121 d4262ad
moves modules into modules dir
agaro1121 365515c
fixes it module compilation issues
agaro1121 a5daa12
adds more metaspace
agaro1121 c16815b
switches project to integration tests module before runnign it:test
agaro1121 09789ed
fixes reference.conf not being loaded properly
agaro1121 4c3084c
updates sbt and scala versions. Remove extra items from sbt file
agaro1121 05ab85f
adds latest versions of dependencies for consistency
agaro1121 c25c4f0
fixes merge conflicts
agaro1121 8515a91
splits dependencies properly
agaro1121 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,3 +38,4 @@ snapshots | |
.credentials | ||
.artifactory | ||
secrets.tar | ||
/.metals/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
-XX:MaxMetaspaceSize=256m | ||
-XX:MaxMetaspaceSize=512m | ||
-Xss2m | ||
-Xms1g | ||
-Xmx1g |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,73 +2,71 @@ | |
// Projects | ||
// ***************************************************************************** | ||
|
||
lazy val `reactive-kinesis` = | ||
val core = | ||
project | ||
.in(file(".")) | ||
.in(file("modules/core")) | ||
.settings(name := "core") | ||
.enablePlugins(AutomateHeaderPlugin, GitVersioning, ScalafmtCorePlugin) | ||
.settings(settings) | ||
.configs(IntegrationTest) | ||
.settings(Defaults.itSettings: _*) | ||
.settings( | ||
libraryDependencies ++= | ||
library.jackson ++ library.amazon ++ library.lightbend ++ | ||
library.logback ++ library.testing | ||
) | ||
|
||
// ***************************************************************************** | ||
// Library dependencies | ||
// ***************************************************************************** | ||
|
||
lazy val library = | ||
new { | ||
|
||
object Version { | ||
val scalaCheck = "1.13.5" | ||
val scalaTest = "3.0.5" | ||
val jackson = "2.9.8" | ||
val akka = "2.5.19" | ||
} | ||
|
||
val jackson = Seq( | ||
//We need jackson versions to be consistent, KCL&KPL pull in slightly older versions which often get evicted | ||
//See: https://github.com/aws/aws-sdk-java/issues/999 | ||
"com.fasterxml.jackson.dataformat" % "jackson-dataformat-cbor" % Version.jackson % Compile, | ||
"com.fasterxml.jackson.core" % "jackson-databind" % Version.jackson % Compile, | ||
"com.fasterxml.jackson.core" % "jackson-core" % Version.jackson % Compile, | ||
"com.fasterxml.jackson.core" % "jackson-annotations" % Version.jackson % Compile, | ||
"com.fasterxml.uuid" % "java-uuid-generator" % "3.1.5" % Compile | ||
Dependencies.compile ++ Dependencies.test ++ Dependencies.libsThatUsedToComeFromAmazon | ||
) | ||
|
||
val amazon = Seq( | ||
// TODO: Upgrade this to 1.9.x when this issue is resolved and exposed in localstack: | ||
// https://github.com/mhart/kinesalite/issues/59 | ||
// 1.9.3 breaks KinesisSourceGraphStageIntegrationSpec and ConsumerProcessingManagerIntegrationSpec | ||
"com.amazonaws" % "amazon-kinesis-client" % "1.8.10" % Compile | ||
excludeAll (ExclusionRule(organization = "com.fasterxml.jackson.core"), | ||
ExclusionRule(organization = "com.fasterxml.jackson.dataformat")), | ||
"com.amazonaws" % "amazon-kinesis-producer" % "0.12.11" % Compile | ||
excludeAll (ExclusionRule(organization = "com.fasterxml.jackson.core"), | ||
ExclusionRule(organization = "com.fasterxml.jackson.dataformat")) | ||
val consumer = | ||
project | ||
.in(file("modules/consumer")) | ||
.settings(name := "consumer") | ||
.dependsOn(core) | ||
.enablePlugins(AutomateHeaderPlugin, GitVersioning, ScalafmtCorePlugin) | ||
.settings(settings) | ||
.settings( | ||
libraryDependencies ++= | ||
Dependencies.compile ++ Dependencies.test ++ Dependencies.amazonKcl | ||
) | ||
|
||
val lightbend = Seq( | ||
"com.typesafe" % "config" % "1.3.3" % Compile, | ||
"com.typesafe.akka" %% "akka-actor" % Version.akka % Compile, | ||
"com.typesafe.akka" %% "akka-stream" % Version.akka % Compile, | ||
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.0" % Compile | ||
val producer = | ||
project | ||
.in(file("modules/producer")) | ||
.settings(name := "producer") | ||
.dependsOn(core) | ||
.enablePlugins(AutomateHeaderPlugin, GitVersioning, ScalafmtCorePlugin) | ||
.settings(settings) | ||
.settings( | ||
libraryDependencies ++= | ||
Dependencies.compile ++ Dependencies.test ++ Dependencies.amazonKpl | ||
) | ||
|
||
val logback = Seq( | ||
"ch.qos.logback" % "logback-classic" % "1.2.3" % Compile | ||
val it = | ||
project | ||
.in(file("modules/it")) | ||
.settings(name := "it") | ||
.dependsOn(core, producer, consumer) | ||
.enablePlugins(AutomateHeaderPlugin, GitVersioning, ScalafmtCorePlugin) | ||
.settings(settings) | ||
.configs(IntegrationTest) | ||
.settings(Defaults.itSettings: _*) | ||
.settings( | ||
libraryDependencies ++= | ||
Dependencies.compile ++ Dependencies.itTest | ||
) | ||
|
||
val testing = Seq( | ||
"org.scalatest" %% "scalatest" % Version.scalaTest % "it,test", | ||
"org.scalacheck" %% "scalacheck" % Version.scalaCheck % "it,test", | ||
"com.typesafe.akka" %% "akka-testkit" % Version.akka % "it,test", | ||
"org.mockito" % "mockito-core" % "2.16.0" % "it,test" | ||
val `reactive-kinesis` = | ||
project | ||
.in(file(".")) | ||
.settings(name := "reactive-kinesis") | ||
.aggregate(core, consumer, producer) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't include |
||
.settings(settings) | ||
.settings( | ||
Defaults.coreDefaultSettings ++ Seq( | ||
publishArtifact := false, | ||
publishLocal := {}, | ||
publish := {}, | ||
bintrayRelease := {}, | ||
bintraySyncMavenCentral := {} | ||
) | ||
) | ||
} | ||
.enablePlugins(GitVersioning) | ||
|
||
// ***************************************************************************** | ||
// Settings | ||
|
@@ -77,53 +75,15 @@ lazy val library = | |
lazy val settings = | ||
commonSettings ++ | ||
headerSettings ++ | ||
versioningSettings | ||
VersionSettings.versioningSettings | ||
|
||
lazy val commonSettings = | ||
Seq( | ||
//version := "0.1.14", //automatically calculated by sbt-git | ||
//scalaVersion := "2.11.11", // taken from .travis.yml via sbt-travisci | ||
organization := "com.weightwatchers", | ||
mappings.in(Compile, packageBin) += baseDirectory.in(ThisBuild).value / "LICENSE" -> "LICENSE", | ||
scalacOptions ++= Seq( //http://tpolecat.github.io/2017/04/25/scalac-flags.html | ||
"-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. | ||
"-Xlint:by-name-right-associative", // By-name parameter of right associative operator. | ||
"-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-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. | ||
), | ||
scalacOptions ++= ScalacFlags.all, | ||
scalacOptions in (Compile, doc) ++= Seq( | ||
"-no-link-warnings" // Suppresses problems with Scaladoc @throws links | ||
), | ||
|
@@ -149,31 +109,6 @@ lazy val commonSettings = | |
scalafmtVersion := "1.3.0" | ||
) | ||
|
||
/* This allows to derive an sbt version string from the git information. | ||
* The logic goes as follows : | ||
* | ||
* IF the current commit is tagged with "vX.Y.Z" (ie semantic-versioning), the version is "X.Y.Z" | ||
* ELSE IF the current commit is tagged with "vX.Y.Z-Mx", the version is "X.Y.Z-Mx" | ||
* ELSE IF the latest found tag is "vX.Y.Z", the version is "X.Y.Z-commitsSinceVersion-gCommitHash-SNAPSHOT" | ||
* ELSE the version is "0.0.0-commitHash-SNAPSHOT" | ||
*/ | ||
val VersionRegex = "v([0-9]+.[0-9]+.[0-9]+)-?(.*)?".r | ||
val MilestoneRegex = "^M[0-9]$".r | ||
lazy val versioningSettings = | ||
Seq( | ||
git.baseVersion := "0.0.0", | ||
git.useGitDescribe := true, | ||
git.uncommittedSignifier := None, | ||
git.gitTagToVersionNumber := { | ||
case VersionRegex(v, "") => Some(v) //e.g. 1.0.0 | ||
case VersionRegex(v, s) if MilestoneRegex.findFirstIn(s).isDefined => | ||
Some(s"$v-$s") //e.g. 1.0.0-M1 | ||
case VersionRegex(v, "SNAPSHOT") => Some(s"$v-SNAPSHOT") //e.g. 1.0.0-SNAPSHOT | ||
case VersionRegex(v, s) => Some(s"$v-$s-SNAPSHOT") //e.g. 1.0.0-2-commithash-SNAPSHOT | ||
case _ => None | ||
} | ||
) | ||
|
||
import sbt.Keys.parallelExecution | ||
|
||
lazy val headerSettings = | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we nest them all in
modules/xxx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be a little cleaner to have all the code modules nested
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done