Skip to content

Commit

Permalink
Merge pull request #158 from mdedetrich/split-project-core-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
SethTisue authored Nov 2, 2023
2 parents 003c430 + f7fc701 commit 69ccd21
Show file tree
Hide file tree
Showing 4 changed files with 35 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
12 changes: 12 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Core JAR

* [ ] create and tag the release via the GitHub web UI
* [ ] check the GitHub Actions log to see that publishing succeeded
* [ ] wait for the artifact to appear on Maven Central

## CLI jar

* [ ] locally, on JDK 8, run `sbt cli/assembly`
* [ ] rename the resulting JAR to just `jardiff.jar`
* [ ] attach the JAR to the release in the GitHub web UI
* [ ] PR the change to the [homebrew formula](https://github.com/retronym/homebrew-formulas/blob/master/jardiff.rb), using `shasum -a 256 jardiff.jar` to compute the SHA
31 changes: 22 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ inThisBuild(Seq[Setting[_]](
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
)
),
headerLicense := Some(HeaderLicense.Custom("Copyright (C) Lightbend Inc. <https://www.lightbend.com>")),
))

ThisBuild / publishMavenStyle := true
Expand All @@ -44,20 +45,21 @@ ThisBuild / pomIncludeRepository := (_ => false)

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.6.0",
"org.ow2.asm" % "asm" % AsmVersion,
"org.ow2.asm" % "asm-util" % AsmVersion,
"org.scala-lang" % "scalap" % System.getProperty("scalap.version", scalaVersion.value),
Expand All @@ -67,12 +69,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.6.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 69ccd21

Please sign in to comment.