diff options
author | Alexandra Dima <alexandra.dima@jetbrains.com> | 2019-07-23 18:02:12 +0200 |
---|---|---|
committer | Samvel Abrahamyan <samvel1024@gmail.com> | 2019-10-12 14:33:09 +0200 |
commit | fca29d647f2ae0b71c5b66b3ea4462987e08c911 (patch) | |
tree | 75cb532909d7756b6b1ed568a3924af086753661 | |
parent | f0bcc011d7592db9b6e2fc19648c8fb3c7dd3c9d (diff) | |
download | mill-fca29d647f2ae0b71c5b66b3ea4462987e08c911.tar.gz mill-fca29d647f2ae0b71c5b66b3ea4462987e08c911.tar.bz2 mill-fca29d647f2ae0b71c5b66b3ea4462987e08c911.zip |
Removed unnecessary directories and reverted the scratch folder to how it was in the original mill repo.
-rw-r--r-- | contrib/bsp/.bsp/mill-bsp.json | 18 | ||||
-rw-r--r-- | contrib/bsp/src/mill/contrib/MainMillBuildServer.scala | 12 | ||||
-rw-r--r-- | scratch/benchmarks/src/main/scala/BenchmarkSource.scala | 16 | ||||
-rw-r--r-- | scratch/bsp/src/main/scala/BspSource.scala | 10 | ||||
-rw-r--r-- | scratch/bsp/src/test/scala/BspTests.scala | 10 | ||||
-rw-r--r-- | scratch/build.sc | 56 | ||||
-rw-r--r-- | scratch/core/src/main/scala/CommonObject.scala | 9 | ||||
-rw-r--r-- | scratch/core/src/test/scala/CoreTests.scala | 9 | ||||
-rw-r--r-- | scratch/test_build1.iml | 24 |
9 files changed, 8 insertions, 156 deletions
diff --git a/contrib/bsp/.bsp/mill-bsp.json b/contrib/bsp/.bsp/mill-bsp.json deleted file mode 100644 index 01b08e07..00000000 --- a/contrib/bsp/.bsp/mill-bsp.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "mill-bsp", - "argv": [ - "java", - "-DMILL_CLASSPATH=/usr/local/bin/mill", - "-DMILL_VERSION=0.4.0", - "-Djna.nosys=true", - "-cp", - "/usr/local/bin/mill", - "mill.MillMain mill.contrib.MainMillBuildServer/startServer" - ], - "version": "1.0.0", - "bspVersion": "2.0.0-M4", - "languages": [ - "scala", - "java" - ] -}
\ No newline at end of file diff --git a/contrib/bsp/src/mill/contrib/MainMillBuildServer.scala b/contrib/bsp/src/mill/contrib/MainMillBuildServer.scala index b5b9748a..af5483a4 100644 --- a/contrib/bsp/src/mill/contrib/MainMillBuildServer.scala +++ b/contrib/bsp/src/mill/contrib/MainMillBuildServer.scala @@ -7,10 +7,8 @@ import java.util.concurrent.Executors import upickle.default._ import ch.epfl.scala.bsp4j._ import mill._ -import mill.contrib.bsp.ModuleUtils import mill.define.{Command, Discover, ExternalModule} import mill.eval.Evaluator -import mill.scalalib.JavaModule import org.eclipse.lsp4j.jsonrpc.Launcher import scala.collection.JavaConverters._ @@ -78,7 +76,6 @@ object BSP extends ExternalModule { println("The bsp connection json file probably exists already - will be overwritten") os.remove(bspDirectory / "mill.json") os.write(bspDirectory / "mill.json", Json.stringify(createBspConnectionJson())) - //TODO: Do I want to catch this or throw the exception? case e: Exception => println("An exception occurred while installing mill-bsp: " + e.getMessage + " " + e.getStackTrace.toString) } @@ -126,13 +123,4 @@ object BSP extends ExternalModule { executor.shutdown() } } - - def experiment(ev: Evaluator): Command[Unit] = T.command { - val eval = new Evaluator(ev.home, ev.outPath, ev.externalOutPath, ev.rootModule, ev.log, ev.classLoaderSig, - ev.workerCache, ev.env, false) - val millServer = new mill.contrib.bsp.MillBuildServer(eval, bspVersion, version, languages) - - millServer.initialized = true - println(millServer.workspaceBuildTargets().get) - } }
\ No newline at end of file diff --git a/scratch/benchmarks/src/main/scala/BenchmarkSource.scala b/scratch/benchmarks/src/main/scala/BenchmarkSource.scala deleted file mode 100644 index fa3633a4..00000000 --- a/scratch/benchmarks/src/main/scala/BenchmarkSource.scala +++ /dev/null @@ -1,16 +0,0 @@ -package main.scala - -import org.apache.commons.io.FileUtils - -import java.io.File - -object BenchmarkSource { - //val reader = new InputReader() - - - def main(args: Array[String]): Unit = { - val unusedValue = 3 - val file = FileUtils.getFile("/home/alexandra/test_build1/build.sc") - println(file) - } -} diff --git a/scratch/bsp/src/main/scala/BspSource.scala b/scratch/bsp/src/main/scala/BspSource.scala deleted file mode 100644 index 3a2300ae..00000000 --- a/scratch/bsp/src/main/scala/BspSource.scala +++ /dev/null @@ -1,10 +0,0 @@ -package main.scala -import ch.epfl.scala.bsp4j._ - -object BspSource { - val obj = CommonObject.strVal - - def main(args: Array[String]): Unit = { - println(new BuildTargetIdentifier("path")) - } -} diff --git a/scratch/bsp/src/test/scala/BspTests.scala b/scratch/bsp/src/test/scala/BspTests.scala deleted file mode 100644 index f565217f..00000000 --- a/scratch/bsp/src/test/scala/BspTests.scala +++ /dev/null @@ -1,10 +0,0 @@ -package tests -import org.scalatest.FunSuite -import org.apache.commons.io.FileUtils - -class BspTests extends FunSuite { - val wrongVal: String = 3 - test("test 1") { - assert(CoreTests().coreValue > 0) - } -} diff --git a/scratch/build.sc b/scratch/build.sc index bdc731d3..804e1ca4 100644 --- a/scratch/build.sc +++ b/scratch/build.sc @@ -1,52 +1,12 @@ -import mill.scalalib.{SbtModule, Dep, DepSyntax} -//import $ivy.`com.lihaoyi::mill-contrib-bsp:0.5.0-40-278984-DIRTY7f118075` +import mill.Agg +import mill.scalalib._ -trait BetterFilesModule extends SbtModule{ - def scalaVersion = "2.12.4" - def scalacOptions = Seq( - "-deprecation", // Emit warning and location for usages of deprecated APIs. - "-encoding", "utf-8", // Specify character encoding used by source files. - "-explaintypes", // Explain type errors in more detail. - "-feature", // Emit warning and location for usages of features that should be imported explicitly. - "-Ywarn-infer-any", // Warn when a type argument is inferred to be `Any`. - "-Ywarn-nullary-override", // Warn when non-nullary `def f()' overrides nullary `def f'. - "-Ywarn-nullary-unit", // Warn when nullary methods return Unit. - "-Ywarn-numeric-widen", // Warn when numerics are widened. - "-Ywarn-unused:implicits", // Warn if an implicit parameter is unused. - "-Ywarn-unused:imports", // Warn if an import selector is not referenced. - "-Ywarn-unused:locals", // Warn if a local definition is unused. - "-Ywarn-unused:params", // Warn if a value parameter is unused. - "-Ywarn-unused:patvars", // Warn if a variable bound in a pattern is unused. - "-Ywarn-unused:privates", // Warn if a private member is unused. - "-Ywarn-value-discard" // Warn when non-Unit expression results are unused. +object core extends ScalaModule{ + def scalaVersion = "2.12.8" + def ivyDeps = Agg( + ivy"org.eclipse.jetty:jetty-websocket:8.1.16.v20140903", + ivy"org.eclipse.jetty:jetty-server:8.1.16.v20140903" ) - override def javacOptions = Seq("-source", "1.8", "-target", "1.8", "-Xlint") - - object test extends Tests{ - def moduleDeps = - if (this == core.test) super.moduleDeps - else super.moduleDeps ++ Seq(core.test) - def ivyDeps = Agg(ivy"org.scalatest::scalatest:3.0.4") - def testFrameworks = Seq("org.scalatest.tools.Framework") - } -} - -object core extends BetterFilesModule - -object bsp extends BetterFilesModule{ - def moduleDeps = Seq(core) - def ivyDeps = Agg(ivy"ch.epfl.scala:bsp4j:2.0.0-M3") } -object benchmarks extends BetterFilesModule{ - def moduleDeps = Seq(core) - def ivyDeps = Agg( - ivy"commons-io:commons-io:2.5" - ) - def unmanagedClasspath = Agg( - mill.modules.Util.download( - "https://github.com/williamfiset/FastJavaIO/releases/download/v1.0/fastjavaio.jar", - "fastjavaio.jar" - ) - ) -}
\ No newline at end of file +def thingy = T{ Seq("hello", "world") } diff --git a/scratch/core/src/main/scala/CommonObject.scala b/scratch/core/src/main/scala/CommonObject.scala deleted file mode 100644 index e10bf3a0..00000000 --- a/scratch/core/src/main/scala/CommonObject.scala +++ /dev/null @@ -1,9 +0,0 @@ -package main.scala - -object CommonObject { - val strVal: String = "" - - def hasMethod: Boolean ={ - true - } -} diff --git a/scratch/core/src/test/scala/CoreTests.scala b/scratch/core/src/test/scala/CoreTests.scala deleted file mode 100644 index 6a25b4a4..00000000 --- a/scratch/core/src/test/scala/CoreTests.scala +++ /dev/null @@ -1,9 +0,0 @@ -package tests -import org.scalatest.FlatSpec - -class CoreTests extends FlatSpec { - val coreValue = 1 - "This simple addition" should "equal 4" in { - assert(2 + 2 == 4) - } -} diff --git a/scratch/test_build1.iml b/scratch/test_build1.iml deleted file mode 100644 index 294cb691..00000000 --- a/scratch/test_build1.iml +++ /dev/null @@ -1,24 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<module type="JAVA_MODULE" version="4"> - <component name="NewModuleRootManager" inherit-compiler-output="true"> - <exclude-output /> - <content url="file://$MODULE_DIR$"> - <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/core/resources" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/benchmarks/resources" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/bsp/resources" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/benchmarks/test/scala" isTestSource="true" /> - <sourceFolder url="file://$MODULE_DIR$/bsp/test/src" isTestSource="true" /> - <sourceFolder url="file://$MODULE_DIR$/core/test/scala" isTestSource="true" /> - <sourceFolder url="file://$MODULE_DIR$/bsp/test/scala" isTestSource="true" /> - <sourceFolder url="file://$MODULE_DIR$/bsp/test/resources" type="java-resource" /> - <sourceFolder url="file://$MODULE_DIR$/core/test/resources" type="java-resource" /> - <sourceFolder url="file://$MODULE_DIR$/bsp/src/main/scala" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/core/src/main/scala" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/benchmarks/test/resources" type="java-resource" /> - </content> - <orderEntry type="inheritedJdk" /> - <orderEntry type="sourceFolder" forTests="false" /> - <orderEntry type="library" name="scala-sdk-2.12.8 (2)" level="application" /> - </component> -</module>
\ No newline at end of file |