Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mill's idea generator failed to include library for module ivyDeps which is also imported for build.sc #527

Closed
yangguang760 opened this issue Jan 14, 2019 · 2 comments · Fixed by #616
Labels
solved The issue was fixed/resolved
Milestone

Comments

@yangguang760
Copy link

When the build.sc imported $ivy dependency, which is also dependency of modules, there would be no generated xml file for that dependency in .idea/libraries directory, and so intellij would not work with the dependency properly.

@steven-collins-omega
Copy link

I think #533 is more or less a duplicate of this, sorry. Let me copy/paste my report here and then I'll close #533:

This was discussed briefly in the Gitter channel on 23-25 Jan 2019.

One of the “selling” points of Mill is useful “Jump to Definition”. In fact, though, the generated IntelliJ project does not reference, download, or have local access to Mill's source jars.

It's tricky to test this because when you build and publish Mill locally, it publishes its source jars and then IntelliJ can find them. (Thus, building from source is a workaround for the problem.) The best I could come up with in my attempts to fix/troubleshoot this was to delete those source jars manually after publishing but before running for the first time. Also, a Mill custom-built from a local commit is going to have a version number different from anything on Maven, so pulling source jars will definitely fail anyway. I tried to get around that by setting the JVM prop MILL_VERSION to the latest version on Maven, but I don't know if that has other consequences for Mill's correct functioning.

I naively tried just changing https://github.com/lihaoyi/mill/blob/master/scalalib/src/GenIdeaImpl.scala#L83 from false to true (same caveat as above on setting MILL_VERSION), which did fetch the source jars from Maven, but also had the side effect that it didn’t put any information whatsoever about any of Mill’s dependencies in the .idea*/* files.

@nrktkt
Copy link
Contributor

nrktkt commented May 9, 2019

I suspect #602 is a duplicate of this issue as well.

Here's a build file I used to reproduce

// build.sc
import mill._
import scalalib._

interp.load.ivy(ivy"com.typesafe:config:1.3.4".dep)

@
object foo extends ScalaModule {
  def scalaVersion = "2.12.7"

 override def ivyDeps = Agg(
   ivy"com.typesafe:config:1.3.4"
 )
}

Fixing this would be great. It's a bit of a pain right now to manually re-add libraries to the idea projects every time the build changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved The issue was fixed/resolved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants