summaryrefslogtreecommitdiff
path: root/integration/test/resources
diff options
context:
space:
mode:
Diffstat (limited to 'integration/test/resources')
-rw-r--r--integration/test/resources/ammonite/build.sc4
-rw-r--r--integration/test/resources/jawn/build.sc5
-rw-r--r--integration/test/resources/play-json/build.sc36
-rw-r--r--integration/test/resources/play-json/headers.sc10
-rw-r--r--integration/test/resources/play-json/jmh.sc16
-rw-r--r--integration/test/resources/play-json/mima.sc4
-rw-r--r--integration/test/resources/play-json/reformat.sc12
-rwxr-xr-xintegration/test/resources/play-json/release.sh2
-rw-r--r--integration/test/resources/upickle/build.sc2
9 files changed, 47 insertions, 44 deletions
diff --git a/integration/test/resources/ammonite/build.sc b/integration/test/resources/ammonite/build.sc
index c26d5050..34f80825 100644
--- a/integration/test/resources/ammonite/build.sc
+++ b/integration/test/resources/ammonite/build.sc
@@ -65,8 +65,8 @@ object amm extends Cross[MainModule](fullCrossScalaVersions:_*){
)
def generatedSources = T{
- import ammonite.ops._
- cp(build.millSourcePath/'project/"Constants.scala", T.ctx().dest/"Constants.scala")
+
+ os.copy(build.millSourcePath/'project/"Constants.scala", T.ctx().dest/"Constants.scala")
Seq(PathRef(T.ctx().dest))
}
}
diff --git a/integration/test/resources/jawn/build.sc b/integration/test/resources/jawn/build.sc
index deb9731a..8b58efc7 100644
--- a/integration/test/resources/jawn/build.sc
+++ b/integration/test/resources/jawn/build.sc
@@ -1,10 +1,9 @@
import mill.scalalib
import mill.Cross
import mill.scalalib.{Dep, TestModule, DepSyntax, Lib}
-import ammonite.ops.up
object jawn extends Cross[JawnModule]("2.10.6", "2.11.11", "2.12.3")
class JawnModule(crossVersion: String) extends mill.Module{
- override def millSourcePath = super.millSourcePath / up / up
+ override def millSourcePath = super.millSourcePath / os.up / os.up
trait JawnModule extends scalalib.SbtModule{
def scalaVersion = crossVersion
@@ -53,7 +52,7 @@ class JawnModule(crossVersion: String) extends mill.Module{
object rojoma extends Support(ivy"com.rojoma::rojoma-json:2.4.3")
object rojomaV3 extends Support(ivy"com.rojoma::rojoma-json-v3:3.7.2"){
- override def millSourcePath = super.millSourcePath / up / "rojoma-v3"
+ override def millSourcePath = super.millSourcePath / os.up / "rojoma-v3"
}
object spray extends Support(ivy"io.spray::spray-json:1.3.3")
}
diff --git a/integration/test/resources/play-json/build.sc b/integration/test/resources/play-json/build.sc
index d4557011..54e63d65 100644
--- a/integration/test/resources/play-json/build.sc
+++ b/integration/test/resources/play-json/build.sc
@@ -10,7 +10,7 @@ import jmh.Jmh
import headers.Headers
import com.typesafe.tools.mima.core._
-import ammonite.ops._
+
import mill.define.Task
val ScalaVersions = Seq("2.10.7", "2.11.12", "2.12.4", "2.13.0-M3")
@@ -52,7 +52,7 @@ trait PlayJsonModule extends BaseModule with PublishModule with MiMa {
abstract class PlayJson(val platformSegment: String) extends PlayJsonModule {
def crossScalaVersion: String
- def millSourcePath = pwd / "play-json"
+ def millSourcePath = os.pwd / "play-json"
def artifactName = "play-json"
def sources = T.sources(
@@ -90,10 +90,10 @@ abstract class PlayJson(val platformSegment: String) extends PlayJsonModule {
)
def generatedSources = T {
- import ammonite.ops._
+
val dir = T.ctx().dest
- mkdir(dir / "play-json")
+ os.makeDir.all(dir / "play-json")
val file = dir / "play-json" / "Generated.scala"
val (writes, reads) = (1 to 22).map { i =>
@@ -126,7 +126,7 @@ abstract class PlayJson(val platformSegment: String) extends PlayJsonModule {
""")
}.unzip
- write(file, s"""
+ os.write(file, s"""
package play.api.libs.json
trait GeneratedReads {
@@ -168,7 +168,11 @@ class PlayJsonJvm(val crossScalaVersion: String) extends PlayJson("jvm") {
)
def sources = {
- val docSpecs = ls.rec(millSourcePath / up / "docs" / "manual" / "working" / "scalaGuide").filter(_.isDir).filter(_.last=="code").map(PathRef(_))
+ val docSpecs = os.walk(millSourcePath / os.up / "docs" / "manual" / "working" / "scalaGuide")
+ .filter(os.isDir)
+ .filter(_.last=="code")
+ .map(PathRef(_))
+
T.sources(
docSpecs ++
Seq(
@@ -213,7 +217,7 @@ class PlayJsonJs(val crossScalaVersion: String) extends PlayJson("js") with Scal
}
trait PlayFunctional extends PlayJsonModule {
- def millSourcePath = pwd / "play-functional"
+ def millSourcePath = os.pwd / "play-functional"
def artifactName = "play-functional"
}
@@ -229,7 +233,7 @@ object playJoda extends Cross[PlayJoda](ScalaVersions:_*)
class PlayJoda(val crossScalaVersion: String) extends PlayJsonModule {
def moduleDeps = Seq(playJsonJvm(crossScalaVersion))
- def millSourcePath = pwd / "play-json-joda"
+ def millSourcePath = os.pwd / "play-json-joda"
def artifactName = "play-json-joda"
def ivyDeps = Agg(
@@ -250,7 +254,7 @@ object benchmarks extends Cross[Benchmarks](ScalaVersions:_*)
class Benchmarks(val crossScalaVersion: String) extends BaseModule with Jmh {
def moduleDeps = Seq(playJsonJvm(crossScalaVersion))
- def millSourcePath = pwd / "benchmarks"
+ def millSourcePath = os.pwd / "benchmarks"
}
// TODO: we should have a way to "take all modules in this build"
@@ -322,7 +326,7 @@ def validateCode() = T.command {
*/
object release extends Module {
- implicit val wd = pwd
+ implicit val wd = os.pwd
val versionFile = wd / "version.sc"
@@ -345,27 +349,27 @@ object release extends Module {
def setReleaseVersion = T {
T.ctx.log.info(s"Setting release version to ${releaseVersion}")
- write.over(
+ os.write.over(
versionFile,
s"""def current = "${releaseVersion}"
|
""".stripMargin
)
- %%("git", "commit", "-am", s"Setting release version to ${releaseVersion}")
- %%("git", "tag", s"$releaseVersion")
+ os.proc("git", "commit", "-am", s"Setting release version to ${releaseVersion}").call()
+ os.proc("git", "tag", s"$releaseVersion").call()
}
def setNextVersion = T {
T.ctx.log.info(s"Setting next version to ${nextVersion}")
- write.over(
+ os.write.over(
versionFile,
s"""def current = "${nextVersion}""""
)
- %%("git", "commit", "-am", s"Setting next version to ${nextVersion}")
- %%("git", "push", "origin", "master", "--tags")
+ os.proc("git", "commit", "-am", s"Setting next version to ${nextVersion}").call()
+ os.proc("git", "push", "origin", "master", "--tags").call()
}
}
diff --git a/integration/test/resources/play-json/headers.sc b/integration/test/resources/play-json/headers.sc
index a66eaedd..9737cb3d 100644
--- a/integration/test/resources/play-json/headers.sc
+++ b/integration/test/resources/play-json/headers.sc
@@ -1,6 +1,6 @@
import $ivy.`com.github.rockjam::license-headers:0.0.1`
-import ammonite.ops._
+
import mill._, scalalib._
import mill.eval.PathRef
import de.heikoseeberger.sbtheader.{CommentStyle, FileType, HeaderCreator, License}
@@ -24,7 +24,7 @@ trait Headers extends ScalaModule {
val updatedFiles = withoutHeaders.map {
case (file, updated) =>
- write.over(file, updated)
+ os.write.over(file, updated)
file
}
@@ -47,15 +47,15 @@ trait Headers extends ScalaModule {
private def filesWithoutHeaders(input: Seq[PathRef]) = {
for {
- ref <- input if exists(ref.path)
- file <- ls.rec(ref.path) if file.isFile
+ ref <- input if os.exists(ref.path)
+ file <- os.walk(ref.path) if os.isFile(file)
(fileType, commentStyle) <- headerMappings.get(file.ext)
updatedContent <- HeaderCreator(
fileType,
commentStyle,
license,
log = _ => (),
- read.getInputStream(file)
+ os.read.inputStream(file)
).createText
} yield file -> updatedContent
}
diff --git a/integration/test/resources/play-json/jmh.sc b/integration/test/resources/play-json/jmh.sc
index 76ed43fc..3c2c8411 100644
--- a/integration/test/resources/play-json/jmh.sc
+++ b/integration/test/resources/play-json/jmh.sc
@@ -1,4 +1,4 @@
-import ammonite.ops._
+
import mill._, scalalib._, modules._
trait Jmh extends ScalaModule {
@@ -19,13 +19,13 @@ trait Jmh extends ScalaModule {
def compileGeneratedSources = T {
val dest = T.ctx.dest
val (sourcesDir, _) = generateBenchmarkSources()
- val sources = ls.rec(sourcesDir).filter(_.isFile)
- %%("javac",
+ val sources = os.walk(sourcesDir).filter(os.isFile)
+ os.proc("javac",
sources.map(_.toString),
"-cp",
(runClasspath() ++ generatorDeps()).map(_.path.toString).mkString(":"),
"-d",
- dest)(wd = dest)
+ dest).call(dest)
PathRef(dest)
}
@@ -36,10 +36,10 @@ trait Jmh extends ScalaModule {
val sourcesDir = dest / 'jmh_sources
val resourcesDir = dest / 'jmh_resources
- rm(sourcesDir)
- mkdir(sourcesDir)
- rm(resourcesDir)
- mkdir(resourcesDir)
+ os.remove.all(sourcesDir)
+ os.makeDir.all(sourcesDir)
+ os.remove.all(resourcesDir)
+ os.makeDir.all(resourcesDir)
Jvm.subprocess(
"org.openjdk.jmh.generators.bytecode.JmhBytecodeGenerator",
diff --git a/integration/test/resources/play-json/mima.sc b/integration/test/resources/play-json/mima.sc
index 3902f2c7..baca333c 100644
--- a/integration/test/resources/play-json/mima.sc
+++ b/integration/test/resources/play-json/mima.sc
@@ -1,4 +1,4 @@
-import ammonite.ops._
+
import $ivy.`com.typesafe::mima-reporter:0.1.18`
import com.typesafe.tools.mima.lib.MiMaLib
import com.typesafe.tools.mima.core._
@@ -34,7 +34,7 @@ trait MiMa extends ScalaModule with PublishModule {
com.typesafe.tools.mima.core.Config.setup("sbt-mima-plugin", Array.empty)
val cpstring = classpath
.map(_.path)
- .filter(exists)
+ .filter(os.exists)
.mkString(System.getProperty("path.separator"))
new MiMaLib(
com.typesafe.tools.mima.core.reporterClassPath(cpstring)
diff --git a/integration/test/resources/play-json/reformat.sc b/integration/test/resources/play-json/reformat.sc
index c44b2f97..3127bc5d 100644
--- a/integration/test/resources/play-json/reformat.sc
+++ b/integration/test/resources/play-json/reformat.sc
@@ -1,7 +1,7 @@
import $ivy.`org.scalariform::scalariform:0.2.5`
import mill._, scalalib._
-import ammonite.ops._
+
import scalariform.formatter._
import scalariform.formatter.preferences._
import scalariform.parser.ScalaParserException
@@ -25,11 +25,11 @@ trait Scalariform extends ScalaModule {
files.map { path =>
try {
val formatted = ScalaFormatter.format(
- read(path),
+ os.read(path),
playJsonPreferences,
scalaVersion = scalaVersion()
)
- write.over(path, formatted)
+ os.write.over(path, formatted)
} catch {
case ex: ScalaParserException =>
T.ctx.log.error(s"Failed to format file: ${path}. Error: ${ex.getMessage}")
@@ -41,7 +41,7 @@ trait Scalariform extends ScalaModule {
def checkCodeFormat() = T.command {
filesToFormat(sources()).foreach { path =>
try {
- val input = read(path)
+ val input = os.read(path)
val formatted = ScalaFormatter.format(
input,
playJsonPreferences,
@@ -63,8 +63,8 @@ trait Scalariform extends ScalaModule {
private def filesToFormat(sources: Seq[PathRef]) = {
for {
- pathRef <- sources if exists(pathRef.path)
- file <- ls.rec(pathRef.path) if file.isFile && file.ext == "scala"
+ pathRef <- sources if os.exists(pathRef.path)
+ file <- os.walk(pathRef.path) if os.isFile(file) && file.ext == "scala"
} yield file
}
diff --git a/integration/test/resources/play-json/release.sh b/integration/test/resources/play-json/release.sh
index 009300a0..6efe80ce 100755
--- a/integration/test/resources/play-json/release.sh
+++ b/integration/test/resources/play-json/release.sh
@@ -2,7 +2,7 @@
set -eux
-rm -rf out
+os.remove.all -rf out
mill __.test
mill release.setReleaseVersion
mill mill.scalalib.PublishModule/publishAll \
diff --git a/integration/test/resources/upickle/build.sc b/integration/test/resources/upickle/build.sc
index 1f5f2bed..86552d9d 100644
--- a/integration/test/resources/upickle/build.sc
+++ b/integration/test/resources/upickle/build.sc
@@ -43,7 +43,7 @@ trait UpickleModule extends CrossSbtModule with PublishModule{
def generatedSources = T{
val dir = T.ctx().dest
val file = dir / "upickle" / "Generated.scala"
- ammonite.ops.mkdir(dir / "upickle")
+ os.makeDir.all(dir / "upickle")
val tuplesAndCases = (1 to 22).map{ i =>
def commaSeparated(s: Int => String) = (1 to i).map(s).mkString(", ")
val writerTypes = commaSeparated(j => s"T$j: Writer")