Skip to content

Commit

Permalink
Merge pull request #34 from SethTisue/modern-syntax
Browse files Browse the repository at this point in the history
use modern scala-cli syntax everywhere
  • Loading branch information
SethTisue authored Oct 16, 2023
2 parents 758c63e + 08ee2c0 commit 7b79b49
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 34 deletions.
10 changes: 5 additions & 5 deletions Toolkit.js.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//> using scala "2.13", "3"
//> using publish.name "toolkit"
//> using lib "com.softwaremill.sttp.client4::core::4.0.0-M1"
//> using lib "com.softwaremill.sttp.client4::upickle::4.0.0-M1"
//> using lib "com.lihaoyi::upickle::3.1.0"
//> using scala 2.13, 3
//> using publish.name toolkit
//> using dep com.softwaremill.sttp.client4::core::4.0.0-M1
//> using dep com.softwaremill.sttp.client4::upickle::4.0.0-M1
//> using dep com.lihaoyi::upickle::3.1.0
12 changes: 6 additions & 6 deletions Toolkit.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//> using scala "2.13", "3"
//> using publish.name "toolkit"
//> using lib "com.softwaremill.sttp.client4::core::4.0.0-M1"
//> using lib "com.softwaremill.sttp.client4::upickle::4.0.0-M1"
//> using lib "com.lihaoyi::upickle::3.1.0"
//> using lib "com.lihaoyi::os-lib::0.9.1"
//> using scala 2.13, 3
//> using publish.name toolkit
//> using dep com.softwaremill.sttp.client4::core::4.0.0-M1
//> using dep com.softwaremill.sttp.client4::upickle::4.0.0-M1
//> using dep com.lihaoyi::upickle::3.1.0
//> using dep com.lihaoyi::os-lib::0.9.1
6 changes: 3 additions & 3 deletions ToolkitTest.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
//> using scala "2.13", "3"
//> using publish.name "toolkit-test"
//> using lib "org.scalameta::munit::1.0.0-M7"
//> using scala 2.13, 3
//> using publish.name toolkit-test
//> using dep org.scalameta::munit::1.0.0-M7
2 changes: 1 addition & 1 deletion checks/Changelog.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private def publish(flag: Option[String]) =
val moduleDep = s"${Config.organization}::$dep::${Config.developmentVersion}"
os.write.append(copy, s"\n//> using dep ${moduleDep}")
copy.toString
os.proc("scala-cli", "--power", "publish", "local", "--cross", flag.map(f => s"--$f").toList, "--organization", Config.organization, "--version", Config.developmentVersion.toString, file).call()
os.proc("scala-cli", "--power", "publish", "local", "--cross", flag.map(f => s"--$f").toList, "--organization", Config.organization, "--project-version", Config.developmentVersion.toString, file).call()

@main
def main(args: String*) =
Expand Down
8 changes: 4 additions & 4 deletions checks/test/ChangelogTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ object ChangelogTest:
// scala-cli config file write
os.temp(s"""
|//> using scala 2.13, 3
|//> using publish.name "$id"
|${deps.map(d => s"//> using lib $d").mkString("\n")}
|//> using publish.version "$version"
|//> using publish.organization "com.example"
|//> using publish.name $id
|${deps.map(d => s"//> using dep $d").mkString("\n")}
|//> using publish.version $version
|//> using publish.organization com.example
| """.stripMargin, suffix = ".scala")

private def publish(id: String, version: String, deps: List[String], skip: List[String] = Nil) =
Expand Down
2 changes: 1 addition & 1 deletion examples/DirGetTotalSize.sc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using toolkit "latest"
//> using toolkit latest

val totalSize = os.walk.stream.attrs(os.pwd)
.collect { case (path, attrs) if attrs.isFile => attrs.size }
Expand Down
2 changes: 1 addition & 1 deletion examples/FileReadText.sc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using toolkit "latest"
//> using toolkit latest

val text = os.read(os.pwd / "resources" / "File.txt")
println(text)
2 changes: 1 addition & 1 deletion examples/JsonReading.sc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using toolkit "latest"
//> using toolkit latest

import upickle.default._

Expand Down
2 changes: 1 addition & 1 deletion examples/JsonWriting.sc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using toolkit "latest"
//> using toolkit latest

import upickle.default._

Expand Down
2 changes: 1 addition & 1 deletion examples/RequestGet.sc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using toolkit "latest"
//> using toolkit latest

import sttp.client4.quick.*

Expand Down
2 changes: 1 addition & 1 deletion examples/RequestPost.sc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//> using toolkit "latest"
//> using toolkit latest

import sttp.client4.quick.*

Expand Down
4 changes: 2 additions & 2 deletions examples/SimpleTest.test.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//> using toolkit "latest"
//> using dep "org.scala-lang::toolkit-test:latest.stable"
//> using toolkit latest
//> using dep org.scala-lang::toolkit-test:latest.stable
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TODO: remove when scala-cli supports toolkit-test

class MathSuite extends munit.FunSuite {
Expand Down
14 changes: 7 additions & 7 deletions publish-conf.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//> using publish.organization "org.scala-lang"
//> using publish.computeVersion "git:tag"
//> using publish.url "https://github.com/scala/toolkit"
//> using publish.vcs "github:scala/toolkit"
//> using publish.license "Apache-2.0"
//> using publish.repository "central"
//> using publish.organization org.scala-lang
//> using publish.computeVersion git:tag
//> using publish.url https://github.com/scala/toolkit
//> using publish.vcs github:scala/toolkit
//> using publish.license Apache-2.0
//> using publish.repository central
//> using publish.developer "szymon-rd|Simon R|https://github.com/szymon-rd"
//> using publish.developer "adpi2|Adrien Piquerez|https://github.com/adpi2"
//> using repository "sonatype:public"
//> using repository sonatype:public

0 comments on commit 7b79b49

Please sign in to comment.