From a1e0e5b178f8c25d31d6295991a5524f323b39fd Mon Sep 17 00:00:00 2001 From: molarmanful Date: Sat, 26 Aug 2023 14:31:40 -0400 Subject: [PATCH] cross-platforming was a mistake --- .github/workflows/cmdoc.yml | 4 +- .github/workflows/release.yml | 4 +- README.md | 2 +- build.sc | 83 ++++++++----------- sclin/js/src/Main_JS.scala | 5 -- .../src/Main_JVM.scala => src/Main.scala} | 0 6 files changed, 38 insertions(+), 60 deletions(-) delete mode 100644 sclin/js/src/Main_JS.scala rename sclin/{jvm/src/Main_JVM.scala => src/Main.scala} (100%) diff --git a/.github/workflows/cmdoc.yml b/.github/workflows/cmdoc.yml index 5f94220..52ce1ff 100644 --- a/.github/workflows/cmdoc.yml +++ b/.github/workflows/cmdoc.yml @@ -23,9 +23,9 @@ jobs: distribution: temurin java-version: 19 - name: build - run: ./mill sclin.jvm.assembly + run: ./mill sclin.assembly - name: generate docs - run: ./mill sclin.jvm.cmdoc + run: ./mill sclin.cmdoc - name: run examples run: node docr.js sclin-docs/commands.md - name: commit + push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 606afad..ac6e8ed 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,7 +28,7 @@ jobs: SONATYPE_GPG_PASSWORD: ${{ secrets.SONATYPE_GPG_PASSWORD }} run: | ./mill mill.scalalib.PublishModule/publishAll \ - sclin._.publishArtifacts \ + __.publishArtifacts \ $SONATYPE_USERNAME:$SONATYPE_PASSWORD \ --gpgArgs --passphrase=$SONATYPE_GPG_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \ --sonatypeUri https://s01.oss.sonatype.org/service/local \ @@ -47,7 +47,7 @@ jobs: java-version: 19 - uses: coursier/cache-action@v6 - name: build - run: ./mill sclin.jvm.assembly + run: ./mill sclin.assembly - name: gh release uses: svenstaro/upload-release-action@v2 with: diff --git a/README.md b/README.md index 1ab76b0..35106fd 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Download the [latest executable JAR from releases](https://github.com/molarmanfu ### Building from Scratch -Clone this repo, `cd` into it, and run `./mill sclin.jvm.assembly` (use `mill.bat` instead of `mill` if on Windows). The built JAR can be found at `out/sclin/jvm/assembly.dest/out.jar`. +Clone this repo, `cd` into it, and run `./mill sclin.assembly` (use `mill.bat` instead of `mill` if on Windows). The built JAR can be found at `out/sclin/jvm/assembly.dest/out.jar`. ## Licensing diff --git a/build.sc b/build.sc index bb5dcf5..84fe5fe 100644 --- a/build.sc +++ b/build.sc @@ -5,65 +5,48 @@ import com.github.lolgab.mill.crossplatform._ import de.tobiasroeser.mill.vcs.version.VcsVersion import mill._ import scala.util.chaining._ -// import scalajslib._ import scalalib._ import scalalib.publish._ -object sclin extends CrossPlatform { - - trait Shared extends CrossPlatformScalaModule with PublishModule { - - def scalaVersion = "3.3.0" - override def publishVersion: T[String] = VcsVersion.vcsState().format() - def pomSettings = PomSettings( - description = "Scala implementation of lin", - organization = "io.github.molarmanful", - url = "https://github.com/molarmanful/sclin", - licenses = Seq(License.MIT), - versionControl = VersionControl.github("molarmanful", "sclin"), - developers = Seq( - Developer("molarmanful", "Ben Pang", "https://github.com/molarmanful") - ) - ) - def scalacOptions = Seq("-deprecation", "-feature") - def ivyDeps = Agg( - ivy"org.typelevel::spire::0.18.0", - ivy"com.lihaoyi::mainargs::0.5.1", - ivy"com.lihaoyi::fansi::0.4.0", - ivy"com.lihaoyi::upickle::3.1.2", - ivy"io.monix::monix::3.4.1" +object sclin extends ScalaModule with PublishModule { + + def scalaVersion = "3.3.0" + override def publishVersion: T[String] = VcsVersion.vcsState().format() + def pomSettings = PomSettings( + description = "Scala implementation of lin", + organization = "io.github.molarmanful", + url = "https://github.com/molarmanful/sclin", + licenses = Seq(License.MIT), + versionControl = VersionControl.github("molarmanful", "sclin"), + developers = Seq( + Developer("molarmanful", "Ben Pang", "https://github.com/molarmanful") ) + ) + def scalacOptions = Seq("-deprecation", "-feature") + def ivyDeps = Agg( + ivy"org.typelevel::spire:0.18.0", + ivy"com.lihaoyi::mainargs:0.5.1", + ivy"com.lihaoyi::fansi:0.4.0", + ivy"com.lihaoyi::upickle:3.1.2", + ivy"io.monix::monix:3.4.1", + ivy"com.lihaoyi::os-lib:0.9.1" + ) - object test extends ScalaTests with TestModule.Munit { + object test extends ScalaTests with TestModule.Munit { - def ivyDeps = Agg(ivy"org.scalameta::munit::1.0.0-M8") - - } + def ivyDeps = Agg(ivy"org.scalameta::munit::1.0.0-M8") } - object jvm extends Shared { - - def ivyDeps = super.ivyDeps() ++ Agg( - ivy"com.lihaoyi::os-lib:0.9.1" - ) - - def cmdoc() = T.command { - os.read - .lines(millSourcePath / "src" / "Lib.scala") - .dropWhile(_.trim != "// CMDOC START") - .takeWhile(_.trim != "// CMDOC END") - .tail - .pipe(docp.DocParser.parse) - .pipe(_.md) - .pipe(os.write.over(os.pwd / "sclin-docs" / "commands.md", _)) - } + def cmdoc() = T.command { + os.read + .lines(millSourcePath / "src" / "Lib.scala") + .dropWhile(_.trim != "// CMDOC START") + .takeWhile(_.trim != "// CMDOC END") + .tail + .pipe(docp.DocParser.parse) + .pipe(_.md) + .pipe(os.write.over(os.pwd / "sclin-docs" / "commands.md", _)) } - // object js extends Shared with ScalaJSModule { - - // def scalaJSVersion = "1.13.2" - // def moduleKind = scalajslib.api.ModuleKind.ESModule - - // } } diff --git a/sclin/js/src/Main_JS.scala b/sclin/js/src/Main_JS.scala deleted file mode 100644 index ffb6be9..0000000 --- a/sclin/js/src/Main_JS.scala +++ /dev/null @@ -1,5 +0,0 @@ -package sclin - -object Main: - - @main def run = ENV.run diff --git a/sclin/jvm/src/Main_JVM.scala b/sclin/src/Main.scala similarity index 100% rename from sclin/jvm/src/Main_JVM.scala rename to sclin/src/Main.scala