I ended up coming my own solution that I think works well enough.

I used extended attirbutes in the ivy.xml to specify what platform I'm on:

<info organisation="org" module="${ant.project.name}" revision="${version}" 
e:platform="${platform}"/>

When we go to resolve though, the ivy.xml file gets overwritten, so I created 
ivy.xml.orig, and passed that to the ivy:resvole when i needed to:

<ivy:resolve file="ivy.xml.orig" />

Then when I create a dependency, I specify the extra attribute:
<dependency name="libCommon" rev="trunk" e:platform="${platform}" />

(again, I must use a separate ivy.xml file, otherwise it'll get over written..)

I also modified the paths of the resovler to account for the platform:
        <ivy 
pattern="${user.home}/.ivy2/local/[organisation]/[module]/[platform]/ivys/ivy-[revision].xml"/>
        <artifact 
pattern="${user.home}/.ivy2/local/[organisation]/[module]/[platform]/[type]s/[artifact].[ext]"/>


This seems to be working well enough for me.. It means that I have to use the 
extra ivy.xml.orig file, but thats ok I guess.

--John


> -----Original Message-----
> From: John Sutherland
> Sent: Friday, March 16, 2012 10:21 AM
> To: ivy-user@ant.apache.org
> Subject: Compiling/storing for multiple arch.
> 
> Hi everyone,
> 
> I'm just starting out with Ivy, and I have a 'simple' project working.
> Now I'm starting to complicate it, and unsure of which direction to go.
> 
> We're doing cross compiling of embedded C/C++ code, using a mix of
> Bamboo, Ant, CMake.. (Ant handles the 'high level' interaction with
> Bamboo, CMake actually builds the lib/app)... In order to help out with
> the dependencies between libraries and exes, we're attempting to
> introduce Ivy..
> 
> So I have 2 projects, libA and ExeB... ExeB depends on A.. I have this
> case working with Ivy.. I can compile up libA, add the artifacts
> (headers and lib) into ivy, pull them down in ExeB and compile ExeB.. I
> can do this for a single arch...
> 
> The problem I'm facing is how do I store things through Ivy, so that I
> can use multiple arch.. I need to compile a version of the lib for ARM,
> another for x86, etc.., and be able to use that arch of the lib when I
> compile that arch of the exe.
> 
> I thought about using configurations, one configuration for each
> platform (x86, arm), but that doesn't look like it'll work, because ivy
> expects all artifacts for every configuration to be ready.. Thats not
> really feasible..
> 
> Maybe somehow using multiple resolvers and repos might work? Have one
> for arm, another for x86..
> 
> Has anyone else in the Ivy world used Ivy in this manner, and if so,
> how did you solve this?
> 
> Thank you in advance,
> 
> John
> Software Engineer
> HemisphereGPS

Reply via email to