Re: Beginner question

2010-08-29 Thread Archie Cobbs
First set up a resolver that points to the place you want to publish, e.g.
/usr/local/repo. Then use ivy:publish to put your artifacts (and ivy.xml
metadata) in there.

FWIW here are a couple of ant macros that I use for this...

!-- SVN revision --
macrodef uri=urn:org.dellroad.ant name=svnrevision
attribute name=property description=Name of property to set/
attribute name=dir default=${basedir}
  description=Target checked-out SVN directory/
sequential
exec outputproperty=@{property} executable=svnversion
  logError=true failonerror=true
arg value=-n/
arg value=@{dir}/
/exec
/sequential
/macrodef

!-- Ivy module build --
macrodef uri=urn:org.dellroad.ant name=ivydist
attribute name=version description=Ivy module version/
attribute name=resolver default=local-user
  description=Name of ivy resolver with which to publish/
attribute name=ivyfile default=${basedir}/src/ivy/ivy.xml
  description=Ivy file to publish/
element name=module-preparation implicit=true/
sequential
dellroad:svnrevision property=svn_revision/
delete dir=${basedir}/build/ivy/
mkdir dir=${basedir}/build/ivy/
copy file=@{ivyfile} toFile=${basedir}/build/ivy/ivy.xml/
module-preparation/
ivy:resolve settingsRef=build-macros-ivy-settings
  file=${basedir}/build/ivy/ivy.xml/
ivy:publish settingsRef=build-macros-ivy-settings
forcedeliver=true
  validate=true overwrite=true resolver=@{resolver}
  srcivypattern=${basedir}/build/ivy/ivy.xml
  pubrevision=@{version}-${svn_revision}
artifacts pattern=${basedir}/build/ivy/[artifact].[ext]/
/ivy:publish
/sequential
/macrodef

-Archie

On Sat, Aug 28, 2010 at 11:59 PM, Mark static.void@gmail.com wrote:

  How can I publish know jars.. ie ones that we already have that arent
 available on public repos to our private repo.. we dont have one yet :)

 Are there any tutorials out there that someone can recommended thats not
 the wiki. Unfortunately the wiki is kind of confusing. Thanks



-- 
Archie L. Cobbs


Re: Beginner question - Ivy depencency set -- ANT fileset/classpath?

2009-06-01 Thread Joshua Tharp
The way I do it (and I'm not claiming to be either an expert or using the
most elegant means) is I create different configurations for the different
classpaths I need in a build (compile, test, deploy) and have a ivy pattern
that includes the configuration ${lib.d}/[conf]/[artifact].[ext]. Then in my
ant scripts I just use separate filesets like:
fileset id=test.classpath dir=${lib.d}/test /

It works pretty well as I don' t have to adjust my classpaths when I add or
remove dependencies, and I can treat more of my build generically.

Josh


On Mon, Jun 1, 2009 at 10:02 AM, Jim Garrison jim.garri...@troux.comwrote:

 Having defined a dependency set, how do I reference the resulting list of
 resolved files as an ANT fileset in other ANT tasks?

 Do I have to maintain a separate fileset tag?



RE: Beginner question - Ivy depencency set -- ANT fileset/classpath?

2009-06-01 Thread Jim Garrison
 

 -Original Message-
 From: joshua.th...@gmail.com [mailto:joshua.th...@gmail.com] 
 On Behalf Of Joshua Tharp
 Sent: Monday, June 01, 2009 12:20 PM
 To: ivy-user@ant.apache.org
 Subject: Re: Beginner question - Ivy depencency set -- ANT 
 fileset/classpath?
 
 The way I do it (and I'm not claiming to be either an expert 
 or using the most elegant means) is I create different 
 configurations for the different classpaths I need in a build 
 (compile, test, deploy) and have a ivy pattern that includes 
 the configuration ${lib.d}/[conf]/[artifact].[ext]. Then in 
 my ant scripts I just use separate filesets like:
 fileset id=test.classpath dir=${lib.d}/test /
 
 It works pretty well as I don' t have to adjust my classpaths 
 when I add or remove dependencies, and I can treat more of my 
 build generically.

