Skip to content

Commit b767272

Browse files
authored
Merge pull request #40 from Quafadas/mill1
mill 1.0
2 parents 11cd65e + f7ff008 commit b767272

24 files changed

+319
-177
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
pull_request:
55
branches: ['**', '!update/**', '!pr/**']
66
push:
7-
branches: ['**', '!update/**', '!pr/**']
7+
branches: ['main']
88
tags: [v*]
99

1010
env:
@@ -22,15 +22,15 @@ jobs:
2222
matrix:
2323
os: [ubuntu-latest]
2424
scala: [3]
25-
java: [temurin@17]
25+
java: [temurin@21]
2626
project: [jvm]
2727
runs-on: ${{ matrix.os }}
2828
timeout-minutes: 60
2929
steps:
3030
- uses: taiki-e/install-action@just
3131
- uses: coursier/setup-action@main
3232
with:
33-
jvm: temurin@17
33+
jvm: temurin@21
3434
apps: scala-cli
3535
- name: Checkout current branch (full)
3636
uses: actions/checkout@main
@@ -58,11 +58,8 @@ jobs:
5858
- name: compile
5959
run: ./mill __.compile
6060

61-
# Sometimes the tests will timeout if they have to fetch all the transitive scala-js deps the first time... let's have coursier put them in the cache
62-
- name: cache test deps
63-
run: |
64-
cs fetch com.raquo:laminar_sjs1_3:17.2.0
65-
cs fetch org.scala-js:scalajs-dom_sjs1_3:2.8.0
61+
- name: scala-cli version
62+
run: scala-cli compile -e "()" --platform js && scala-cli run -e "()"
6663

6764
- name: Test
6865
run: ./mill __.test
@@ -79,7 +76,7 @@ jobs:
7976

8077
- uses: coursier/setup-action@main
8178
with:
82-
jvm: temurin@17
79+
jvm: temurin@21
8380
apps: scala-cli
8481

8582
- name: Import GPG key
@@ -112,7 +109,7 @@ jobs:
112109
steps:
113110
- uses: coursier/setup-action@main
114111
with:
115-
jvm: temurin@17
112+
jvm: temurin@21
116113
apps: scala-cli
117114
- uses: actions/checkout@main
118115
with:

.mill-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

.scalafmt.conf

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.8.3"
1+
version = "3.9.7"
22
project.git = true
33

44
runner.dialect = scala3
@@ -14,5 +14,4 @@ rewrite.scala3.insertEndMarkerMinLines = 1
1414
newlines.beforeCurlyLambdaParams = multiline
1515
newlines.avoidForSimpleOverflow = [tooLong]
1616
newlines.selectChains = "unfold"
17-
maxColumn = 120
18-
project.excludeFilters = [ ".*/build\\.sc" ]
17+
maxColumn = 120

build.mill

Lines changed: 33 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,41 @@
1-
import os.copy.over
2-
import $ivy.`io.github.quafadas::millSite::0.0.24`
3-
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
4-
import $ivy.`com.goyeau::mill-scalafix::0.4.0`
5-
import $file.playwrightVersion // used to cache in GHA
1+
//| mill-version: 1.0.3
2+
//| mill-jvm-version: 21
3+
//| mvnDeps:
4+
//| - com.goyeau::mill-scalafix::0.6.0
5+
//| - com.lihaoyi::mill-contrib-buildinfo:$MILL_VERSION
6+
67

7-
import io.github.quafadas.millSite._
8+
import os.copy.over
9+
// import io.github.quafadas.millSite._
810
import mill._, scalalib._, publish._, scalanativelib._
911
import mill.scalalib.scalafmt.ScalafmtModule
10-
import de.tobiasroeser.mill.vcs.version._
12+
import mill.util.*
1113

1214
import com.goyeau.mill.scalafix.ScalafixModule
1315
import java.text.Format
1416

