diff options
author | Alexandra Dima <alexandra.dima@jetbrains.com> | 2019-07-31 09:06:11 +0200 |
---|---|---|
committer | Samvel Abrahamyan <samvel1024@gmail.com> | 2019-10-12 14:33:15 +0200 |
commit | 2471d68dd3d86331e0e456e9f81099d217004139 (patch) | |
tree | 82021ca402e572243cbab1e462770c44d56029b4 | |
parent | 45036a5e3e4a7aa74f5364bba1ec557c6249bcfc (diff) | |
download | mill-2471d68dd3d86331e0e456e9f81099d217004139.tar.gz mill-2471d68dd3d86331e0e456e9f81099d217004139.tar.bz2 mill-2471d68dd3d86331e0e456e9f81099d217004139.zip |
Fixed bugs: If a module has no resource directory don't just throw error, just return empty list of resources. Include the name of the compile task in the segments that get converted tothe scalac options class directory.
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | contrib/bsp/src/mill/contrib/BSP.scala (renamed from contrib/bsp/src/mill/contrib/MainMillBuildServer.scala) | 0 | ||||
-rw-r--r-- | contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala | 9 |
3 files changed, 8 insertions, 4 deletions
@@ -11,4 +11,5 @@ contrib/bsp/mill-external-bs contrib/bsp/mill-out-bs mill.iml .bsp/ -bsp.log
\ No newline at end of file +bsp.log +contrib/bsp/test/
\ No newline at end of file diff --git a/contrib/bsp/src/mill/contrib/MainMillBuildServer.scala b/contrib/bsp/src/mill/contrib/BSP.scala index d31eb7f4..d31eb7f4 100644 --- a/contrib/bsp/src/mill/contrib/MainMillBuildServer.scala +++ b/contrib/bsp/src/mill/contrib/BSP.scala diff --git a/contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala b/contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala index 7454a944..6e9cbc37 100644 --- a/contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala +++ b/contrib/bsp/src/mill/contrib/bsp/MillBuildServer.scala @@ -9,6 +9,7 @@ import mill.api.Result.{Skipped, Success} import mill.{scalalib, _} import mill.api.{BspContext, Result, Strict} import mill.contrib.bsp.ModuleUtils._ +import mill.define.Segment.Label import mill.eval.Evaluator import mill.scalalib._ import mill.scalalib.api.CompilationResult @@ -185,12 +186,12 @@ class MillBuildServer(evaluator: Evaluator, for (targetId <- resourcesParams.getTargets.asScala) { val millModule = targetIdToModule(targetId) val resources = evaluateInformativeTask(evaluator, millModule.resources, Agg.empty[PathRef]). + filter(pathRef => os.exists(pathRef.path)). flatMap(pathRef => os.walk(pathRef.path)). map(path => path.toIO.toURI.toString). toList.asJava items ++= List(new ResourcesItem(targetId, resources)) } - new ResourcesResult(items.asJava) } handleExceptions[String, ResourcesResult](_ => getResources, "") @@ -427,8 +428,10 @@ class MillBuildServer(evaluator: Evaluator, val options = evaluateInformativeTask(evaluator, m.scalacOptions, Seq.empty[String]).toList val classpath = evaluateInformativeTask(evaluator, m.runClasspath, Agg.empty[PathRef]). map(pathRef => pathRef.path.toIO.toURI.toString).toList - val classDirectory = (Evaluator.resolveDestPaths(os.pwd / "out" , m.millModuleSegments). - dest / "classes").toIO.toURI.toString + val classDirectory = (Evaluator.resolveDestPaths( + os.pwd / "out" , + m.millModuleSegments ++ Seq(Label("compile"))).dest / "classes" + ).toIO.toURI.toString targetScalacOptions ++= List(new ScalacOptionsItem(targetId, options.asJava, classpath.asJava, classDirectory)) case _: JavaModule => targetScalacOptions ++= List() |