Skip to content

Commit

Permalink
Split project into core and cli
Browse files Browse the repository at this point in the history
  • Loading branch information
mdedetrich committed Nov 1, 2023
1 parent 0ba0637 commit 2f8bfe7
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
run: sbt '++ ${{ matrix.scala }}' test

- name: Compress target directories
run: tar cf targets.tar target core/target project/target
run: tar cf targets.tar target core/target cli/target project/target

- name: Upload target directories
uses: actions/upload-artifact@v3
Expand Down
31 changes: 22 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,27 @@ inThisBuild(Seq[Setting[_]](
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
)
),
headerLicense := Some(HeaderLicense.Custom("Copyright (C) Lightbend Inc. <https://www.lightbend.com>")),
))

lazy val root = (
project.in(file("."))
aggregate(core)
aggregate(core, cli)
settings(
name := buildName,
publish / skip := true,
publishArtifact := false,
publish := {},
publishLocal := {}
)
)

val AsmVersion = "9.6"

lazy val core = (
project.
lazy val core = project.
settings(
libraryDependencies ++= Seq(
"commons-cli" % "commons-cli" % "1.5.0",
"org.ow2.asm" % "asm" % AsmVersion,
"org.ow2.asm" % "asm-util" % AsmVersion,
"org.scala-lang" % "scalap" % System.getProperty("scalap.version", scalaVersion.value),
Expand All @@ -62,12 +64,23 @@ lazy val core = (
"ch.qos.logback" % "logback-classic" % "1.3.11",
"org.scalatest" %% "scalatest" % "3.2.17" % Test,
),
name := buildName + "-core",
headerLicense := Some(HeaderLicense.Custom("Copyright (C) Lightbend Inc. <https://www.lightbend.com>")),
name := buildName + "-core"
)

lazy val cli = project.
settings(
libraryDependencies ++= Seq(
"commons-cli" % "commons-cli" % "1.5.0",
),
name := buildName + "-cli",
assembly / assemblyMergeStrategy := {
case "rootdoc.txt" => MergeStrategy.discard
case x if x.endsWith("module-info.class") => MergeStrategy.discard
case x => (assembly / assemblyMergeStrategy).value(x)
},
)
)
// cli is not meant to be published
publish / skip := true,
publishArtifact := false,
publish := {},
publishLocal := {}
).dependsOn(core)

0 comments on commit 2f8bfe7

Please sign in to comment.