15-
object V{
16-
val scalaLts = "3.3.5"
1717

18+
object V{
19+
val scalaLts = "3.3.6"
20+
val pwV = build.pwV
1821
val http4sVersion = "0.23.30"
1922
val circeVersion = "0.14.10"
23+
val scalaVersion = "3.7.2"
24+
val laminar = "17.2.1"
25+
val scalaJsDom = "2.8.1"
26+
val scalaJs = "1.19.0"
2027
}
2128

2229
trait FormatFix extends ScalafmtModule with ScalafixModule with ScalaModule
2330

2431
trait FormatFixPublish extends ScalaModule with FormatFix with PublishModule{
25-
override def scalaVersion = "3.6.4"
32+
override def scalaVersion = V.scalaVersion
2633

27-
override def scalacOptions: Target[Seq[String]] = super.scalacOptions() ++ Seq("-Wunused:all")
34+
override def scalacOptions = super.scalacOptions() ++ Seq("-Wunused:all")
2835

2936
def publishVersion = VcsVersion.vcsState().format()
3037

31-
override def pomSettings = T {
38+
override def pomSettings = Task {
3239
PomSettings(
3340
description = "An experimental live server for scala JS projects",
3441
organization = "io.github.quafadas",
@@ -46,79 +53,33 @@ trait FormatFixPublish extends ScalaModule with FormatFix with PublishModule{
4653

4754
trait Testy extends TestModule.Munit with FormatFix {
4855

49-
override def defaultCommandName(): String = "test"
56+
override def defaultTask(): String = "testForked"
5057

51-
def ivyDeps = super.ivyDeps() ++ sjsls.ivyDeps() ++ Seq(
52-
ivy"org.typelevel::munit-cats-effect::2.0.0",
53-
ivy"org.scalameta::munit::1.1.0",
54-
ivy"com.lihaoyi::os-lib:0.11.4"
58+
def mvnDeps = super.mvnDeps() ++ sjsls.mvnDeps() ++ Seq(
59+
mvn"org.typelevel::munit-cats-effect::2.0.0",
60+
mvn"org.scalameta::munit::1.1.0",
61+
mvn"com.lihaoyi::os-lib:0.11.4"
5562
)
5663

5764
}
5865

59-
object routes extends FormatFixPublish {
60-
61-
def scalaVersion: T[String] = V.scalaLts
62-
63-
def ivyDeps = Agg(
64-
ivy"org.http4s::http4s-core:${V.http4sVersion}",
65-
ivy"org.http4s::http4s-client:${V.http4sVersion}",
66-
ivy"org.http4s::http4s-server:${V.http4sVersion}",
67-
ivy"org.http4s::http4s-dsl::${V.http4sVersion}",
68-
ivy"com.outr::scribe-cats::3.15.0"
69-
)
70-
71-
override def artifactName = "frontend-routes"
72-
73-
object test extends Testy with ScalaTests{
74-
def ivyDeps = super.ivyDeps() ++ sjsls.ivyDeps()
75-
}
76-
77-
}
78-
79-
object sjsls extends FormatFixPublish {
80-
81-
override def scalaVersion = V.scalaLts
66+
object SiteUnidoc extends ScalaModule, UnidocModule :
67+
def scalaVersion = V.scalaVersion
68+
def moduleDeps = Seq(build.sjsls, build.routes)
8269

83-
def ivyDeps = super.ivyDeps() ++ Seq(
84-
ivy"org.http4s::http4s-ember-server::${V.http4sVersion}",
85-
ivy"org.http4s::http4s-ember-client::${V.http4sVersion}",
86-
ivy"org.http4s::http4s-scalatags::0.25.2",
87-
ivy"io.circe::circe-core::${V.circeVersion}",
88-
ivy"io.circe::circe-generic::${V.circeVersion}",
89-
ivy"co.fs2::fs2-io::3.11.0",
90-
ivy"com.lihaoyi::scalatags::0.13.1",
91-
ivy"com.monovore::decline::2.5.0",
92-
ivy"com.monovore::decline-effect::2.5.0",
93-
94-
)
70+
def unidocDocumentTitle = Task { "Scala JS Live Server Docs" }
71+
def unidocVersion = Some(VcsVersion.vcsState().format())
9572

96-
def moduleDeps = Seq(routes)
9773

98-
def artifactName = "sjsls"
74+
// def scalaVersion = sjsls.scalaVersion
9975

100-
object test extends Testy with ScalaTests {
101-
def ivyDeps = super.ivyDeps() ++ sjsls.ivyDeps() ++ Seq(
102-
103-
ivy"com.microsoft.playwright:playwright:${playwrightVersion.pwV}",
104-
ivy"com.microsoft.playwright:driver-bundle:${playwrightVersion.pwV}"
105-
)
106-
}
107-
//def scalaNativeVersion = "0.4.17" // aspirational :-)
108-
109-
}
110-
111-
object site extends SiteModule {
112-
113-
def scalaVersion = sjsls.scalaVersion
114-
115-
override def moduleDeps = Seq(sjsls)
116-
}
76+
// override def moduleDeps = Seq(sjsls)
77+
// }
11778

11879
// SN deps which aren't yet there.
11980
/**
12081
1 targets failed
121-
project.resolvedIvyDeps
82+
project.resolvedmvnDeps
12283
Resolution failed for 2 modules:
12384
--------------------------------------------
12485
com.outr:scribe-cats_native0.4_3:3.13.5

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,7 @@ format:
5959
fix:
6060
./mill __.fix
6161

62+
serveUnidoc:
63+
cs launch io.github.quafadas::sjsls:0.2.8 -- --path-to-index-html C:\live-server-scala-cli-js\out\SiteUnidoc\unidocLocal.dest --build-tool none
64+
6265
gha: setupMill setupPlaywright test

0 commit comments

Comments
 (0)