Skip to content

Commit f46365f

Browse files
committed
merge
2 parents 40bc124 + ee8af5c commit f46365f

File tree

3 files changed

+16
-54
lines changed

3 files changed

+16
-54
lines changed

build.mill

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ val communityBuildDottyVersion = sys.props.get("dottyVersion").toList
1414
val scala213Version = "2.13.14"
1515

1616
val scalaVersions = Seq(
17-
"3.3.1",
17+
"3.7.0-RC1",
1818
"2.12.17",
1919
scala213Version
2020
) ++ communityBuildDottyVersion
@@ -39,7 +39,8 @@ trait AcyclicModule extends ScalaModule {
3939
}
4040
def compileIvyDeps = acyclicDep
4141
def scalacPluginIvyDeps = acyclicDep
42-
def scalacOptions = super.scalacOptions() ++ acyclicOptions()
42+
def scalacOptions = super.scalacOptions() ++ acyclicOptions() ++
43+
Agg.when(scalaVersion().startsWith("3"))("-experimental")
4344
}
4445

4546
trait SafeDeps extends ScalaModule {
@@ -85,6 +86,8 @@ trait OsLibModule
8586
with SafeDeps
8687
with PlatformScalaModule { outer =>
8788

89+
def scalacPluginIvyDeps = super.scalacPluginIvyDeps() ++ Agg.when(scalaVersion().startsWith("2"))(ivy"com.lihaoyi::unroll-plugin:0.1.12")
90+
def ivyDeps = super.ivyDeps() ++ Agg.when(scalaVersion().startsWith("2"))(ivy"com.lihaoyi::unroll-annotation:0.1.12")
8891
def publishVersion = VcsVersion.vcsState().format()
8992
def pomSettings = PomSettings(
9093
description = artifactName(),
@@ -101,18 +104,20 @@ trait OsLibModule
101104
)
102105

103106
trait OsLibTestModule extends ScalaModule with TestModule.Utest with SafeDeps {
104-
def ivyDeps = Agg(Deps.utest, Deps.sourcecode)
107+
def ivyDeps = super.ivyDeps() ++ Agg(Deps.utest, Deps.sourcecode)
105108
// we check the textual output of system commands and expect it in english
106109
def forkEnv = super.forkEnv() ++ Map(
107110
"LC_ALL" -> "C",
108111
"TEST_SUBPROCESS_ENV" -> "value",
109112
"OS_TEST_RESOURCE_FOLDER" -> os.jvm(crossValue).test.resources().head.path.toString
110113
)
114+
def scalacOptions = super.scalacOptions() ++
115+
Agg.when(scalaVersion().startsWith("3"))("-experimental")
111116
}
112117
}
113118

114119
trait OsModule extends OsLibModule { outer =>
115-
def ivyDeps = Agg(Deps.geny)
120+
def ivyDeps = super.ivyDeps() ++ Agg(Deps.geny)
116121
override def compileIvyDeps = T {
117122
val scalaReflectOpt = Option.when(!ZincWorkerUtil.isDottyOrScala3(scalaVersion()))(
118123
Deps.scalaReflect(scalaVersion())
@@ -187,6 +192,8 @@ object os extends Module {
187192
object testSpawnExitHook extends ScalaModule{
188193
def scalaVersion = OsJvmModule.this.scalaVersion()
189194
def moduleDeps = Seq(OsJvmModule.this)
195+
def scalacOptions = super.scalacOptions() ++
196+
Agg.when(scalaVersion().startsWith("3"))("-experimental")
190197
}
191198
object testSpawnExitHook2 extends JavaModule
192199
}

os/src/FileOps.scala

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import java.nio.file.{Path => _, _}
1111
import java.nio.file.attribute.{FileAttribute, PosixFilePermission, PosixFilePermissions}
1212

1313
import scala.util.Try
14+
import scala.annotation.unroll
1415

1516
/**
1617
* Create a single directory at the specified path. Optionally takes in a
@@ -181,7 +182,7 @@ object copy {
181182
replaceExisting: Boolean = false,
182183
copyAttributes: Boolean = false,
183184
createFolders: Boolean = false,
184-
mergeFolders: Boolean = false
185+
@unroll mergeFolders: Boolean = false
185186
): Unit = {
186187
checker.value.onRead(from)
187188
checker.value.onWrite(to)
@@ -213,29 +214,6 @@ object copy {
213214
if (stat(from, followLinks = followLinks).isDir) for (p <- walk(from)) copyOne(p)
214215
}
215216

216-
/** This overload is only to keep binary compatibility with older os-lib versions. */
217-
@deprecated(
218-
"Use os.copy(from, to, followLinks, replaceExisting, copyAttributes, " +
219-
"createFolders, mergeFolders) instead",
220-
"os-lib 0.7.5"
221-
)
222-
def apply(
223-
from: Path,
224-
to: Path,
225-
followLinks: Boolean,
226-
replaceExisting: Boolean,
227-
copyAttributes: Boolean,
228-
createFolders: Boolean
229-
): Unit = apply(
230-
from = from,
231-
to = to,
232-
followLinks = followLinks,
233-
replaceExisting = replaceExisting,
234-
copyAttributes = copyAttributes,
235-
createFolders = createFolders,
236-
mergeFolders = false
237-
)
238-
239217
/**
240218
* Copy a file into a particular folder, rather
241219
* than into a particular path
@@ -248,7 +226,7 @@ object copy {
248226
replaceExisting: Boolean = false,
249227
copyAttributes: Boolean = false,
250228
createFolders: Boolean = false,
251-
mergeFolders: Boolean = false
229+
@unroll mergeFolders: Boolean = false
252230
): Unit = {
253231
os.copy(
254232
from,
@@ -260,29 +238,6 @@ object copy {
260238
mergeFolders
261239
)
262240
}
263-
264-
/** This overload is only to keep binary compatibility with older os-lib versions. */
265-
@deprecated(
266-
"Use os.copy.into(from, to, followLinks, replaceExisting, copyAttributes, " +
267-
"createFolders, mergeFolders) instead",
268-
"os-lib 0.7.5"
269-
)
270-
def apply(
271-
from: Path,
272-
to: Path,
273-
followLinks: Boolean,
274-
replaceExisting: Boolean,
275-
copyAttributes: Boolean,
276-
createFolders: Boolean
277-
): Unit = apply(
278-
from = from,
279-
to = to,
280-
followLinks = followLinks,
281-
replaceExisting = replaceExisting,
282-
copyAttributes = copyAttributes,
283-
createFolders = createFolders,
284-
mergeFolders = false
285-
)
286241
}
287242

288243
/**

os/src/Path.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,8 @@ object Path extends PathMacros {
477477
val f = implicitly[PathConvertible[T]].apply(f0)
478478
if (f.subpath(0, 1).toString != "~") if (base == null) Path(f0) else Path(f0, base)
479479
else {
480-
Path(System.getProperty("user.home"))(PathConvertible.StringConvertible) /
481-
RelPath(f.subpath(0, 1).relativize(f))(PathConvertible.NioPathConvertible)
480+
Path(System.getProperty("user.home"))(using PathConvertible.StringConvertible) /
481+
RelPath(f.subpath(0, 1).relativize(f))(using PathConvertible.NioPathConvertible)
482482
}
483483
}
484484

0 commit comments

Comments
 (0)