Skip to content

Commit

Permalink
Replaced deprecated symbols with strings (#1329)
Browse files Browse the repository at this point in the history
Pull request: #1329
  • Loading branch information
lefou authored May 21, 2021
1 parent bf96a10 commit 5a62e25
Show file tree
Hide file tree
Showing 49 changed files with 206 additions and 206 deletions.
18 changes: 9 additions & 9 deletions contrib/bloop/test/src/mill/contrib/bloop/BloopTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import bloop.config.Config.Platform.Jvm
object BloopTests extends TestSuite {
import BloopFormats._

val workdir = os.pwd / 'target / 'workspace / "bloop"
val workdir = os.pwd / "target" / "workspace" / "bloop"
val testEvaluator = TestEvaluator.static(build)
val testBloop = new BloopImpl(() => testEvaluator.evaluator, workdir)

Expand Down Expand Up @@ -70,7 +70,7 @@ object BloopTests extends TestSuite {
.get

def tests: Tests = Tests {
'genBloopTests - {
"genBloopTests" - {

testEvaluator(testBloop.install())
val scalaModuleConfig = readBloopConf("scalaModule.json")
Expand All @@ -80,7 +80,7 @@ object BloopTests extends TestSuite {
// skipped on Windows
val scalanativeModuleConfig = if(scala.util.Properties.isWin) None else Some(readBloopConf("scalanativeModule.json"))

'scalaModule - {
"scalaModule" - {
val p = scalaModuleConfig.project
val name = p.name
val workspaceDir = p.workspaceDir
Expand Down Expand Up @@ -110,7 +110,7 @@ object BloopTests extends TestSuite {
assert(artifacts.map(_.name).distinct == List("bloop-config_2.12"))
assert(artifacts.flatMap(_.classifier).contains("sources"))
}
'scalaModuleTest - {
"scalaModuleTest" - {
val p = testModuleConfig.project
val name = p.name
val workspaceDir = p.workspaceDir
Expand All @@ -125,16 +125,16 @@ object BloopTests extends TestSuite {
assert(dep == "scalaModule")
assert(mainModuleClasspath.forall(p.classpath.contains))
}
'configAccessTest - {
"configAccessTest" - {
val (accessedConfig, _) =
testEvaluator(build.scalaModule.bloop.config).asSuccess.get.value.right.get
assert(accessedConfig == scalaModuleConfig)
}
'noDepTest - {
"noDepTest" - {
val cp = scalaModule2Config.project.classpath.map(_.toString)
assert(cp.exists(_.contains("scala-library-2.12.8")))
}
'scalajsModule - {
"scalajsModule" - {
val p = scalajsModuleConfig.project
val name = p.name
val workspaceDir = p.workspaceDir
Expand All @@ -150,7 +150,7 @@ object BloopTests extends TestSuite {
assert(platform.config.kind == BloopConfig.ModuleKindJS.CommonJSModule)
assert(platform.config.mode == BloopConfig.LinkerMode.Release)
}
'scalanativeModule - {
"scalanativeModule" - {
scalanativeModuleConfig match {
case None =>
val exists = os.exists(workdir / ".bloop" / "scalanativeModule.json")
Expand All @@ -173,7 +173,7 @@ object BloopTests extends TestSuite {
assert(platform.config.clang == clang.toNIO)
}
}
'skipped - {
"skipped" - {
val exists = os.exists(workdir / ".bloop" / "skippedModule.json")
assert(exists == false)
}
Expand Down
22 changes: 11 additions & 11 deletions contrib/buildinfo/test/src/BuildInfoTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ object BuildInfoTests extends TestSuite {
}

val testModuleSourcesPath
: Path = os.pwd / 'contrib / 'buildinfo / 'test / 'resources / "buildinfo"
: Path = os.pwd / "contrib" / "buildinfo" / "test" / "resources" / "buildinfo"

def workspaceTest[T](m: TestUtil.BaseModule)(t: TestEvaluator => T)(
implicit tp: TestPath): T = {
Expand All @@ -57,8 +57,8 @@ object BuildInfoTests extends TestSuite {

def tests: Tests = Tests {

'buildinfo - {
'createSourcefile - workspaceTest(BuildInfo) { eval =>
"buildinfo" - {
"createSourcefile" - workspaceTest(BuildInfo) { eval =>
val expected =
s"""|
|object BuildInfo {
Expand All @@ -70,23 +70,23 @@ object BuildInfoTests extends TestSuite {
val Right(((result, _), evalCount)) =
eval.apply(BuildInfo.generatedBuildInfo)
assert(
result.head.path == eval.outPath / 'generatedBuildInfo / 'dest / "BuildInfo.scala" &&
result.head.path == eval.outPath / "generatedBuildInfo" / "dest" / "BuildInfo.scala" &&
os.exists(result.head.path) &&
os.read(result.head.path) == expected
)
}

'notCreateEmptySourcefile - workspaceTest(EmptyBuildInfo) { eval =>
"notCreateEmptySourcefile" - workspaceTest(EmptyBuildInfo) { eval =>
val Right(((result, _), evalCount)) =
eval.apply(EmptyBuildInfo.generatedBuildInfo)
assert(
result.isEmpty &&
!os.exists(
eval.outPath / 'generatedBuildInfo / 'dest / "BuildInfo.scala")
eval.outPath / "generatedBuildInfo" / "dest" / "BuildInfo.scala")
)
}

'supportCustomSettings - workspaceTest(BuildInfoSettings) { eval =>
"supportCustomSettings" - workspaceTest(BuildInfoSettings) { eval =>
val expected =
s"""|package foo
|
Expand All @@ -99,18 +99,18 @@ object BuildInfoTests extends TestSuite {
val Right(((result, _), evalCount)) =
eval.apply(BuildInfoSettings.generatedBuildInfo)
assert(
result.head.path == eval.outPath / 'generatedBuildInfo / 'dest / "BuildInfo.scala" &&
result.head.path == eval.outPath / "generatedBuildInfo" / "dest" / "BuildInfo.scala" &&
os.exists(result.head.path) &&
os.read(result.head.path) == expected
)
}

'compile - workspaceTest(BuildInfo) { eval =>
"compile" - workspaceTest(BuildInfo) { eval =>
val Right((result, evalCount)) = eval.apply(BuildInfo.compile)
assert(true)
}

'run - workspaceTest(BuildInfo) { eval =>
"run" - workspaceTest(BuildInfo) { eval =>
val runResult = eval.outPath / "hello-mill"
val Right((result, evalCount)) =
eval.apply(BuildInfo.run(runResult.toString))
Expand All @@ -121,7 +121,7 @@ object BuildInfoTests extends TestSuite {
}

"generatedSources must be a folder" - workspaceTest(BuildInfo) { eval =>
val buildInfoGeneratedSourcesFolder = eval.outPath / 'generatedBuildInfo / 'dest
val buildInfoGeneratedSourcesFolder = eval.outPath / "generatedBuildInfo" / "dest"
val Right((result, evalCount)) = eval.apply(BuildInfo.generatedSources)
assert(
result.size == 1,
Expand Down
10 changes: 5 additions & 5 deletions contrib/flyway/test/src/BuildTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object BuildTest extends TestSuite {
object Build extends TestUtil.BaseModule {
object build extends FlywayModule {

def resources = T.sources(os.pwd / 'contrib / 'flyway / 'test / 'resources)
def resources = T.sources(os.pwd / "contrib" / "flyway" / "test" / "resources")

def postgres = ivy"com.h2database:h2:1.4.199"

Expand All @@ -19,13 +19,13 @@ object BuildTest extends TestSuite {
}

def tests = Tests {
'clean - {
"clean" - {
val eval = new TestEvaluator(Build)
val Right((_, count)) = eval(Build.build.flywayClean())
assert(count > 0)
}

'migrate - {
"migrate" - {
val eval = new TestEvaluator(Build)
val Right((res, count)) = eval(Build.build.flywayMigrate())
assert(
Expand All @@ -39,10 +39,10 @@ object BuildTest extends TestSuite {
)
}

'info - {
"info" - {
val eval = new TestEvaluator(Build)
val Right((_, count)) = eval(Build.build.flywayInfo())
assert(count > 0)
}
}
}
}
4 changes: 2 additions & 2 deletions contrib/playlib/src/mill/playlib/Layout.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import mill.scalalib._

private[playlib] trait Layout extends JavaModule{

def conf = T.sources{ millSourcePath / 'conf }
def app = T.sources{ millSourcePath / 'app }
def conf = T.sources{ millSourcePath / "conf" }
def app = T.sources{ millSourcePath / "app" }

override def sources = T.sources{ app() }
override def resources = T.sources{ conf() }
Expand Down
2 changes: 1 addition & 1 deletion contrib/playlib/src/mill/playlib/RouteCompilerWorker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private[playlib] class RouteCompilerWorker {
dest.toIO
) match {
case null =>
Result.Success(CompilationResult(T.dest / 'zinc, PathRef(T.dest)))
Result.Success(CompilationResult(T.dest / "zinc", PathRef(T.dest)))
case err => Result.Failure(err)
}
}
Expand Down
2 changes: 1 addition & 1 deletion contrib/playlib/src/mill/playlib/RouterModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import mill.{Agg, T}

trait RouterModule extends ScalaModule with Version {

def routes: T[Seq[PathRef]] = T.sources { millSourcePath / 'routes }
def routes: T[Seq[PathRef]] = T.sources { millSourcePath / "routes" }

def routeFiles = T {
val paths = routes().flatMap(file => os.walk(file.path))
Expand Down
2 changes: 1 addition & 1 deletion contrib/playlib/src/mill/playlib/Static.scala
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ trait Static extends ScalaModule {
* webjar resources extracted from their source jars with version from path removed
*/
def webJarResources = T {
extractWebJars(webJars().toSeq, os.Path(assetsPath(), T.dest) / 'lib)
extractWebJars(webJars().toSeq, os.Path(assetsPath(), T.dest) / "lib")
PathRef(T.dest)
}

Expand Down
2 changes: 1 addition & 1 deletion contrib/proguard/test/src/ProguardTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object ProguardTests extends TestSuite {
}

val testModuleSourcesPath
: Path = os.pwd / 'contrib / 'proguard / 'test / 'resources / "proguard"
: Path = os.pwd / "contrib" / "proguard" / "test" / "resources" / "proguard"

def workspaceTest[T](m: TestUtil.BaseModule)(t: TestEvaluator => T)(
implicit tp: TestPath): T = {
Expand Down
2 changes: 1 addition & 1 deletion contrib/scalapblib/src/ScalaPBModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ trait ScalaPBModule extends ScalaModule {
def scalaPBProtocPath: T[Option[String]] = T { None }

def scalaPBSources: Sources = T.sources {
millSourcePath / 'protobuf
millSourcePath / "protobuf"
}

def scalaPBOptions: T[String] = T {
Expand Down
24 changes: 12 additions & 12 deletions contrib/scalapblib/test/src/TutorialTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ object TutorialTests extends TestSuite {
}
}

val resourcePath: os.Path = os.pwd / 'contrib / 'scalapblib / 'test / 'protobuf / 'tutorial
val resourcePath: os.Path = os.pwd / "contrib" / "scalapblib" / "test" / "protobuf" / "tutorial"

def protobufOutPath(eval: TestEvaluator): os.Path =
eval.outPath / 'core / 'compileScalaPB / 'dest / 'com / 'example / 'tutorial
eval.outPath / "core" / "compileScalaPB" / "dest" / "com" / "example" / "tutorial"

def workspaceTest[T](m: TestUtil.BaseModule)(t: TestEvaluator => T)
(implicit tp: TestPath): T = {
Expand All @@ -52,8 +52,8 @@ object TutorialTests extends TestSuite {
println(m.millSourcePath)
os.remove.all(eval.outPath)
println(eval.outPath)
os.makeDir.all(m.millSourcePath / 'core / 'protobuf)
os.copy(resourcePath, m.millSourcePath / 'core / 'protobuf / 'tutorial)
os.makeDir.all(m.millSourcePath / "core" / "protobuf")
os.copy(resourcePath, m.millSourcePath / "core" / "protobuf" / "tutorial")
t(eval)
}

Expand All @@ -66,9 +66,9 @@ object TutorialTests extends TestSuite {
)

def tests: Tests = Tests {
'scalapbVersion - {
"scalapbVersion" - {

'fromBuild - workspaceTest(Tutorial) { eval =>
"fromBuild" - workspaceTest(Tutorial) { eval =>
val Right((result, evalCount)) = eval.apply(Tutorial.core.scalaPBVersion)

assert(
Expand All @@ -89,7 +89,7 @@ object TutorialTests extends TestSuite {
val expectedSourcefiles = compiledSourcefiles.map(outPath / _)

assert(
result.path == eval.outPath / 'core / 'compileScalaPB / 'dest,
result.path == eval.outPath / "core" / "compileScalaPB" / "dest",
outputFiles.nonEmpty,
outputFiles.forall(expectedSourcefiles.contains),
outputFiles.size == 5,
Expand All @@ -104,7 +104,7 @@ object TutorialTests extends TestSuite {

// // This throws a NullPointerException in coursier somewhere
// //
// // 'triggeredByScalaCompile - workspaceTest(Tutorial) { eval =>
// // "triggeredByScalaCompile" - workspaceTest(Tutorial) { eval =>
// // val Right((_, evalCount)) = eval.apply(Tutorial.core.compile)
//
// // val outPath = protobufOutPath(eval)
Expand All @@ -128,18 +128,18 @@ object TutorialTests extends TestSuite {
// }
}

'useExternalProtocCompiler - {
"useExternalProtocCompiler" - {
/* This ensure that the `scalaPBProtocPath` is properly used.
* As the given path is incorrect, the compilation should fail.
*/
'calledWithWrongProtocFile - workspaceTest(TutorialWithProtoc) { eval =>
"calledWithWrongProtocFile" - workspaceTest(TutorialWithProtoc) { eval =>
val result = eval.apply(TutorialWithProtoc.core.compileScalaPB)
assert(result.isLeft)
}
}

'compilationArgs - {
'calledWithAdditionalArgs - workspaceTest(TutorialWithAdditionalArgs) {
"compilationArgs" - {
"calledWithAdditionalArgs" - workspaceTest(TutorialWithAdditionalArgs) {
eval =>
val result =
eval.apply(TutorialWithAdditionalArgs.core.scalaPBCompileOptions)
Expand Down
12 changes: 6 additions & 6 deletions contrib/scoverage/test/src/HelloWorldTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import utest._
import utest.framework.TestPath

object HelloWorldTests extends utest.TestSuite {
val resourcePath = os.pwd / 'contrib / 'scoverage / 'test / 'resources / "hello-world"
val sbtResourcePath = os.pwd / 'contrib / 'scoverage / 'test / 'resources / "hello-world-sbt"
val resourcePath = os.pwd / "contrib" / "scoverage" / "test" / "resources" / "hello-world"
val sbtResourcePath = os.pwd / "contrib" / "scoverage" / "test" / "resources" / "hello-world-sbt"
val unmanagedFile = resourcePath / "unmanaged.xml"
trait HelloBase extends TestUtil.BaseModule {
def millSourcePath = TestUtil.getSrcPathBase() / millOuterCtx.enclosing.split('.')
Expand Down Expand Up @@ -44,16 +44,16 @@ object HelloWorldTests extends utest.TestSuite {
def scalaVersion = "2.12.9"
def scoverageVersion = "1.4.0"
override def sources = T.sources(
millSourcePath / 'src / 'main / 'scala,
millSourcePath / 'src / 'main / 'java
millSourcePath / "src" / "main" / "scala",
millSourcePath / "src" / "main" / "java"
)
override def resources = T.sources{ millSourcePath / 'src / 'main / 'resources }
override def resources = T.sources{ millSourcePath / "src" / "main" / "resources" }

object test extends ScoverageTests {
override def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.8")
def testFrameworks = Seq("org.scalatest.tools.Framework")
override def millSourcePath = outer.millSourcePath
override def intellijModulePath = outer.millSourcePath / 'src / 'test
override def intellijModulePath = outer.millSourcePath / "src" / "test"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions contrib/testng/test/src/mill/testng/TestNGTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ object TestNGTests extends TestSuite {

}

val resourcePath: Path = pwd / 'contrib / 'testng / 'test / 'resources / "demo"
val resourcePath: Path = pwd / "contrib" / "testng" / "test" / "resources" / "demo"

def workspaceTest[T, M <: TestUtil.BaseModule](m: M, resourcePath: Path = resourcePath)
(t: TestEvaluator => T)
Expand All @@ -49,8 +49,8 @@ object TestNGTests extends TestSuite {
}

def tests: Tests = Tests {
'TestNG - {
'demo - workspaceTest(demo) { eval =>
"TestNG" - {
"demo" - workspaceTest(demo) { eval =>
val Right((result, evalCount)) = eval.apply(demo.test.testFramework)
assert(
result == "mill.testng.TestNGFramework",
Expand Down
2 changes: 1 addition & 1 deletion contrib/twirllib/src/TwirlModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ trait TwirlModule extends mill.Module {
def twirlVersion: T[String]

def twirlSources: Sources = T.sources {
millSourcePath / 'views
millSourcePath / "views"
}

def twirlClasspath: T[Loose.Agg[PathRef]] = T {
Expand Down
2 changes: 1 addition & 1 deletion contrib/twirllib/src/TwirlWorker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class TwirlWorker {

sourceDirectories.foreach(compileTwirlDir)

val zincFile = ctx.dest / 'zinc
val zincFile = ctx.dest / "zinc"
val classesDir = ctx.dest

mill.api.Result.Success(CompilationResult(zincFile, PathRef(classesDir)))
Expand Down
Loading

0 comments on commit 5a62e25

Please sign in to comment.