From 2f8bfe748f485600bbcccfd01ed1da987d430720 Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Wed, 1 Nov 2023 06:47:32 +0100 Subject: [PATCH] Split project into core and cli --- .github/workflows/ci.yml | 2 +- build.sbt | 31 +++++++++++++------ .../main/scala/scala/tools/jardiff/Main.scala | 0 3 files changed, 23 insertions(+), 10 deletions(-) rename {core => cli}/src/main/scala/scala/tools/jardiff/Main.scala (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e84012c..5fbc50d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/build.sbt b/build.sbt index 48a9533..136660f 100644 --- a/build.sbt +++ b/build.sbt @@ -34,25 +34,27 @@ inThisBuild(Seq[Setting[_]]( "SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}" ) ) - ) + ), + headerLicense := Some(HeaderLicense.Custom("Copyright (C) Lightbend Inc. ")), )) 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), @@ -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. ")), + 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) diff --git a/core/src/main/scala/scala/tools/jardiff/Main.scala b/cli/src/main/scala/scala/tools/jardiff/Main.scala similarity index 100% rename from core/src/main/scala/scala/tools/jardiff/Main.scala rename to cli/src/main/scala/scala/tools/jardiff/Main.scala