Skip to content

Commit 3930117

Browse files
committed
.
1 parent 97bdcab commit 3930117

File tree

4 files changed

+359
-89
lines changed

4 files changed

+359
-89
lines changed

.github/workflows/actions.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
- test-jvm
7474
- test-js
7575
- test-native
76-
runs-on: ubuntu-22.04
76+
runs-on: ubuntu-latest
7777
env:
7878
MILL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
7979
MILL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
@@ -90,4 +90,15 @@ jobs:
9090
distribution: 'temurin'
9191
java-version: 11
9292
- name: Publish to Maven Central
93-
run: ./mill -i mill.scalalib.PublishModule/
93+
run: ./mill -i mill.scalalib.SonatypeCentralPublishModule/
94+
95+
- name: Create GitHub Release
96+
id: create_gh_release
97+
uses: actions/create-release@v1.1.4
98+
env:
99+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
100+
with:
101+
tag_name: ${{ github.ref }}
102+
release_name: ${{ github.ref }}
103+
draft: false
104+
~

.mill-version

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

build.mill

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1+
//| mill-version: 1.0.0-RC1-24-d74b52
2+
//| mill-jvm-opts: ["-XX:NonProfiledCodeHeapSize=500m", "-XX:ReservedCodeCacheSize=1000m"]
3+
//| mvnDeps:
4+
//| - com.github.lolgab::mill-mima_mill1.0.0-RC1:0.2.0-M1
15
package build
26
import mill._
37
import scalalib._
48
import scalajslib._
59
import scalanativelib._
610
import publish._
711
import mill.api.Result
8-
import mill.modules.Jvm.createJar
12+
import mill.util.Jvm.createJar
913

