Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 11:12

    lihaoyi on gh-pages

    first commit (compare)

  • 10:06

    lihaoyi on gh-pages

    first commit (compare)

  • 08:37

    lefou on master

    Omit the suffix in artifactName… (compare)

  • 08:37
    lefou closed #953
  • 08:23

    lefou on master

    Make BSP 1st class citizen (#96… (compare)

  • 08:23
    lefou closed #969
  • 06:30
    joan38 synchronize #969
  • 06:07
    joan38 synchronize #953
  • 05:25
    joan38 edited #953
  • 05:24
    joan38 edited #953
  • Oct 20 18:06

    lihaoyi on gh-pages

    first commit (compare)

  • Oct 20 16:37

    lefou on master

    Add reference to new mill-antlr… (compare)

  • Oct 20 16:37
    lefou closed #979
  • Oct 20 13:29
    ml86 opened #979
  • Oct 16 12:14
    lefou opened #976
  • Oct 16 12:13
    lefou converted_to_draft #974
  • Oct 15 13:27
    ShalokShalom opened #975
  • Oct 13 09:46
    lefou synchronize #974
  • Oct 13 09:43

    lihaoyi on gh-pages

    first commit (compare)

  • Oct 13 08:35
    lefou opened #974
Tobias Roeser
@lefou
I restarted the failing Travis-CI job. Its a often seen hickup from Travis-CI, so let's hope it will run through. https://travis-ci.org/github/lihaoyi/mill/builds/733924372
Anatolii Kmetiuk
@anatoliykmetyuk
Cool, thanks!
Anatolii Kmetiuk
@anatoliykmetyuk
It failed again :(
nnovod
@nnovod
Was this request ever done (lihaoyi/mill#496) or is there another way around this to have the output from Scala.js not be generically named out.js and out.js.map (ideally be named as original source file).
nnovod
@nnovod
Never mind - I see how that doesn't make too much sense unless you only have a single scala.js input file - otherwise there's really not a good name to use so out works just fine
Also, the question I was asking earlier about the server was just a akka-http routing issue - so never mind about that one too. I'm a bit new at this stuff (mill/akka-http/scala.js) and still learning.
Tobias Roeser
@lefou
@nnovod No, issue #496 is still open. I think it is pretty easy to implement. I'm glad to provide guidance, if anybody wants to do it.
nnovod
@nnovod
@lefou The coding looks easy: in ScalaJsModule add something like def scalaJSOutputFilename: T[String] = "out" and replace "out.js" with s"${scalaJSOutputFilename()}.js" in the outputPath in link. I think that's all that needs to be done. But I'd need guidance on how to contribute.
David Walend
@dwalend
Is there a way to change the assembly jar file name to something other than out.jar ? (It looks hard-coded in https://github.com/lihaoyi/mill/blob/1a410f0a2235d6eae02bc4a006c50ee49683d273/main/src/modules/Jvm.scala#L227 )
David Walend
@dwalend
Also, is there a best way to use scp and ssh from inside mill, or should I just hack in some calls to shell inside of custom Commands?
Kostas Kougios
@kostaskougios

Hi all, got a question regarding configuring different kinds of tests:

trait Common extends SbtModule with ScalafmtModule {
  trait CommonTest extends Tests {
    override def testFrameworks = Seq("org.scalatest.tools.Framework")
  }
}

object scalascriptengine extends Common {
  object test extends CommonTest 

  object sandbox extends CommonTest 
}

Now running mill scalascriptengine.test runs the tests in the test folder but running mill scalascriptengine.sandbox runs the same tests. So it seems sandbox still points to src/test/scala.

Also creating an intellij project doesn't see src/sandbox/scala as a test classpath

mill --version Mill Build Tool version 0.7.4 Java version: 1.8.0_181, vendor: Oracle Corporation, runtime: /home/ariskk/programs/jdk/jre Default locale: en_GB, platform encoding: UTF-8 OS name: "Linux", version: 5.4.0-48-generic, arch: amd64
Tobias Roeser
@lefou
@kostaskougios If you're extending SbtModule, sources are searched under src/main/scala and so on ... Bet run mill show __.sourcesto see which actual source paths are configured. To see which files mill will feed to the compiler, run mill show __.allSourcesFiles.
@dwalend It depends on which target platform you expect to build. There is no out-of-the-box mill plugin to do ssh work, but there are ready to use open sources libraries if you want to do it a a reproducible platform-neutral way. But if simply shelling out or invoking a platform installed ssh work for you, it will be good too.
Tobias Roeser
@lefou
About the out.jar, it looks pretty hardcoded. Either take the returned file an move/rename it or make it configurable and submit a PR.
@nnovod What are your open issues to contribute? Building, Testing, git? Regarding the issue, I'm not the best advisor for JS related questions. That said, isn't it enough to locally override the fastOpt target, move/rename the file and return it?
nnovod
@nnovod
@lefou The issue was lihaoyi/mill#496. The problem is not the name of the output files - as you say that can easily be fixed by overriding fastOpt to copy the file after a call to super.fastOpt - the problem is that in the output js there's a reference to the out.js.map file. That too could be fixed in a fastOpt override, but it seems a bit messy to have to change the internals of the created js file. As for building/testing/git - that's what I'm asking about. If I contribute a fix for the issue what's the convention for building/testing/git? Is there documentation anywhere for how to contribute? Thanks.
@keynmol I looked at your example ( https://github.com/keynmol/http4s-laminar-stack/blob/master/build.sbt#L95) and I see how that works for the js file but doesn't that fail when the browser looks for the associated map file (e.g., out.js.map)?
Anton Sviridov
@keynmol
Aye, I could've made it work with source map as well. Problem is - source maps in general work for me like 5% of the time so I don't really rely on them. But the principle would be the same
nnovod
@nnovod
Yea - except that you need to modify the line in the output js file to point to the map file you copy - not hard but a bit less robust than simply copying the files.
Anton Sviridov
@keynmol
I see. I wonder if one can use https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/SourceMap when serving the .js file and that should take precedence over the incorrect header in the js file
disclaimer: I haven't tried it myself and I have a sneaky suspicion as to why source maps didn't work out for me :D
shota jolbordi
@shotexa

I have a problem downloading javafx modules using mill

val javaFXModules =
    List("base", "controls", "fxml", "graphics", "media", "swing", "web")
      .map(m => ivy"org.openjfx:javafx-$m:14.0.1;classifier=mac")

  def ivyDeps = Agg(ivy"org.scalafx::scalafx:14-R19") ++ javaFXModules

this code fails, with the following log from bloop

not found: https://repo1.maven.org/maven2/org/openjfx/javafx-base/14.0.1/javafx-base-14.0.1-${javafx.platform}.jar
not found: https://repo1.maven.org/maven2/org/openjfx/javafx-controls/14.0.1/javafx-controls-14.0.1-${javafx.platform}.jar
not found: https://repo1.maven.org/maven2/org/openjfx/javafx-fxml/14.0.1/javafx-fxml-14.0.1-${javafx.platform}.jar
not found: https://repo1.maven.org/maven2/org/openjfx/javafx-graphics/14.0.1/javafx-graphics-14.0.1-${javafx.platform}.jar
not found: https://repo1.maven.org/maven2/org/openjfx/javafx-media/14.0.1/javafx-media-14.0.1-${javafx.platform}.jar
not found: https://repo1.maven.org/maven2/org/openjfx/javafx-swing/14.0.1/javafx-swing-14.0.1-${javafx.platform}.jar
not found: https://repo1.maven.org/maven2/org/openjfx/javafx-web/14.0.1/javafx-web-14.0.1-${javafx.platform}.jar

looks like ${javafx.platform} is not getting interpolated, it should be either mac linux or windows, as I’ve checked and those urls work correctly with one of those platforms injected into the string instead of ${javafx.platform}

Can anybody help?

shota jolbordi
@shotexa
same when I run mill foo.compile
Failed to load source dependencies
  not found: https://repo1.maven.org/maven2/org/openjfx/javafx-base/14.0.1/javafx-base-14.0.1-${javafx.platform}.jar
shota jolbordi
@shotexa
@rom1dep hay, just saw that you had a similar problem lately, have you been able to find a temporary workeround at liest?
Romain DEP.
@rom1dep
shotexa: hey :) Yes, I'm using a patched version of mill with this PR in it: lihaoyi/mill#775
shota jolbordi
@shotexa
Ah...alright (
Kostas Kougios
@kostaskougios

@lefou so :

ariskk@kostas-pc:~/idea-workspace/terminal21$ mill show scalascriptengine.test.sources [1/1] show [1/1] scalascriptengine.test.sources [ "ref:b5fcb12b:/home/ariskk/idea-workspace/terminal21/scalascriptengine/src/test/scala", "ref:c984eca8:/home/ariskk/idea-workspace/terminal21/scalascriptengine/src/test/java" ]
In https://www.lihaoyi.com/mill/page/configuring-mill.html it says "Each of which will expect their sources to be in their respective foo/test and foo/integration folder."

Tobias Roeser
@lefou
@kostaskougios This it true for ScalaModule, but SbtModule (which itself extends ScalaModule) redefines the sources and resources paths to make the project layout compatible to sbt and Maven. Hence the name SbtModule.
If you use ScalaModule instead of SbtModule in scalascriptengine module, it might work as expected.
Tobias Roeser
@lefou
@nnovod Building and testing mill is documented in the project Readme. https://github.com/lihaoyi/mill#how-to-build-and-test
For a PR, just fork, commit to a new branch and open the pull request on GitHub.
Kostas Kougios
@kostaskougios

ok thanks @lefou , I modified the code to:

```object sandbox extends CommonTest {
override def sources = T.sources(
millSourcePath / 'src / 'sandbox / 'scala
)

override def moduleDeps = super.moduleDeps ++ Seq(scalascriptengine.test, lib.test)

}
```

And it works now.

Tobias Roeser
@lefou
@kostaskougios great
David Walend
@dwalend
Thanks @lefou . I'll hack a bit over the next few days, see what I can do.
Markus Lottmann
@ml86
Hello everyone. I have a question regarding reading artifactory credentials from ENV. I would like to use a construct like this to read the env variable:
T.input { T.ctx.env.get("JFROG_USER").get } my problem is that this is a Target construct and this cannot be used in def repositories = super.repositories ++ Seq(MavenRepository("...", authentication = Some(coursier.core.Authentication(...)))
because repositories isnt a T block
any tips on how to get ENV variable in the authentication data for a MavenRepository
?
Tobias Roeser
@lefou
You can still use the standard Java way to access env variables (System.getenv) but they will not updated after the mill server was started. You can force a shutdown though with mill shutdown, and after it, the new mill server instance should pick up the up-to-date env value.
Nathaniel Fischer
@kag0
or (I think) if you use mill -i the env should be evaluated on each run
Tobias Roeser
@lefou
Yeah, that's correct. Thanks for the hint.
Markus Lottmann
@ml86
Thx for the tips @lefou and @kag0 . That is definitely working but i fear that the mill shutdown is quite a usage hassle. If toyed around some more and found this solution for me:
  var _jfrogUser = ""
  var _jfrogPassword = ""

  def jfrogUser = T.input { T.ctx.env.get("JFROG_USER").get }
  def jfrogPassword = T.input { T.ctx.env.get("JFROG_PASSWORD").get }

  // This is very hacky. We know that this function is always called before
  // repositories() and thus updating the _jfrogXXX variables works here.
  // I found no other place to do this.
  override def compileIvyDeps = T {
    _jfrogUser = jfrogUser()
    _jfrogPassword = jfrogPassword()
    super.compileIvyDeps()
  }

  def repositories = {
    super.repositories ++ Seq(
      MavenRepository("...",
        authentication = Some(coursier.core.Authentication(_jfrogUser, _jfrogPassword)))
    )
  }
@lefou I know it would be an API change but is there otherwise a reason to not make repositories a task?
Tobias Roeser
@lefou
That depends on the various call sites. Can't tell you right now if this is possible. It probably is, with some refactoring I guess.
At least making it a T.task (without any caching) might work.
Suminda Sirinath Salpitikorala Dharmasena
@sirinath
After saving mill.bat created an empty build.sc and ran mill. I get ←[31mSelector cannot be empty←[39m Failed to connect to server.
3 replies
When I type mill --help I get
Mill Build Tool
usage: mill [mill-options] [target [target-options]]

  -c, --code           Pass in code to be run immediately in the REPL
  -h, --home           The home directory of the REPL; where it looks for config and caches
  -p, --predef      Failed to connect to server
Suminda Sirinath Salpitikorala Dharmasena
@sirinath
Also I have an existing dir structure from Gradle in the form of <main project>\<sub project>\src\<source set>\<language or tool | resources>. E.g. leo\gen\src\main\java, leo\aop\src\main\aspectj, etc. I want to keep using the existing dir struct.