Skip to content

Commit 3db6993

Browse files
committed
Merge remote-tracking branch 'origin/master' into community-build-2.13
2 parents 5b2935a + b222fcf commit 3db6993

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1381
-599
lines changed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# These are supported funding model platforms
2+
3+
github: lihaoyi

.github/workflows/actions.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches:
7+
- master
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-java@v1
15+
with:
16+
java-version: 8
17+
- name: Run tests
18+
run: ./mill -i __.publishArtifacts __.test
19+
20+
publish-sonatype:
21+
if: github.repository == 'com-lihaoyi/utest' && contains(github.ref, 'refs/tags/')
22+
needs: test
23+
runs-on: ubuntu-latest
24+
env:
25+
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
26+
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
27+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
28+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
29+
LANG: "en_US.UTF-8"
30+
LC_MESSAGES: "en_US.UTF-8"
31+
LC_ALL: "en_US.UTF-8"
32+
steps:
33+
- uses: actions/checkout@v2
34+
- uses: actions/setup-java@v1
35+
with:
36+
java-version: 8
37+
- name: Publish to Maven Central
38+
run: |
39+
if [[ $(git tag --points-at HEAD) != '' ]]; then
40+
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key
41+
gpg --import --no-tty --batch --yes gpg_key
42+
rm gpg_key
43+
./mill -i mill.scalalib.PublishModule/publishAll \
44+
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \
45+
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
46+
--publishArtifacts __.publishArtifacts \
47+
--readTimeout 600000 \
48+
--awaitTimeout 600000 \
49+
--release true \
50+
--signed true
51+
fi
52+
- name: Create GitHub Release
53+
id: create_gh_release
54+
uses: actions/[email protected]
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
57+
with:
58+
tag_name: ${{ github.ref }}
59+
release_name: ${{ github.ref }}
60+
body:
61+
draft: false

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
target/
22
*.iml
3-
.idea
3+
.idea
4+
out/

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

build.sc

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
import mill._, scalalib._, scalajslib._, scalanativelib._, publish._
2+
import $ivy.`de.tototec::de.tobiasroeser.mill.vcs.version_mill0.9:0.1.1`
3+
import de.tobiasroeser.mill.vcs.version.VcsVersion
24

5+
val dottyVersions = sys.props.get("dottyVersion").toList
6+
7+
val scalaVersions = "2.11.12" :: "2.12.13" :: "2.13.4" :: "3.0.0" :: dottyVersions
8+
val scala2Versions = scalaVersions.filter(_.startsWith("2."))
9+
10+
val scalaJSVersions = for {
11+
scalaV <- scalaVersions
12+
scalaJSV <- Seq("0.6.33", "1.5.1")
13+
if scalaV.startsWith("2.") || scalaJSV.startsWith("1.")
14+
} yield (scalaV, scalaJSV)
15+
16+
val scalaNativeVersions = for {
17+
scalaV <- scala2Versions
18+
scalaNativeV <- Seq("0.4.0")
19+
} yield (scalaV, scalaNativeV)
320

421
trait UtestModule extends PublishModule {
522
def artifactName = "utest"
623

7-
def publishVersion = "0.7.1"
24+
def publishVersion = VcsVersion.vcsState().format()
825

926
def pomSettings = PomSettings(
1027
description = artifactName(),
@@ -20,7 +37,7 @@ trait UtestModule extends PublishModule {
2037
)
2138
)
2239
}
23-
trait UtestMainModule extends CrossScalaModule {
40+
abstract class UtestMainModule(crossScalaVersion: String) extends CrossScalaModule {
2441
def millSourcePath = super.millSourcePath / offset
2542

2643
def offset: os.RelPath = os.rel
@@ -33,6 +50,14 @@ trait UtestMainModule extends CrossScalaModule {
3350
)
3451
)
3552
)
53+
override def docJar =
54+
if (crossScalaVersion.startsWith("2")) super.docJar
55+
else T {
56+
val outDir = T.ctx().dest
57+
val javadocDir = outDir / 'javadoc
58+
os.makeDir.all(javadocDir)
59+
mill.api.Result.Success(mill.modules.Jvm.createJar(Agg(javadocDir))(outDir))
60+
}
3661
}
3762

3863

@@ -56,44 +81,43 @@ trait UtestTestModule extends ScalaModule with TestModule {
5681
}
5782

