- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
BuildManager and dependencyAnalysis
Fri, 2011-12-23, 12:39
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!
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!
Sun, 2012-01-01, 00:21
#2
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.
Sun, 2012-01-01, 01:41
#3
Re: BuildManager and dependencyAnalysis
Thanks for this idea Seth, I'll have a look at it.
On Fri, Dec 23, 2011 at 3:39 AM, etorreborre <etorreborre@gmail.com> wrote:
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.)