ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eelamae <eela...@yahoo.com>
Subject Using Ivy to manage platform dependent non-java binaries
Date Wed, 29 Sep 2010 16:35:04 GMT

Hello:

My java projects uses platform dependent native 3rd party binaries.  When
the product is built, all the platform dependent native binaries are
packaged in.

The binaries are available on network file system and mounted on the build
host as a NFS file system (this would be moved to a proper repository once
all are working). The directory structure is as follows;

/work/project/repos/external/bin/linux-ia32/rt2app
/work/project/repos/external/bin/linux-x86_64/rt2app
/work/project/repos/external/bin/solaris-sparc/rt2app
/work/project/repos/external/bin/solaris-sparc64/rt2app
/work/project/repos/external/bin/windows-ia32/rt2app.exe
/work/project/repos/external/bin/windows-x86_64/rt2app.exe

(Note:  Unfourtunately the artifact names are all the same and I do not have
control over this as it is a 3rd party library)

So I wrote the ivy settings file as follows

<ivysettings> 
  <settings defaultResolver="rt2binaries"/>
  <resolvers>
    <chain name="rt2binaries">

      <filesystem name="linux-ia32" checkmodified="yes"
cache="rt2-linux-ia32-cache">
        <artifact
pattern="/work/project/repos/external/bin/linux-ia32//[artifact]" />
      </filesystem>

      <filesystem name="solaris-sparc" checkmodified="yes"
cache="rt2-solaris-sparc-cache">
        <artifact
pattern="/work/project/repos/external/bin/linux-ia32/[artifact]" />
      </filesystem>

      <filesystem name="windows-ia32" checkmodified="yes"
cache="rt2-windows-ia32-cache">
        <artifact
pattern="/work/project/repos/external/bin/linux-ia32/[artifact].[ext]" />
      </filesystem>

    </chain>
  </resolvers>
  <caches>
    <cache name="rt2-linux-ia32-cache" basedir="/opt/project/buildcache"
artifactPattern="[organization]/linux-ia32/[artifact]"/>
    <cache name="rt2-solaris-sparc-cache" basedir="/opt/project/buildcache"
artifactPattern="[organization]/solaris-sparc/[artifact]"/>
    <cache name="rt2-windows-ia32-cache" basedir="/opt/project/buildcache"
artifactPattern="[organization]/windows-ia32/[artifact]"/>

  </caches>
</ivysettings> 

And also created ivy.xml as follows

<ivy-module version="2.0">
    <info organisation="com.mycom" module="libs"/>
    <configurations>
        <conf name="rt2bins-linux-ia32"/>
        <conf name="rt2bins-solaris-aparc"/>
        <conf name="rt2bins-windows-ia32"/>
    </configurations>
    <dependencies>
      <dependency org="com.mycom" name="rt2app" rev=""
conf="rt2bins-linux-ia32->default"/>
      <dependency org="com.mycom" name="rt2app" rev=""
conf="rt2bins-solaris-aparc->default"/>
      <dependency org="com.mycom" name="rt2app" rev=""
conf="rt2bins-windows-ia32->default"/>
    </dependencies>
</ivy-module>

In the build file;

<target name="resolve" description="--> resolve rt2 bins">
    <ivy:retrieve conf="rt2bin-linux-ia32"
pattern="${lib.dir}/linux-ia32/[artifact]"/>
    <ivy:retrieve conf="rt2bin-solaris-aparc"
pattern="${lib.dir}/solaris-aparc/[artifact]"/>
    <ivy:retrieve conf="rt2bin-windows-ia32"
pattern="${lib.dir}/windows-ia32/[artifact].exe"/>
</target>

The problem is that when run the rt2app of linux-ia32 binary is copied for
all other platforms (because in the chain resolver the first one always
matches).

Really appreciate any help as to how this can be done.

Thanks,
Eelamae

-- 
View this message in context: http://old.nabble.com/Using-Ivy-to-manage-platform-dependent-non-java-binaries-tp29840412p29840412.html
Sent from the ivy-user mailing list archive at Nabble.com.


Mime
View raw message