Yes, you probably do want externalDependencyClasspath for transitive dependencies, not including the output directory and inter-project dependencies.
Scott intentionally excluded transitive dependencies by only including dependencies list in libraryDependencies. There was a somewhat recent discussion on this mailing list about it.
The UpdateReport from 'update' has the ModuleIDs for all managed dependencies.
Can you follow up with what from the original email is/isn't resolved?
-Mark
As Mark noted, I did this on purpose -- is there something that doesn't work correctly without listing the transitive libs?
Btw, HUGE thanks for the help!
The UpdateReport from 'update' has the ModuleIDs for all managed dependencies.
Can you follow up with what from the original email is/isn't resolved?
> On Monday, 6 June 2011 15:20:20 UTC+1, Mark Harrah wrote:
> >
> > The UpdateReport from 'update' has the ModuleIDs for all managed
> > dependencies.
> >
> Right, but they also include project dependencies. I wanted to remove
> those. Because externalDependencyClasspath only returns the File and not the
> actual ModuleID, it wasn't as easy as I'd hoped. I guess I could iterate
> through the artifacts for each ModuleID and then match them against the
> Files returned via externalDependencyClasspath. Or is there a better way?
Hmm, yes that could be added to sbt. As you probably know by now, a classpath is Seq[Attributed[File]]. Attributed is a typesafe heterogeneous map. It is currently only used to track the Analysis instance for an entry, but could probably be extended to associate the ModuleID and Artifact with the entry. Please open a ticket if this sounds good.
> To give some context, the current code uses the ModuleID information to
> create an IDEA library and then the IDEA library is referenced via the name.
> That's why it's preferable to have a ModuleID than just the File. Also, the
> ModuleID is again used when matching the classifiers.
>
> > Can you follow up with what from the original email is/isn't resolved?
> >
> 1. The source for the Scala library doesn't get associated with the library
> (the source for other libraries does get associated though).
>
> I think this is still unresolved, but I'll investigate the artifacts
> returned via update-sbt-classifiers and maybe that will clarify things.
Ok. If you still see an issue with sources/javadocs being checked multiple times, mention that as well. I would guess that if it happens, it is only for ones that don't exist.
> 2. If the scala-compiler is a classpath dependency, it doesn't get added as
> an IDEA dependency.
>
> I believe this will be resolved once transitive dependencies are included as
> I get it via lift-json in my project.
I agree. I initially thought that you meant a direct dependency wasn't included, but this makes sense.
Hmm, yes that could be added to sbt. As you probably know by now, a classpath is Seq[Attributed[File]]. Attributed is a typesafe heterogeneous map. It is currently only used to track the Analysis instance for an entry, but could probably be extended to associate the ModuleID and Artifact with the entry. Please open a ticket if this sounds good.
Ok. If you still see an issue with sources/javadocs being checked multiple times, mention that as well. I would guess that if it happens, it is only for ones that don't exist.
Hi Graham,
That's awesome, thanks a million!
Cheers,
Erik
1. clone and build Ismael's sbt-idea:git clone https://github.com/ijuma/sbt-idea.gitcd sbt-ideagit checkout sbt-0.10./sbt package
Hmm I'm getting the following errors at the moment, so it looks like
some of the Maven repos are down (right)?
Cheers,
Erik
[erik@dixie:/tmp/sbt-idea ]$./sbt publish-local
Getting Scala 2.7.7 ...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
2 artifacts copied, 0 already retrieved (9911kB/142ms)
Getting org.scala-tools.sbt sbt_2.7.7 0.7.4 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
15 artifacts copied, 0 already retrieved (4096kB/99ms)
[info] Recompiling plugin definition...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info]
[info] Updating plugins...
[error] Server access Error: Connection timed out
url=http://tristanhunt.com:8081/content/groups/public/org/scala-tools/sbt/process/0.1/process-0.1.pom
[error] Server access Error: Connection timed out
url=http://tristanhunt.com:8081/content/groups/public/org/scala-tools/sbt/process/0.1/process-0.1.jar
[error] Server access Error: Connection timed out
url=http://www2.ph.ed.ac.uk/maven2/org/scala-tools/sbt/process/0.1/process-0.1.jar
No, I was using the one provided in your git repo. When I use 0.10.0
it wants to pull in 0.7.4. I'm guessing this is due to
project/build.properties containing sbt.version=0.7.4? I don't see any
build.sbt file for 0.10.0 either so I'm a bit lost as to what's going
on here I'm afraid...
Cheers,
Erik
--------
[erik@dixie:/tmp/x/sbt-idea ]$ java -Xmx512M -jar /opt/sbt/sbt-launch-0.10.0.jar
Getting org.scala-tools.sbt sbt_2.8.1 0.7.4 ...
:: problems summary ::
:::: WARNINGS
module not found: org.scala-tools.sbt#sbt_2.8.1;0.7.4
==== local: tried
/home/erik/.ivy2/local/org.scala-tools.sbt/sbt_2.8.1/0.7.4/ivys/ivy.xml
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.7.4!sbt_2.8.1.jar:
/home/erik/.ivy2/local/org.scala-tools.sbt/sbt_2.8.1/0.7.4/jars/sbt_2.8.1.jar
==== Maven2 Local: tried
file:///home/erik/.m2/repository/org/scala-tools/sbt/sbt_2.8.1/0.7.4/sbt_2.8.1-0.7.4.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.7.4!sbt_2.8.1.jar:
file:///home/erik/.m2/repository/org/scala-tools/sbt/sbt_2.8.1/0.7.4/sbt_2.8.1-0.7.4.jar
==== typesafe-ivy-releases: tried
http://repo.typesafe.com/typesafe/ivy-releases/org.scala-tools.sbt/sbt_2.8.1/0.7.4/ivys/ivy.xml
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.7.4!sbt_2.8.1.jar:
==== Maven Central: tried
http://repo1.maven.org/maven2/org/scala-tools/sbt/sbt_2.8.1/0.7.4/sbt_2.8.1-0.7.4.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.7.4!sbt_2.8.1.jar:
http://repo1.maven.org/maven2/org/scala-tools/sbt/sbt_2.8.1/0.7.4/sbt_2.8.1-0.7.4.jar
==== Scala-Tools Maven2 Repository: tried
http://scala-tools.org/repo-releases/org/scala-tools/sbt/sbt_2.8.1/0.7.4/sbt_2.8.1-0.7.4.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.7.4!sbt_2.8.1.jar:
http://scala-tools.org/repo-releases/org/scala-tools/sbt/sbt_2.8.1/0.7.4/sbt_2.8.1-0.7.4.jar
==== Scala-Tools Maven2 Snapshots Repository: tried
http://scala-tools.org/repo-snapshots/org/scala-tools/sbt/sbt_2.8.1/0.7.4/sbt_2.8.1-0.7.4.pom
-- artifact org.scala-tools.sbt#sbt_2.8.1;0.7.4!sbt_2.8.1.jar:
http://scala-tools.org/repo-snapshots/org/scala-tools/sbt/sbt_2.8.1/0.7.4/sbt_2.8.1-0.7.4.jar
::::::::::::::::::::::::::::::::::::::::::::::
:: UNRESOLVED DEPENDENCIES ::
::::::::::::::::::::::::::::::::::::::::::::::
:: org.scala-tools.sbt#sbt_2.8.1;0.7.4: not found
::::::::::::::::::::::::::::::::::::::::::::::
:: USE VERBOSE OR DEBUG MESSAGE LEVEL FOR MORE DETAILS
unresolved dependency: org.scala-tools.sbt#sbt_2.8.1;0.7.4: not found
Error during sbt execution: Error retrieving required libraries
(see /tmp/x/sbt-idea/project/boot/update.log for complete log)
Error: Could not retrieve sbt 0.7.4
No, I was using the one provided in your git repo.
You're in the wrong branch. Probably because there was a mistake in Graham's instructions:> git checkout sbt-0.10This should be git checkout -t origin/sbt-0.10 (as there is no local branch named sbt-0.10 at that point).
> Hey Mark,
>
> I've managed to get transitive dependencies to work by matching the
> Artifacts in the ModuleID and the Files returned
> by externalDependencyClasspath. One thing I noticed is that the same
> dependency would appear in many ConfigurationReports. Because
> externalDependencyClasspath doesn't include the configuration for each of
> the dependencies, I had to manually selecting the configuration with the
> highest priority (e.g. if a dependency appeared in "compile" configuration,
> I'd ignore all the other ones and so on). This matters because one can
> specify 4 scopes in the IDEA configuration ("compile", "runtime", "test",
> "provided"). By the way, the scala-compiler.jar did indeed appear with this
> fix.
>
> In relation to sbt-update-classifiers, the result
> of EvaluateTask.evaluateTask(buildStruct, Keys.updateSbtClassifiers, state,
> projectRef, false, EvaluateTask.SystemProcessors) is:
>
> Some(Inc(Incomplete(node=Some(ScopedKey(Scope(Select(ProjectRef(file:/media/internal0/home/ijuma/idea-workspace/foo/,common)),Global,Global,Global),update-sbt-classifiers)),
> tpe=init$default$2, msg=None, causes=List(),
> directCause=Some(sbt.ResolveException: unresolved dependency:
> org.scala-tools.sbt#sbt_2.9.0-1;0.10.0: not found))))
That is probably a bug in update-sbt-classifiers. It probably needs to fix the scala version used for sbt's cross version.
Yeah, that's a bit unreasonable and merits a bug report. I don't have any immediate solutions, so it might not get addressed right away.
-Mark
You should also be able to create a ~/.sbt/plugins/project/Build.scala that contains an external project dependency. Something like:
lazy val root = Project("root", file(".")) dependsOn( uri("https://github.com/ijuma/sbt-idea.git"))
(with the usual additional structure). If you specify the commit or a tag as the fragment of the URI, you can use it to update to a new commit as well.
(I didn't try this out, so hopefully I'm not making this feature up.)
-Mark
That is probably a bug in update-sbt-classifiers. It probably needs to fix the scala version used for sbt's cross version.
Yeah, that's a bit unreasonable and merits a bug report. I don't have any immediate solutions, so it might not get addressed right away.
It would be great if a short summary of these instructions could be added as a readme.md to https://github.com/ijuma/sbt-idea/tree/sbt-0.10.
You should also be able to create a ~/.sbt/plugins/project/Build.scala that contains an external project dependency. Something like:
lazy val root = Project("root", file(".")) dependsOn( uri("https://github.com/ijuma/sbt-idea.git"))
(with the usual additional structure). If you specify the commit or a tag as the fragment of the URI, you can use it to update to a new commit as well.
(I didn't try this out, so hopefully I'm not making this feature up.)
> On Wednesday, 8 June 2011 03:04:53 UTC+1, Mark Harrah wrote:
> >
> > You should also be able to create a ~/.sbt/plugins/project/Build.scala that
> > contains an external project dependency. Something like:
> >
> > lazy val root = Project("root", file(".")) dependsOn( uri("
> > https://github.com/ijuma/sbt-idea.git"))
> >
> > (with the usual additional structure). If you specify the commit or a tag
> > as the fragment of the URI, you can use it to update to a new commit as
> > well.
> >
> > (I didn't try this out, so hopefully I'm not making this feature up.)
> >
> >
> > You're not :) The full ~/.sbt/plugins/project/Build.scala that works for me
> is:
Ok, that's good.
> import sbt._
>
> object MyPlugins extends Build {
> lazy val root = Project("root", file(".")) dependsOn
> (uri("git://github.com/ijuma/sbt-idea.git#sbt-0.10"))
> }
>
> ("https:" uri didn't work for me, had to change it to "git:")
>
> This is very awesome.
>
> Will sbt ever do a pull/fetch on this git url, or do I have to delete the
> .sbt/staging directory to force an update?
It does not currently. You don't have do delete it, but you do have to change to the directory and do a 'git pull'. I don't think it would be too hard to write a command to auto-update all external projects.
-Mark
You're not :) The full ~/.sbt/plugins/project/Build.scala that works for me is:import sbt._object MyPlugins extends Build {lazy val root = Project("root", file(".")) dependsOn (uri("git://github.com/ijuma/sbt-idea.git#sbt-0.10"))}
--To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/-a6sNNfikvkJ.
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.
Hello Erik,
can you provide a little summary of what you did?
That would be helpfull.
best regards
> project/boot/�.
I don't know the details of sbt-idea, but from a quick look, it doesn't appear to hardcode project/boot. If you change anything about your build configuration, including sbt.boot.directory, you have to rerun gen-idea.
-Mark
Is there any simple way to automatically add the unmanaged library
jars (for example, those in the libs dir) to the generated project
files?