This page is no longer maintained — Please continue to the home page at www.scala-lang.org

BuildManager and dependencyAnalysis

3 replies
etorreborre 2
Joined: 2011-02-23,
User offline. Last seen 42 years 45 weeks ago.
Hi,
I've just implemented a new feature for specs2 to define and check dependencies between packages.
I've been using the SimpleBuildManager and the "-make:transitive" setting to access the dependencyAnalysis information. Then I had a go at using "-make:transitive" in sbt (to check if the .scala_dependencies file was generated) and I had the following message:
[warn] -make is deprecated: this option is unmaintained.  Use sbt or an IDE for selective recompilation.

Could you please tell me how stable is the dependencyAnalysis functionality in the compiler and if I can bet for this being around for a long time? Otherwise thanks for telling me what's the best strategy for accessing dependency information between packages.
Another related question: is there a more efficient way to check the dependencies between packages once the code source has already been compiled? I find it a bit unfortunate to have to recompile the files in order to get this info. I tried to skip some of the compiler phases like this:
    settings.stopAfter.value      = List("dependencyAnalysis")    settings.skip.value           = List("flatten", "liftcode", "jvm")
but my compiler knowledge is very minimal and there might be much better ways.
Eric.
PS: the compiler code I read was not too hard to navigate and understand. That was a pleasant surprise!
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: BuildManager and dependencyAnalysis


On Fri, Dec 23, 2011 at 3:39 AM, etorreborre <etorreborre [at] gmail [dot] com> wrote:

[warn] -make is deprecated: this option is unmaintained.  Use sbt or an IDE for selective recompilation.

Just to give you some background on this, it's deprecated because it's known not to work right and people (by which I mean the only developers likely to work on it) were saying things to the effect that you shouldn't use it.  I don't believe in shipping features which don't work and which nobody is attempting to fix without any warning label attached, so I deprecated it.  I don't have good answers to your other questions either (I'm not sure there are good answers.)
Seth Tisue
Joined: 2008-12-16,
User offline. Last seen 34 weeks 3 days ago.
Re: BuildManager and dependencyAnalysis

On Fri, Dec 23, 2011 at 6:39 AM, etorreborre wrote:
> Another related question: is there a more efficient way to check the
> dependencies between packages once the code source has already been
> compiled?

I've used Classycle for this some years now and have been pleased.

Like ProGuard, Classycle analyzes .class files (and doesn't care
whether they came from Java or Scala sources). You might also look at
ProGuard's reporting features (iirc it has some!), rather than using
it as a jar shrinker.

Of course there are cases where one source depends on another but the
dependency doesn't show up in the class files, for example, when
constants is inlined. You might not care, depending on your use case.

etorreborre 2
Joined: 2011-02-23,
User offline. Last seen 42 years 45 weeks ago.
Re: BuildManager and dependencyAnalysis

Thanks for this idea Seth, I'll have a look at it.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland