How would you go about this in a simple fashion? Thanks for any
pointers.
Not knowing anything about native eclipse metadata other than what
I've seen in your action, I would recommend 4 as well. It seems like
it should be the best way to be consistent between sbt and eclipse.
Except for the Scala jars, compileClasspath is exactly what does on
the project's classpath at compile time. This isn't necessarily the
case for the other options (manually managed dependencies, for
example).
> Also wondering what Mark's thoughts are on IDE integration.
Since I don't use an IDE, I would defer anything IDE-specific to
others. I would want to include in sbt the basic support like the
eclipseClasspath action you wrote. Anything much further would be a
separate project.
-Mark
If you guys really do want to go with number 4, this is what I recommend:
Although I am not a big fan, I would go the Maven way. (I'm aware of
Ivy's advantages but never used IvyDE - just guessing now with Eclipse
IAM Maven support is getting better and better - let alone the fact
that it's more popular).
Francisco
Thanks for looking at this...
Is 'deliver-local' what you are looking for? It should generate an
Ivy file in the output directory with name ivy-<project-version>.xml.
It is the step prior to publishing.
-Mark
Is 'deliver-local' what you are looking for? It should generate an
Ivy file in the output directory with name ivy-<project-version>.xml.
It is the step prior to publishing.
There is no ivyOutput because Ivy works off of patterns, so there is a
deliveredIvyPattern that tells Ivy to write the Ivy file to outputPath
/ "[artifact]-[version].[ext]" and for the Ivy file, [artifact]=ivy
and so forth.
There is a copyTask(sources, targetDirectory), but it always performs
the copy (it is not a fileTask) and you don't specify the output file.
Also, you can just do path("ivy-export.xml") if you like.
-Mark
On 7/6/09, francisco treacy <francisc...@gmail.com> wrote:
>
> This should be good enough to get started:
>
> 1. Install IvyDE - see http://ant.apache.org/ivy/ivyde/
>
> 2. Setup your sbt project (dependencies, repos, settings, ...)
>
> 3. Comment/ uncomment dependencies in your project definition; after
> each change:
> a) Issue 'reload' and 'deliver-local' in the sbt console
> b) Update Eclipse classpath container like so:
> i) To setup IvyDE for the first time: Go to project properties ->
> Java Build Path. Make sure you use the same version of Scala in both
> Eclipse and sbt. Then Add Library... -> IvyDE managed dependencies ->
> Ivy file: target/ivy-1.0.xml. Select appropriate configurations.
> ii) To update once it's set up: right-click on the Ivy container
> in your project (should look like target/ivy-1.0.xml [compile]) and
> click on the bottommost Refresh (ie not the one with F5 but just below
> Resolve)
>
> Note: A glitch is that the "1.0" part of the file is your project
> version - so of course YMMV, especially when incrementing your minor
> version (i.e. after 'release' or any other call to
> 'increment-version'). What basically Nathan's approach aimed to solve.
>
> Question: is there any way of getting the resolved ivy.xml sometime
> before than "deliver-local"? Like, why do I need to pass through the
> 'package' phase?
Yes, there should really be something specific to your requirements.
'package' is needed for the usual case, but not for synchronizing with
an IDE. Try the following:
def idePublishConfiguration = new DefaultPublishConfiguration("local",
"release") {
override protected def deliveredPathPattern = outputPath / "[artifact].[ext]"
}
lazy val deliverIde = deliverTask(idePublishConfiguration, deliverOptions)
The first part defines a configuration that delivers the Ivy file
without a version. The second part uses that configuration for a
custom deliver action. Let me know how this works out.
> Btw, I've been playing with a webapp in Eclipse and sbt ... I realize
> this is an awesome piece of software. Thanks.
> Hopefully at some point I will elaborate on these experiences.
Great, thanks for what you have already contributed!
-Mark
[1] http://code.google.com/p/simple-build-tool/wiki/IntegrationSupport