You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Eelamae <ee...@yahoo.com> on 2010/09/29 18:35:04 UTC

Using Ivy to manage platform dependent non-java binaries

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.


RE: Using Ivy to manage platform dependent non-java binaries

Posted by Shawn Castrianni <Sh...@halliburton.com>.
Yes, please see my previous posts on this topic (by searching the archives) as I also use a configuration for each platform and it works very nicely.

---
Shawn Castrianni


-----Original Message-----
From: Steve Miller [mailto:thatguy1177@gmail.com] 
Sent: Wednesday, September 29, 2010 12:00 PM
To: ivy-user@ant.apache.org
Subject: Re: Using Ivy to manage platform dependent non-java binaries

I don't think you need multiple repositories. Just create an ivy.xml
module file that has multiple configurations and multiple artifacts in
the publications section.   Then publish that module to your
repository. Then all other projects can ask for whichever artifact it
needs. Maybe see the configurations tutorial. I think that has an
example of multiple artifacts.

http://ant.apache.org/ivy/history/latest-milestone/tutorial/conf.html

Steve

On Wed, Sep 29, 2010 at 12:42 PM, Eelamae <ee...@yahoo.com> wrote:
>
> Correction:  Actually the artifact patter is as follws;
>
>    <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/solaris-sparc/[artifact]" />
>      </filesystem>
>
>      <filesystem name="windows-ia32" checkmodified="yes"
> cache="rt2-windows-ia32-cache">
>        <artifact
> pattern="/work/project/repos/external/bin/windows-ia32/[artifact].[ext]" />
>      </filesystem>
>
>    </chain>
>  </resolvers>
> --
> View this message in context: http://old.nabble.com/Using-Ivy-to-manage-platform-dependent-non-java-binaries-tp29840412p29840471.html
> Sent from the ivy-user mailing list archive at Nabble.com.
>
>

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

Re: Using Ivy to manage platform dependent non-java binaries

Posted by Steve Miller <th...@gmail.com>.
I don't think you need multiple repositories. Just create an ivy.xml
module file that has multiple configurations and multiple artifacts in
the publications section.   Then publish that module to your
repository. Then all other projects can ask for whichever artifact it
needs. Maybe see the configurations tutorial. I think that has an
example of multiple artifacts.

http://ant.apache.org/ivy/history/latest-milestone/tutorial/conf.html

Steve

On Wed, Sep 29, 2010 at 12:42 PM, Eelamae <ee...@yahoo.com> wrote:
>
> Correction:  Actually the artifact patter is as follws;
>
>    <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/solaris-sparc/[artifact]" />
>      </filesystem>
>
>      <filesystem name="windows-ia32" checkmodified="yes"
> cache="rt2-windows-ia32-cache">
>        <artifact
> pattern="/work/project/repos/external/bin/windows-ia32/[artifact].[ext]" />
>      </filesystem>
>
>    </chain>
>  </resolvers>
> --
> View this message in context: http://old.nabble.com/Using-Ivy-to-manage-platform-dependent-non-java-binaries-tp29840412p29840471.html
> Sent from the ivy-user mailing list archive at Nabble.com.
>
>

Re: Using Ivy to manage platform dependent non-java binaries

Posted by Eelamae <ee...@yahoo.com>.
Correction:  Actually the artifact patter is as follws;

    <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/solaris-sparc/[artifact]" />
      </filesystem>

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

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