5883
object utest extends Module {
59-
object jvm extends Cross[JvmUtestModule]("2.12.8", "2.13.0")
84+
object jvm extends Cross[JvmUtestModule](scalaVersions: _*)
6085
class JvmUtestModule(val crossScalaVersion: String)
61-
extends UtestMainModule with ScalaModule with UtestModule {
86+
extends UtestMainModule(crossScalaVersion) with ScalaModule with UtestModule {
6287
def ivyDeps = Agg(
63-
ivy"org.scala-sbt:test-interface::1.0",
64-
ivy"org.portable-scala::portable-scala-reflect::0.1.0",
88+
ivy"org.scala-sbt:test-interface::1.0"
89+
) ++ (if (crossScalaVersion.startsWith("2")) Agg(
90+
ivy"org.portable-scala::portable-scala-reflect::0.1.1",
6591
ivy"org.scala-lang:scala-reflect:$crossScalaVersion"
66-
)
92+
) else Agg())
6793
object test extends Tests with UtestTestModule{
6894
val crossScalaVersion = JvmUtestModule.this.crossScalaVersion
6995
}
7096
}
7197

72-
object js extends Cross[JsUtestModule](
73-
("2.12.8", "0.6.26"), ("2.13.0", "0.6.28")/*, ("2.12.8", "1.0.0-M8"), ("2.13.0", "1.0.0-M8")*/
74-
)
98+
object js extends Cross[JsUtestModule](scalaJSVersions: _*)
7599
class JsUtestModule(val crossScalaVersion: String, crossJSVersion: String)
76-
extends UtestMainModule with ScalaJSModule with UtestModule {
100+
extends UtestMainModule(crossScalaVersion) with ScalaJSModule with UtestModule {
77101
def offset = os.up
78102
def ivyDeps = Agg(
79-
ivy"org.scala-js::scalajs-test-interface:$crossJSVersion",
80-
ivy"org.portable-scala::portable-scala-reflect::0.1.0",
103+
ivy"org.scala-js::scalajs-test-interface:$crossJSVersion".withDottyCompat(crossScalaVersion),
104+
ivy"org.portable-scala::portable-scala-reflect::0.1.1".withDottyCompat(crossScalaVersion)
105+
) ++ (if(crossScalaVersion.startsWith("2")) Agg(
81106
ivy"org.scala-lang:scala-reflect:$crossScalaVersion"
82-
)
107+
) else Agg())
83108
def scalaJSVersion = crossJSVersion
84109
object test extends Tests with UtestTestModule{
85110
def offset = os.up
86111
val crossScalaVersion = JsUtestModule.this.crossScalaVersion
87112
}
88113
}
89114

90-
object native extends Cross[NativeUtestModule](("2.11.12", "0.3.8")/*, ("2.11.12", "0.4.0-M2")*/)
115+
object native extends Cross[NativeUtestModule](scalaNativeVersions: _*)
91116
class NativeUtestModule(val crossScalaVersion: String, crossScalaNativeVersion: String)
92-
extends UtestMainModule with ScalaNativeModule with UtestModule {
117+
extends UtestMainModule(crossScalaVersion) with ScalaNativeModule with UtestModule {
93118
def offset = os.up
94119
def ivyDeps = super.ivyDeps() ++ Agg(
95-
ivy"org.scala-native::test-interface::$crossScalaNativeVersion",
96-
ivy"org.scala-lang:scala-reflect:$crossScalaVersion",
120+
ivy"org.scala-native::test-interface::$crossScalaNativeVersion"
97121
)
98122

99123
def scalaNativeVersion = crossScalaNativeVersion

mill

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This is a wrapper script, that automatically download mill from GitHub release pages
44
# You can give the required mill version with MILL_VERSION env variable
55
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
6-
DEFAULT_MILL_VERSION=0.5.0
6+
DEFAULT_MILL_VERSION=0.9.6-61-bd7927
77

88
set -e
99

@@ -17,13 +17,24 @@ if [ -z "$MILL_VERSION" ] ; then
1717
fi
1818
fi
1919

20-
MILL_DOWNLOAD_PATH="$HOME/.mill/download"
21-
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/$MILL_VERSION"
20+
if [ "x${XDG_CACHE_HOME}" != "x" ] ; then
21+
MILL_DOWNLOAD_PATH="${XDG_CACHE_HOME}/mill/download"
22+
else
23+
MILL_DOWNLOAD_PATH="${HOME}/.cache/mill/download"
24+
fi
25+
MILL_EXEC_PATH="${MILL_DOWNLOAD_PATH}/${MILL_VERSION}"
26+
27+
version_remainder="$MILL_VERSION"
28+
MILL_MAJOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
29+
MILL_MINOR_VERSION="${version_remainder%%.*}"; version_remainder="${version_remainder#*.}"
2230

2331
if [ ! -x "$MILL_EXEC_PATH" ] ; then
2432
mkdir -p $MILL_DOWNLOAD_PATH
33+
if [ "$MILL_MAJOR_VERSION" -gt 0 ] || [ "$MILL_MINOR_VERSION" -ge 5 ] ; then
34+
ASSEMBLY="-assembly"
35+
fi
2536
DOWNLOAD_FILE=$MILL_EXEC_PATH-tmp-download
26-
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION-assembly"
37+
MILL_DOWNLOAD_URL="https://github.com/lihaoyi/mill/releases/download/${MILL_VERSION%%-*}/$MILL_VERSION${ASSEMBLY}"
2738
curl --fail -L -o "$DOWNLOAD_FILE" "$MILL_DOWNLOAD_URL"
2839
chmod +x "$DOWNLOAD_FILE"
2940
mv "$DOWNLOAD_FILE" "$MILL_EXEC_PATH"

readme.md

Lines changed: 46 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
µTest 0.7.1 [![Build Status][travis-badge]][travis-link] [![Gitter Chat][gitter-badge]][gitter-link]
1+
µTest 0.7.10 [![Build Status][travis-badge]][travis-link] [![Gitter Chat][gitter-badge]][gitter-link]
22
====================================================================================================
33

44
[travis-badge]: https://travis-ci.org/lihaoyi/utest.svg
@@ -80,15 +80,15 @@ can immediately begin defining and running tests programmatically.
8080

8181

8282
```scala
83-
libraryDependencies += "com.lihaoyi" %% "utest" % "0.7.1" % "test"
83+
libraryDependencies += "com.lihaoyi" %% "utest" % "0.7.10" % "test"
8484

8585
testFrameworks += new TestFramework("utest.runner.Framework")
8686
```
8787

8888
To use it with Scala.js or Scala-Native:
8989

9090
```scala
91-
libraryDependencies += "com.lihaoyi" %%% "utest" % "0.7.1" % "test"
91+
libraryDependencies += "com.lihaoyi" %%% "utest" % "0.7.10" % "test"
9292

9393
testFrameworks += new TestFramework("utest.runner.Framework")
9494
```
@@ -1329,6 +1329,49 @@ libraries are currently at.
13291329
Changelog
13301330
=========
13311331

1332+
0.7.10
1333+
-----
1334+
1335+
- Add support for Scala 3.0.0
1336+
1337+
0.7.9
1338+
-----
1339+
1340+
- Add support for Scala 3.0.0-RC3
1341+
- Bump Scala.js from 1.4.0 to 1.5.1
1342+
1343+
0.7.8
1344+
-----
1345+
1346+
- Add support for Scala 3.0.0-RC2
1347+
- Support Scala 3 on Scala.js
1348+
1349+
0.7.7
1350+
-----
1351+
1352+
- Re-publish to maven central only. The version 0.7.6 broke binary compatibility
1353+
with JDK 8.
1354+
1355+
0.7.6
1356+
-----
1357+
1358+
- Support for Scala-Native 0.4.x
1359+
1360+
0.7.4
1361+
-----
1362+
1363+
- Add support for Scala.js 1.0.0
1364+
1365+
0.7.3
1366+
-----
1367+
1368+
- Add support for Scala.js 1.0.0-RC2
1369+
1370+
0.7.2
1371+
-----
1372+
1373+
- Add support for Scala.js 1.0.0-RC1
1374+
13321375
0.7.1
13331376
-----
13341377

utest/js/src/utest/PlatformShims.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.concurrent.Future
44
import org.portablescala.reflect.Reflect
55

66
/**
7-
* Platform specific stuff that differs between JVM and JS
7+
* Platform specific stuff that differs between JVM, JS and Native
88
*/
99
object PlatformShims {
1010
def await[T](f: Future[T]): T = {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package utest
2+
3+
object TestUtil {
4+
5+
lazy val isDotty = false
6+
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package utest
2+
3+
object TestUtil {
4+
5+
lazy val isDotty = true
6+
7+
}

0 commit comments

Comments
 (0)