Hmmm I looked at cachepath and cachefileset and these don't
seem to do what I want.  I have, conceptually, a set of global 
dependencies across my entire project, and then some additional sets
of dependencies within various modules I'm building.

Using your approach, it sounds like I would need to build a resolved
lib structure like 

lib/common - dependencies used by all modules
lib/mod1 - dependencies specific to module 1
lib/mod2 - dependencies specific to module 2
etc

and then define 

fileset id=common dir=lib/common
   include name=*/
/fileset

Sounds like we need an enhancement giving access to the set of dependencies
inside a single ivy-module as a list or path, instead of the entire 
resolve/ set.

Re: Beginner question - Ivy depencency set -- ANT fileset/classpath?

2009-06-01 Thread Joshua Tharp
Alternatively, you can have your configurations extend one another and then
just use a single directory. For example, you could have the configurations:
conf name=common /
conf name=mod1 extends=common /
conf name=mod2 extends=common /

Then in your dependencies, simply say which configuration they belong to
(common, mod1, mod2, etc.) and on your build you can still use:
fileset id=mod1.classpath dir=${lib.d}/mod1 includes=*.jar /

Josh

On Mon, Jun 1, 2009 at 10:46 AM, Jim Garrison jim.garri...@troux.comwrote:



  -Original Message-
  From: joshua.th...@gmail.com [mailto:joshua.th...@gmail.com]
  On Behalf Of Joshua Tharp
  Sent: Monday, June 01, 2009 12:20 PM
  To: ivy-user@ant.apache.org
  Subject: Re: Beginner question - Ivy depencency set -- ANT
  fileset/classpath?
 
  The way I do it (and I'm not claiming to be either an expert
  or using the most elegant means) is I create different
  configurations for the different classpaths I need in a build
  (compile, test, deploy) and have a ivy pattern that includes
  the configuration ${lib.d}/[conf]/[artifact].[ext]. Then in
  my ant scripts I just use separate filesets like:
  fileset id=test.classpath dir=${lib.d}/test /
 
  It works pretty well as I don' t have to adjust my classpaths
  when I add or remove dependencies, and I can treat more of my
  build generically.

 Hmmm I looked at cachepath and cachefileset and these don't
 seem to do what I want.  I have, conceptually, a set of global
 dependencies across my entire project, and then some additional sets
 of dependencies within various modules I'm building.

 Using your approach, it sounds like I would need to build a resolved
 lib structure like

 lib/common - dependencies used by all modules
 lib/mod1 - dependencies specific to module 1
 lib/mod2 - dependencies specific to module 2
 etc

 and then define

 fileset id=common dir=lib/common
   include name=*/
 /fileset

 Sounds like we need an enhancement giving access to the set of dependencies
 inside a single ivy-module as a list or path, instead of the entire
 resolve/ set.


Re: Beginner question - Ivy depencency set -- ANT fileset/classpath?

2009-06-01 Thread Geoff Clitheroe
Here's how we do it (below) to use with netbeans generated build
files.  The resolve does use per conf directories e.g., lib/compile
lib/test and I think it helps to try to use configurations as early as
possible.
After running 'ant ivy-resolve' we run 'ant
ivy-generate-nbproject-classpaths' and we're good to go from the IDE
or command line.  We did it this way because we need to support
several different IDE's and command line building and testing.  If
your only using Eclipse then the IvyDE is well worth a look.

If this looks useful (and/or your using netbeans) we add all the
targets we need by including a build-base.xml file (from a web
server).  I can post this if you're interested.

Cheers,
Geoff

!--
Takes an ivy configuration attribute and computes it's relative
classpath (of jars), setting a property ivy.{conf}.computed.classpath
and ivy.{conf}.path.separator if any jars were found.
--

macrodef name=ivy-compute-classpath
attribute name=ivy.conf/

sequential

pathconvert property=i...@{ivy.conf}.computed.classpath setonempty=false

path
fileset dir=${ivy.lib.dir}/@{ivy.conf} includes=*.jar
erroronmissingdir=false/
/path
map from=${basedir}${file.separator} to=/
/pathconvert