10-
import mill.scalalib.api.ZincWorkerUtil.isScala3
11-
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version::0.4.0`
12-
import $ivy.`com.github.lolgab::mill-mima::0.0.23`
14+
import mill.scalalib.api.JvmWorkerUtil.isScala3
1315

14-
import de.tobiasroeser.mill.vcs.version.VcsVersion
16+
import mill.main.VcsVersion
1517
import com.github.lolgab.mill.mima._
1618

1719
val scala3 = "3.3.3"
@@ -30,13 +32,13 @@ object fastparse extends Module{
3032
object js extends Cross[fastparseJsModule](crossVersions)
3133
trait fastparseJsModule extends FastparseModule with ScalaJSModule {
3234
def scalaJSVersion = scalaJS1
33-
private def sourceMapOptions = T.task {
35+
private def sourceMapOptions = Task.Anon {
3436
val vcsState = VcsVersion.vcsState()
3537
vcsState.lastTag.collect {
3638
case tag if vcsState.commitsSinceLastTag == 0 =>
3739
val baseUrl = pomSettings().url.replace("github.com", "raw.githubusercontent.com")
3840
val sourcesOptionName = if(isScala3(crossScalaVersion)) "-scalajs-mapSourceURI" else "-P:scalajs:mapSourceURI"
39-
s"$sourcesOptionName:${T.workspace.toIO.toURI}->$baseUrl/$tag/"
41+
s"$sourcesOptionName:${Task.workspace.toIO.toURI}->$baseUrl/$tag/"
4042
}
4143
}
4244

@@ -55,17 +57,17 @@ object fastparse extends Module{
5557
}
5658

5759
trait FastparseModule extends CommonCrossModule with Mima{
58-
def ivyDeps = Agg(
59-
ivy"com.lihaoyi::sourcecode::0.4.0",
60-
ivy"com.lihaoyi::geny::1.1.0"
60+
def mvnDeps = Seq(
61+
mvn"com.lihaoyi::sourcecode::0.4.0",
62+
mvn"com.lihaoyi::geny::1.1.0"
6163
)
6264

63-
def compileIvyDeps =
64-
if(isScala3(crossScalaVersion)) Agg.empty[Dep]
65-
else Agg(ivy"org.scala-lang:scala-reflect:$crossScalaVersion")
65+
def compileMvnDeps =
66+
if(isScala3(crossScalaVersion)) Seq.empty[Dep]
67+
else Seq(mvn"org.scala-lang:scala-reflect:$crossScalaVersion")
6668

67-
def generatedSources = T{
68-
val dir = T.ctx().dest
69+
def generatedSources = Task {
70+
val dir = Task.ctx().dest
6971
val file = dir/"fastparse"/"SequencerGen.scala"
7072
// Only go up to 21, because adding the last element makes it 22
7173
val tuples = (2 to 21).map{ i =>
@@ -99,14 +101,14 @@ trait FastparseModule extends CommonCrossModule with Mima{
99101

100102
override def scalacOptions =
101103
super.scalacOptions() ++
102-
Agg.when(scalaVersion() != scala3)(
104+
Seq(
103105
"-Xfatal-warnings",
104106
"-Xlint:unused",
105107
"-Wconf:cat=feature:s,cat=deprecation:s"
106-
)
108+
).filter(_ => scalaVersion() != scala3)
107109

108110
def mimaReportBinaryIssues() =
109-
if (this.isInstanceOf[ScalaNativeModule] || this.isInstanceOf[ScalaJSModule]) T.command()
111+
if (this.isInstanceOf[ScalaNativeModule] || this.isInstanceOf[ScalaJSModule]) Task.Command {}
110112
else super.mimaReportBinaryIssues()
111113

112114
def mimaPreviousVersions = Seq(
@@ -117,7 +119,7 @@ trait FastparseModule extends CommonCrossModule with Mima{
117119
)
118120

119121
def mimaPreviousArtifacts =
120-
if (isScala3(crossScalaVersion)) Agg.empty[Dep]
122+
if (isScala3(crossScalaVersion)) Seq.empty[Dep]
121123
else super.mimaPreviousArtifacts()
122124

123125
def mimaBinaryIssueFilters = super.mimaBinaryIssueFilters() ++ Seq(
@@ -170,10 +172,10 @@ trait ExampleParseJvmModule extends CommonCrossModule{
170172
def moduleDeps = Seq(fastparse.jvm())
171173

172174
object test extends ScalaTests with CommonTestModule{
173-
def ivyDeps = super.ivyDeps() ++ Agg(
174-
ivy"net.sourceforge.cssparser:cssparser:0.9.18",
175-
) ++ Agg.when(!isScala3(crossScalaVersion))(
176-
ivy"org.scala-lang:scala-compiler:$crossScalaVersion"
175+
def mvnDeps = super.mvnDeps() ++ Seq(
176+
mvn"net.sourceforge.cssparser:cssparser:0.9.18",
177+
) ++ Option.when(!isScala3(crossScalaVersion))(
178+
mvn"org.scala-lang:scala-compiler:$crossScalaVersion"
177179
)
178180
}
179181
}
@@ -202,24 +204,22 @@ trait CommonCrossModule extends CrossScalaModule with PublishModule with Platfor
202204
)
203205
)
204206

205-
def scalaDocPluginClasspath = T{ Agg[PathRef]() }
207+
def scalaDocPluginClasspath = Task { Seq[PathRef]() }
206208

207-
def sources = T.sources {
208-
super.sources() ++
209-
Agg(PathRef(millSourcePath / "src-2.12+"))
210-
}
209+
def newSources = Task.Sources("src-2.12+")
210+
def sources = Task { super.sources() ++ newSources() }
211211
}
212212

213-
trait CommonTestModule extends ScalaModule with TestModule.Utest{
214-
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.8.3")
213+
trait CommonTestModule extends ScalaModule with TestModule.Utest {
214+
def mvnDeps = Seq(mvn"com.lihaoyi::utest::0.8.3")
215215

216216
override def scalacOptions =
217217
super.scalacOptions() ++
218-
Agg.when(scalaVersion() != scala3)(
218+
Seq(
219219
"-Xfatal-warnings",
220220
"-Xlint:unused",
221221
"-Wconf:cat=feature:s,cat=deprecation:s"
222-
)
222+
).filter(_ => scalaVersion() != scala3)
223223
}
224224

225225
object perftests extends Module{
@@ -235,7 +235,7 @@ object perftests extends Module{
235235

236236
object benchScala33 extends PerfTestModule {
237237
def scalaVersion0 = scala3
238-
def sources = T.sources { bench2.sources() }
238+
def sources = Task { bench2.sources() }
239239
def moduleDeps = Seq(
240240
scalaparse.jvm(scala3).test,
241241
pythonparse.jvm(scala3).test,
@@ -253,30 +253,30 @@ object perftests extends Module{
253253
pythonparse.jvm(scala212).test
254254
)
255255

256-
def ivyDeps = super.ivyDeps() ++ Agg(
257-
ivy"org.json4s::json4s-ast:3.6.0",
258-
ivy"org.json4s::json4s-native:3.6.0",
259-
ivy"org.json4s::json4s-jackson:3.6.0",
260-
ivy"io.circe::circe-parser:0.9.1",
261-
ivy"io.argonaut::argonaut:6.2",
262-
ivy"com.typesafe.play::play-json:2.6.9",
263-
ivy"com.fasterxml.jackson.core:jackson-databind:2.9.4",
264-
ivy"com.lihaoyi::ujson:1.1.0",
265-
ivy"org.scala-lang.modules::scala-parser-combinators:1.1.1",
266-
ivy"org.python:jython:2.7.1b3"
256+
def mvnDeps = super.mvnDeps() ++ Seq(
257+
mvn"org.json4s::json4s-ast:3.6.0",
258+
mvn"org.json4s::json4s-native:3.6.0",
259+
mvn"org.json4s::json4s-jackson:3.6.0",
260+
mvn"io.circe::circe-parser:0.9.1",
261+
mvn"io.argonaut::argonaut:6.2",
262+
mvn"com.typesafe.play::play-json:2.6.9",
263+
mvn"com.fasterxml.jackson.core:jackson-databind:2.9.4",
264+
mvn"com.lihaoyi::ujson:1.1.0",
265+
mvn"org.scala-lang.modules::scala-parser-combinators:1.1.1",
266+
mvn"org.python:jython:2.7.1b3"
267267
)
268268
}
269269

270-
trait PerfTestModule extends ScalaModule with TestModule.Utest{
270+
trait PerfTestModule extends ScalaModule with TestModule.Utest {
271271
def scalaVersion0: String
272272
def scalaVersion = scalaVersion0
273273
def scalacOptions = Seq("-opt:l:method")
274-
def resources = T.sources{
275-
Seq(PathRef(perftests.millSourcePath / "resources")) ++
276-
fastparse.jvm(scalaVersion0).test.resources()
274+
def newResources = Task.Sources(perftests.moduleDir / "resources")
275+
def resources = Task {
276+
newResources() ++ fastparse.jvm(scalaVersion0).test.resources()
277277
}
278278

279-
def ivyDeps = Agg(ivy"com.lihaoyi::utest::0.8.3")
279+
def mvnDeps = Seq(mvn"com.lihaoyi::utest::0.8.3")
280280
}
281281
}
282282

@@ -290,8 +290,8 @@ object demo extends ScalaJSModule{
290290
fastparse.js(scala213).test,
291291
)
292292

293-
def ivyDeps = Agg(
294-
ivy"org.scala-js::scalajs-dom::0.9.8",
295-
ivy"com.lihaoyi::scalatags::0.9.3"
293+
def mvnDeps = Seq(
294+
mvn"org.scala-js::scalajs-dom::0.9.8",
295+
mvn"com.lihaoyi::scalatags::0.9.3"
296296
)
297297
}

0 commit comments

Comments
 (0)