ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Lalevée <nicolas.lale...@hibnet.org>
Subject Re: [Ivy] A workspace resolver for Ant
Date Mon, 26 Jan 2015 14:54:11 GMT

> Le 26 janv. 2015 à 00:38, Antoine Levy Lambert <antoine@gmx.de> a écrit :
> 
> Hello Nicolas,
> 
> I am trying to understand in which use case I would need this resolver. It seems to be
in the case that you want to build using Ant a stack of modules in a directory tree, and use
the target/classes folder of each module as a dependency.
> 
> Does this workspace resolver also has something for test classes which usually are output
to a different root folder (for instance target/test-classes).

Good use case yes. This is not supported by the current code, since we need to define a configuration.
But I guess we could write something like this:

<ivy:configure file="ivysettings.xml">
 <workspaceResolver name="myresolver">
     <fileset dir="${basedir}" includes="*/ivy.xml" />
     <artifact conf="runtime" type="dir" ext="" path="target/classes" />
     <artifact conf="test" type="dir" ext="" path="target/test-classes" />
 </workspaceResolver>
</ivy:configure>

Also not supported right now, real artifact files could be defined like that:
<artifact name="[module]" type="jar" ext="jar" path="target/dist/[module].jar" />
<artifact name="[module]" type="source" ext="jar" path="target/dist/[module]-sources.jar"
/>

And things we should look at also are the ant triggers from Ivy. The ideal use case will be
that a workspace resolver will figure out which project is needed to build the current one,
and thus trigger a build of the selected dependent project.

Nicolas

> 
> Best regards Nicolas, great to see all the work you do for ivy.
> 
> Antoine
> 
> 
> 
> On Jan 25, 2015, at 4:51 PM, Nicolas Lalevée <nicolas.lalevee@hibnet.org> wrote:
> 
>> Hi,
>> 
>> We’ve been wondering if the workspace resolver which exists for IvyDE could be
transposed to the Ant world. I think I have made a working one. And I just pushed it.
>> 
>> The main issue in the design was about how Ant would be able to describe to Ivy the
projects to take into account, and which would then be their artifacts. As a principle, I
didn’t want to declare the workspace resolver in the ivysettings. Because the settings,
for me, should be quite independent of the environment is it used. For instance I want it
to work both within an Ant build file and in Eclipse with IvyDE. And IvyDE’s workspace resolver
doesn’t need a modification of the end user's ivysettings in order to properly work.
>> 
>> To describe the modules, I just used a fileset of the ivy.xml files of the projects.
Then everything would be relative to them, just like the buildlist ant task is working.
>> 
>> Then about declaring the artifacts, I have made them explicit. This might not be
the most flexible. I’m not sure how to do better though.
>> 
>> Then the integration with Ant would be done via the configure task. Here an exemple.
>> 
>> <ivy:configure file="ivysettings.xml">
>>  <workspaceResolver name="myresolver">
>>      <fileset dir="${basedir}" includes="*/ivy.xml" />
>>      <artifact type="dir" ext="" path="target/classes" />
>>  </workspaceResolver>
>> </ivy:configure>
>> 
>> 
>> I have only did some small unit tests for now. This need some proper integration
test to be fully validated.
>> 
>> Any comment is welcomed.
>> 
>> Nicolas
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
>> For additional commands, e-mail: dev-help@ant.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message