condition property=i...@{ivy.conf}.path.separator value=: else=
isset property=i...@{ivy.conf}.computed.classpath/
/condition

condition property=i...@{ivy.conf}.computed.classpath value=

not
isset property=i...@{ivy.conf}.computed.classpath/
/not
/condition
/sequential
/macrodef
/target

target name=ivy-generate-nbproject-classpaths
depends=-init-macrodef-ivy-compute-classpath description=add
dependent jars resolved with ivy to nbproject/project.properties

!--
 Compute classpaths for each of our ivy configurations
--
ivy-compute-classpath ivy.conf=compile/
ivy-compute-classpath ivy.conf=foride/
ivy-compute-classpath ivy.conf=javadoc/
ivy-compute-classpath ivy.conf=test/
ivy-compute-classpath ivy.conf=optional/
ivy-compute-classpath ivy.conf=runtime/

propertyfile file=nbproject/project.properties

!--
 Default netbeans javac.classpath is (nothing!) just ivy's compile
configuration
--
entry operation== type=string key=javac.classpath
value=${ivy.compile.computed.classpath}/

!--
 Plus some sources and/javadocs (if specified) for added power in the IDE
--
entry operation=+ type=string key=javac.classpath
value=${ivy.foride.path.separator}${ivy.foride.computed.classpath}/
entry operation=+ type=string key=javac.classpath
value=${ivy.javadoc.path.separator}${ivy.javadoc.computed.classpath}/

!--
 Default netbeans run.classpath is ${build.classes.dir}
--
entry operation== type=string key=run.classpath
value=$${build.classes.dir}/

!--
 Plus some runtime (includes compile) and optional dependencies
--
entry operation=+ type=string key=run.classpath
value=${ivy.runtime.path.separator}${ivy.runtime.computed.classpath}/
entry operation=+ type=string key=run.classpath
value=${ivy.optional.path.separator}${ivy.optional.computed.classpath}/

!--
 Default netbeans javac.test.classpath is ${build.classes.dir}
--
entry operation== type=string key=javac.test.classpath
value=$${build.classes.dir}/

!--
 Plus test (including runtime) dependencies (this will almost always
include junit and clover etc.)
--
entry operation=+ type=string key=javac.test.classpath
value=${ivy.test.path.separator}${ivy.test.computed.classpath}/

!--
 Default netbeans run.test.classpath is
${build.classes.dir}:${build.test.classes.dir}
--
entry operation== key=run.test.classpath
value=$${build.classes.dir}:$${build.test.classes.dir}/

!--
 Plus test (including runtime) and optional dependencies.
--
entry operation=+ type=string key=run.test.classpath
value=${ivy.test.path.separator}${ivy.test.computed.classpath}/
entry operation=+ type=string key=run.test.classpath
value=${ivy.optional.path.separator}${ivy.optional.computed.classpath}/
/propertyfile
/target


--

On Tue, Jun 2, 2009 at 5:54 AM, Joshua Tharp
joshua-th...@alumni.calpoly.edu wrote:
 Alternatively, you can have your configurations extend one another and then
 just use a single directory. For example, you could have the configurations:
 conf name=common /
 conf name=mod1 extends=common /
 conf name=mod2 extends=common /

 Then in your dependencies, simply say which configuration they belong to
 (common, mod1, mod2, etc.) and on your build you can still use:
 fileset id=mod1.classpath dir=${lib.d}/mod1 includes=*.jar /

 Josh

 On Mon, Jun 1, 2009 at 10:46 AM, Jim Garrison jim.garri...@troux.comwrote:



  -Original Message-
  From: joshua.th...@gmail.com [mailto:joshua.th...@gmail.com]
  On Behalf Of Joshua Tharp
  Sent: Monday, June 01, 2009 12:20 PM
  To: ivy-user@ant.apache.org
  Subject: Re: Beginner question - Ivy depencency set -- ANT
  fileset/classpath?
 
  The way I do it (and I'm not claiming to be either an expert
  or using the most elegant means) is I create different
  configurations for the different classpaths I need in a build
  (compile, test, deploy) and have a ivy pattern