Skip to content

Commit

Permalink
Switch to Scala 3 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
romanowski committed Apr 20, 2022
1 parent 9b4f317 commit ac0f9ef
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 34 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,24 +186,6 @@ jobs:
- name: Check examples
run: bash ./scala-cli --jvm temurin:17 .github/scripts/check_examples.sc

migration-tests:
timeout-minutes: 120
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- uses: coursier/cache-action@v6.3
- uses: VirtusLab/scala-cli-setup@267af2f1ed4911180b4bb25619ca4a586753cbd1
with:
jvm: "temurin:17"
- name: Unit 3.x tests
run: |
./mill -i cli3.compile
./mill -i cli3.test
./mill -i _[3.1.1].test
checks:
timeout-minutes: 15
runs-on: ubuntu-latest
Expand Down
12 changes: 7 additions & 5 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,11 @@ import _root_.scala.util.Properties
implicit def millModuleBasePath: define.BasePath =
define.BasePath(super.millModuleBasePath.value / "modules")

object cli extends Cli
// remove once migrate to Scala 3
object cli3 extends Cli3
object cli extends Cli3

// remove once we do not have blockers with Scala 3
object cli2 extends Cli

object `cli-options` extends CliOptions
object `build-macros` extends Cross[BuildMacros](Scala.defaultInternal, Scala.scala3)
object options extends Cross[Options](Scala.defaultInternal, Scala.scala3)
Expand Down Expand Up @@ -134,7 +136,7 @@ object packager extends ScalaModule with Bloop.Module {
}

object `generate-reference-doc` extends SbtModule with ScalaCliScalafixModule {
def scalaVersion = Scala.defaultInternal
def scalaVersion = Scala.scala3
def scalacOptions = T {
super.scalacOptions() ++ Seq("-Ywarn-unused")
}
Expand Down Expand Up @@ -653,7 +655,7 @@ trait Cli3 extends Cli {
mainArgs = Seq(cache.toNIO.toString, classpath),
workingDir = os.pwd
)
val cp = res.out.text
val cp = res.out.lines.head
cp.split(File.pathSeparator).toSeq.map(p => mill.PathRef(os.Path(p)))
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package scala.cli.doc

import caseapp._

final case class InternalDocOptions(
outputDir: String = "website/docs/reference",
check: Boolean = false
) {
lazy val outputPath: os.Path =
os.Path(outputDir, os.pwd)
}

object InternalDocOptions {
implicit lazy val parser: Parser[InternalDocOptions] = Parser.derive
implicit lazy val help: Help[InternalDocOptions] = Help.derive
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import scala.build.preprocessing.directives.{
}
import scala.cli.ScalaCliCommands

object GenerateReferenceDoc extends CaseApp[Options] {
object GenerateReferenceDoc extends CaseApp[InternalDocOptions] {

private def cleanUpOrigin(origin: String): String = {
val origin0 = origin.takeWhile(_ != '[').stripSuffix("Options")
Expand Down Expand Up @@ -289,7 +289,7 @@ object GenerateReferenceDoc extends CaseApp[Options] {
b.toString
}

def run(options: Options, args: RemainingArgs): Unit = {
def run(options: InternalDocOptions, args: RemainingArgs): Unit = {

val scalaCli = new ScalaCliCommands("scala-cli", isSipScala = false)
val commands = scalaCli.commands
Expand Down

This file was deleted.

0 comments on commit ac0f9ef

Please sign in to comment.