Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 41 additions & 34 deletions build.sc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import $file.ci.shared
import $file.ci.upload
import java.nio.file.attribute.PosixFilePermission
import $ivy.`org.scalaj::scalaj-http:2.4.1`
import $ivy.`org.scalaj::scalaj-http:2.4.2`

import coursier.maven.MavenRepository
import mill._
Expand All @@ -12,19 +12,18 @@ import mill.modules.Jvm.createAssembly
object Deps {

object Scalajs_0_6 {
val scalajsJsEnvs = ivy"org.scala-js::scalajs-js-envs:0.6.22"
val scalajsSbtTestAdapter = ivy"org.scala-js::scalajs-sbt-test-adapter:0.6.22"
val scalajsTools = ivy"org.scala-js::scalajs-tools:0.6.22"
val scalajsJsEnvs = ivy"org.scala-js::scalajs-js-envs:0.6.32"
val scalajsSbtTestAdapter = ivy"org.scala-js::scalajs-sbt-test-adapter:0.6.32"
val scalajsTools = ivy"org.scala-js::scalajs-tools:0.6.32"
}

object Scalajs_1_0 {
val scalajsEnvJsdomNodejs = ivy"org.scala-js::scalajs-env-jsdom-nodejs:1.0.0-RC1"
val scalajsEnvNodejs = ivy"org.scala-js::scalajs-env-nodejs:1.0.0-RC1"
val scalajsEnvPhantomjs = ivy"org.scala-js::scalajs-env-phantomjs:1.0.0-RC1"
val scalajsSbtTestAdapter = ivy"org.scala-js::scalajs-sbt-test-adapter:1.0.0-RC1"
val scalajsLinker = ivy"org.scala-js::scalajs-linker:1.0.0-RC1"
val scalajsEnvJsdomNodejs = ivy"org.scala-js::scalajs-env-jsdom-nodejs:1.0.0"
val scalajsEnvNodejs = ivy"org.scala-js::scalajs-env-nodejs:1.0.0"
val scalajsEnvPhantomjs = ivy"org.scala-js::scalajs-env-phantomjs:1.0.0"
val scalajsSbtTestAdapter = ivy"org.scala-js::scalajs-sbt-test-adapter:1.0.0"
val scalajsLinker = ivy"org.scala-js::scalajs-linker:1.0.0"
}

object Scalanative_0_3 {
val scalanativeTools = ivy"org.scala-native::tools:0.3.9"
val scalanativeUtil = ivy"org.scala-native::util:0.3.9"
Expand All @@ -47,29 +46,29 @@ object Deps {
val graphvizJava = ivy"guru.nidi:graphviz-java:0.8.3"
val ipcsocket = ivy"org.scala-sbt.ipcsocket:ipcsocket:1.0.0"
val ipcsocketExcludingJna = ipcsocket.exclude(
"net.java.dev.jna" -> "jna",
"net.java.dev.jna" -> "jna-platform"
"net.java.dev.jna" -> "jna",
"net.java.dev.jna" -> "jna-platform"
)
val javaxServlet = ivy"org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016"
val jettyServer = ivy"org.eclipse.jetty:jetty-server:8.1.16.v20140903"
val jettyWebsocket = ivy"org.eclipse.jetty:jetty-websocket:8.1.16.v20140903"
val jgraphtCore = ivy"org.jgrapht:jgrapht-core:1.3.0"
val jna = ivy"net.java.dev.jna:jna:4.5.0"
val jna = ivy"net.java.dev.jna:jna:5.0.0"
val jnaPlatform = ivy"net.java.dev.jna:jna-platform:4.5.0"
val junitInterface = ivy"com.novocode:junit-interface:0.11"
val lambdaTest = ivy"de.tototec:de.tobiasroeser.lambdatest:0.7.0"
val osLib = ivy"com.lihaoyi::os-lib:0.6.3"
val testng = ivy"org.testng:testng:6.11"
val sbtTestInterface = ivy"org.scala-sbt:test-interface:1.0"
def scalaCompiler(scalaVersion: String) = ivy"org.scala-lang:scala-compiler:${scalaVersion}"
val scalafmtDynamic = ivy"org.scalameta::scalafmt-dynamic:2.0.0-RC6"
val scalafmtDynamic = ivy"org.scalameta::scalafmt-dynamic:2.2.1"
def scalaReflect(scalaVersion: String) = ivy"org.scala-lang:scala-reflect:${scalaVersion}"
def scalacScoveragePlugin = ivy"org.scoverage::scalac-scoverage-plugin:1.4.0"
def scalacScoveragePlugin = ivy"org.scoverage::scalac-scoverage-plugin:1.4.1"
val sourcecode = ivy"com.lihaoyi::sourcecode:0.2.0"
val ujsonCirce = ivy"com.lihaoyi::ujson-circe:0.9.8"
val upickle = ivy"com.lihaoyi::upickle:1.0.0"
val utest = ivy"com.lihaoyi::utest:0.7.3"
val zinc = ivy"org.scala-sbt::zinc:1.2.5"
val zinc = ivy"org.scala-sbt::zinc:1.4.0-M1"
val bsp = ivy"ch.epfl.scala:bsp4j:2.0.0-M4"
}

Expand All @@ -92,7 +91,7 @@ trait MillPublishModule extends PublishModule{
def javacOptions = Seq("-source", "1.8", "-target", "1.8")
}
trait MillApiModule extends MillPublishModule with ScalaModule{
def scalaVersion = T{ "2.12.10" }
def scalaVersion = T{ "2.13.1" }
def compileIvyDeps = Agg(Deps.acyclic)
def scalacOptions = Seq("-P:acyclic:force")
def scalacPluginIvyDeps = Agg(Deps.acyclic)
Expand All @@ -101,6 +100,7 @@ trait MillApiModule extends MillPublishModule with ScalaModule{
)
}
trait MillModule extends MillApiModule { outer =>
def scalaVersion = T{ "2.13.1" }
def scalacPluginClasspath =
super.scalacPluginClasspath() ++ Seq(main.moduledefs.jar())

Expand Down Expand Up @@ -142,7 +142,7 @@ object main extends MillModule {
Seq(PathRef(shared.generateCoreTestSources(T.ctx.dest)))
}
}
object api extends MillApiModule{
object api extends MillApiModule {
def ivyDeps = Agg(
Deps.osLib,
Deps.upickle,
Expand All @@ -158,6 +158,7 @@ object main extends MillModule {

def ivyDeps = Agg(
Deps.ammonite,
Deps.coursier,
// Necessary so we can share the JNA classes throughout the build process
Deps.jna,
Deps.jnaPlatform,
Expand Down Expand Up @@ -186,7 +187,7 @@ object main extends MillModule {
}

object moduledefs extends MillPublishModule with ScalaModule{
def scalaVersion = T{ "2.12.10" }
def scalaVersion = T{ "2.13.1" }
def ivyDeps = Agg(
Deps.scalaCompiler(scalaVersion()),
Deps.sourcecode,
Expand Down Expand Up @@ -283,7 +284,7 @@ object scalalib extends MillModule {
object api extends MillApiModule {
def moduleDeps = Seq(main.api)
}
object worker extends MillApiModule{
object worker extends MillApiModule {

def moduleDeps = Seq(scalalib.api)

Expand Down Expand Up @@ -312,8 +313,8 @@ object scalajslib extends MillModule {
(for((k, v) <- mapping.toSeq) yield s"-D$k=$v")
}

object api extends MillApiModule{
def moduleDeps = Seq(main.core)
object api extends MillApiModule {
def moduleDeps = Seq(main.api)
def ivyDeps = Agg(Deps.sbtTestInterface)
}
object worker extends Cross[WorkerModule]("0.6", "1.0")
Expand Down Expand Up @@ -362,30 +363,32 @@ object contrib extends MillModule {

def testArgs = T {
val mapping = Map(
"MILL_CONTRIB_PLAYLIB_ROUTECOMPILER_WORKER_2_6" -> worker("2.6").compile().classes.path,
"MILL_CONTRIB_PLAYLIB_ROUTECOMPILER_WORKER_2_7" -> worker("2.7").compile().classes.path
"MILL_CONTRIB_PLAYLIB_ROUTECOMPILER_WORKER_2_6" -> worker("2.6").assembly().path,
"MILL_CONTRIB_PLAYLIB_ROUTECOMPILER_WORKER_2_7" -> worker("2.7").assembly().path
)

scalalib.worker.testArgs() ++
scalalib.backgroundwrapper.testArgs() ++
(for ((k, v) <- mapping.toSeq) yield s"-D$k=$v")
}

object api extends MillApiModule {
def moduleDeps = Seq(scalalib)
object api extends MillPublishModule {

}
object worker extends Cross[WorkerModule]( "2.6", "2.7")

class WorkerModule(scalajsBinary: String) extends MillApiModule {
class WorkerModule(scalajsBinary: String) extends MillApiModule {
def scalaVersion = T { "2.12.10" }
def moduleDeps = Seq(playlib.api)

def ivyDeps = scalajsBinary match {
case "2.6"=>
Agg(
Deps.osLib,
ivy"com.typesafe.play::routes-compiler::2.6.0"
)
case "2.7" =>
Agg(
Deps.osLib,
ivy"com.typesafe.play::routes-compiler::2.7.0"
)
}
Expand All @@ -398,7 +401,6 @@ object contrib extends MillModule {
}

object scoverage extends MillModule {

object api extends MillApiModule {
def moduleDeps = Seq(main.api)
}
Expand Down Expand Up @@ -441,7 +443,10 @@ object contrib extends MillModule {

object tut extends MillModule {
def moduleDeps = Seq(scalalib)
def testArgs = Seq("-DMILL_VERSION=" + build.publishVersion()._2)
def testArgs = T{
scalalib.worker.testArgs() ++
scalalib.backgroundwrapper.testArgs()
}
}

object flyway extends MillModule {
Expand Down Expand Up @@ -494,31 +499,33 @@ object scalanativelib extends MillModule {

def testArgs = T{
val mapping = Map(
"MILL_SCALANATIVE_WORKER_0_3" -> worker("0.3").compile().classes.path,
"MILL_SCALANATIVE_WORKER_0_4" -> worker("0.4").compile().classes.path
"MILL_SCALANATIVE_WORKER_0_3" -> worker("0.3").assembly().path,
"MILL_SCALANATIVE_WORKER_0_4" -> worker("0.4").assembly().path
)
scalalib.worker.testArgs() ++
scalalib.backgroundwrapper.testArgs() ++
(for((k, v) <- mapping.toSeq) yield s"-D$k=$v")
}
object api extends MillApiModule{
def moduleDeps = Seq(main.core)
object api extends MillPublishModule {
def ivyDeps = Agg(Deps.sbtTestInterface)
}
object worker extends Cross[WorkerModule]("0.3", "0.4")
class WorkerModule(scalaNativeWorkerVersion: String) extends MillApiModule {
def scalaVersion = T{ "2.12.10" }
override def millSourcePath(): os.Path = super.millSourcePath / os.up
def moduleDeps = Seq(scalanativelib.api)
def ivyDeps = scalaNativeWorkerVersion match {
case "0.3" =>
Agg(
Deps.osLib,
Deps.Scalanative_0_3.scalanativeTools,
Deps.Scalanative_0_3.scalanativeUtil,
Deps.Scalanative_0_3.scalanativeNir,
Deps.Scalanative_0_3.scalanativeTestRunner
)
case "0.4" =>
Agg(
Deps.osLib,
Deps.Scalanative_0_4.scalanativeTools,
Deps.Scalanative_0_4.scalanativeUtil,
Deps.Scalanative_0_4.scalanativeNir,
Expand Down
2 changes: 1 addition & 1 deletion ci/shared.sc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* via import $file
*/

import $ivy.`org.scalaj::scalaj-http:2.4.1`
import $ivy.`org.scalaj::scalaj-http:2.4.2`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought. Would it be possible to move the Deps object into its own file, include it here (and in build.sc) and then use Deps.scalaj (or in essence it's value) in this ivy-import?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, that would require using Ammonite's multi-stage scripts which I don't remember if Mill supports or not

import ammonite.ops.{write, Path, mkdir, RelPath, up}

def argNames(n: Int) = {
Expand Down
2 changes: 1 addition & 1 deletion contrib/bloop/src/mill/contrib/bloop/BloopImpl.scala
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ class BloopImpl(ev: () => Evaluator, wd: Path) extends ExternalModule { outer =>
sbt = None,
test = testConfig(),
platform = Some(platform()),
resolution = Some(bloopResolution())
resolution = Some(bloopResolution()),
)
}

Expand Down
6 changes: 3 additions & 3 deletions contrib/bsp/src/mill/contrib/bsp/TaskParameters.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ case class CParams(compileParams: CompileParams) extends Parameters {

override def getArguments: Option[Seq[String]] = {
try {
Option(compileParams.getArguments.asScala)
Option(compileParams.getArguments.asScala.toSeq)
} catch {
case e: Exception => Option.empty[Seq[String]]
}
Expand All @@ -51,7 +51,7 @@ case class RParams(runParams: RunParams) extends Parameters {

override def getArguments: Option[Seq[String]] = {
try {
Option(runParams.getArguments.asScala)
Option(runParams.getArguments.asScala.toSeq)
} catch {
case e: Exception => Option.empty[Seq[String]]
}
Expand All @@ -75,7 +75,7 @@ case class TParams(testParams: TestParams) extends Parameters {

override def getArguments: Option[Seq[String]] = {
try {
Option(testParams.getArguments.asScala)
Option(testParams.getArguments.asScala.toSeq)
} catch {
case e: Exception => Option.empty[Seq[String]]
}
Expand Down
6 changes: 6 additions & 0 deletions contrib/playlib/api/src/RouteCompilerType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package mill.playlib.api;

public enum RouteCompilerType{
InjectedGenerator,
StaticGenerator
}
12 changes: 12 additions & 0 deletions contrib/playlib/api/src/RouteCompilerWorkerApi.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package mill.playlib.api;
public interface RouteCompilerWorkerApi {
String compile(java.io.File[] files,
String[] additionalImports,
boolean forwardsRouter,
boolean reverseRouter,
boolean namespaceReverseRouter,
RouteCompilerType generatorType,
java.io.File dest);


}
25 changes: 0 additions & 25 deletions contrib/playlib/api/src/RouteCompilerWorkerApi.scala

This file was deleted.

5 changes: 5 additions & 0 deletions contrib/playlib/api/src/Versions.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package mill.playlib.api;
public class Versions {
public static final String PLAY_2_6 = "2.6";
public static final String PLAY_2_7 = "2.7";
}
7 changes: 0 additions & 7 deletions contrib/playlib/api/src/Versions.scala

This file was deleted.

2 changes: 1 addition & 1 deletion contrib/playlib/src/mill/playlib/PlayModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package playlib

import mill.scalalib._

import api.Versions
import mill.playlib.api.Versions

trait PlayApiModule extends Dependencies with Router with Server{
trait PlayTests extends super.Tests{
Expand Down
17 changes: 9 additions & 8 deletions contrib/playlib/src/mill/playlib/RouteCompilerWorkerApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ private[playlib] class RouteCompilerWorker {
ctx.log.debug("Loading classes from\n"+toolsClassPath.mkString("\n"))
val cl = mill.api.ClassLoader.create(
toolsClassPath,
getClass.getClassLoader
null,
sharedPrefixes = Seq("mill.playlib.api.")
)
val bridge = cl
.loadClass("mill.playlib.worker.RouteCompilerWorker")
Expand All @@ -46,18 +47,18 @@ private[playlib] class RouteCompilerWorker {
//by the others
bridge(routerClasspath)
.compile(
files,
additionalImports,
files.toArray.map(_.toIO),
additionalImports.toArray,
forwardsRouter,
reverseRouter,
namespaceReverseRouter,
generatorType,
dest
)(ctx)
dest.toIO
) match{
case null => Result.Success(CompilationResult(T.dest / 'zinc, PathRef(T.dest)))
case err => Result.Failure(err)
}
}



}

private[playlib] object RouteCompilerWorkerModule extends ExternalModule {
Expand Down
Loading