Patch to add an ivy:eclipse ant task that generates Eclipse .classpath files
----------------------------------------------------------------------------

                 Key: IVY-1016
                 URL: https://issues.apache.org/jira/browse/IVY-1016
             Project: Ivy
          Issue Type: New Feature
          Components: Ant
    Affects Versions: trunk
            Reporter: Jing Xue


I put together a post-resolve ivy:eclipse task that updates the Eclipse 
.classpath file according to the result of ivy:resolve.  It also will discover 
any source jars if they are part of the resolve/download, and automatically 
attach them to the corresponding entries.

For example,  I have this entry in ivy.xml:
{code:xml|title=ivy.xml}
<dependency org="commons-collections" name="commons-collections" rev="3.2.1" 
conf="compile;references">
    <artifact name="commons-collections" type="sources" ext="jar" 
m:classifier="sources" conf="references" />
</dependency>
{code}

In build.xml, I have:
{code:xml|title=build.xml}
<target name="eclipse" description="Updates eclipse classpath.">
    <ivy:configure settingsId="ivy.eclipse" override="true" />
    <ivy:resolve settingsRef="ivy.eclipse" conf="compile, references" />
    <ivy:eclipse settingsRef="ivy.eclipse" conf="compile, references" />
</target>
{code}

And running 'ant eclipse' will update my .classpath with the cache path to the 
commons-collections jar, with its sources jar attached.  The classpath entry 
will be annotated with an ivygen="true". Next time I run 'ant eclipse', this 
entry will be recognized and replaced with whatever updated paths.

This is only the first draft. I know there is IvyDE, but I feel that this could 
be a good starting point for a alternative that is more Ant-oriented.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to