Added: ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef.html URL: http://svn.apache.org/viewvc/ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef.html?rev=961685&view=auto ============================================================================== --- ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef.html (added) +++ ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef.html Thu Jul 8 10:00:21 2010 @@ -0,0 +1,184 @@ + + + + + + + +macrodef | Apache Ivy + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + +
+ + +
+ + +
+ + + + + + + +
+
+ +

macrodef

+
Tag: macrodef

Defines a new dependency resolver type based upon an other one. This definition is very similar to the macrodef feature of ant for defining macro tasks. since 1.3 + +This task eases the lot the process of creating new dependency resolver, because it avoid writing java code.

It is generally used in combination with the include feature to help reusing macro at several places.

A macro is defined by writing the resolver it is equivalent to as if it were written in the resolver place, except that you can use attributes to pass parameters to the newly defined resolver type. Attributes are defined with a name and sometimes a default value, and are used using the following syntax: +
@{attributename}
+

Resolvers names

+Since you can use the same macro several times, and that your macro may define several resolvers (in a chain for instance), resolvers names need to be chosen carefully to avoid name conflicts (a resolver must have a unique name).

Therefore here is how Ivy deals with the names of the resolvers defined in a macro: +
    +
  • if there is no name attribute on a resolver in the macrodef, then Ivy will use the name given when using the macro. This is what usually should be done for the main resolver defined in the macro
  • +
  • if there is a name attribute on a resolver in the macrodef, but this name doesn't contain a @{name} inside, then Ivy will use the provided name prefixed with the name of the macro separated by a dash
  • +
  • if there is a name attribute on a resolver in the macrodef, and this name contains @{name} somewhere, then Ivy will use this name, and replace @{name} with the name provided when using the macro.
  • +
+ +Example: +
+<ivysettings>
<macrodef name="mymacro">
<chain>
<ibiblio name="ex1" />
<ibiblio name="ex2.@{name}" m2compatible="true" />
</chain>
</macrodef>

<resolvers>
<mymacro name="default" />
<mymacro name="other" />
</resolvers>
</ivysettings> +
+This is equivalent to: +
+<ivysettings>
<resolvers>
<chain name="default">
<ibiblio name="default-ex1" />
<ibiblio name="ex2.default" m2compatible="true" />
</chain>
<chain name="other">
<ibiblio name="other-ex1" />
<ibiblio name="ex2.other" m2compatible="true" />
</chain>
</resolvers>
</ivysettings> +
+ +

Attributes

+ + + + + + + + +
AttributeDescriptionRequired
namename of the resover type createdYes
+

Child elements

+ + + + + + + + + + +
ElementDescriptionCardinality
attributedefines an attribute for the macro resolver0..n
any resolverdefines the base resolver upon which this macro is defined1
+

Examples

+Defining a simple macro: +
+  <macrodef name="mymacro">
<attribute name="mymainrep"/>
<filesystem name="fs1">
<ivy pattern="@{mymainrep}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
<artifact pattern="@{mymainrep}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
</macrodef> +
+Using it: +
+  <resolvers>
<mymacro name="default" mymainrep="path/to/myrep"/>
</resolvers> +
+
+A complete example: +
+<ivysettings>
<macrodef name="mymacro">
<attribute name="mymainrep"/>
<attribute name="mysecondrep"/>
<attribute name="myseconddirlayout" default="[organisation]/[module]/[type]s"/>
<chain>
<filesystem name="fs1">
<ivy pattern="@{mymainrep}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
<artifact pattern="@{mymainrep}/[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"/>
</filesystem>
<filesystem name="fs2" latest="latest-time">
<ivy pattern="@{mysecondrep}/@{myseconddirlayout}/ivy-[revision].xml"/>
<artifact pattern="@{mysecondrep}/@{myseconddirlayout}/[artifact ]-[revision].[ext]"/>
</filesystem>
</chain>
</macrodef>

<resolvers>
<mymacro name="default" mymainrep="path/to/myrep" mysecondrep="path/to/secondrep"/>
<mymacro name="other"
mymainrep="path/to/myrep"
mysecondrep="path/to/secondrep"
myseconddirlayout="[module]/[type]s"/>
</resolvers>
</ivysettings> +
+ + +
+
+ + + + + + + + + + + + +
+ + Propchange: ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef.html ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef/attribute.html URL: http://svn.apache.org/viewvc/ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef/attribute.html?rev=961685&view=auto ============================================================================== --- ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef/attribute.html (added) +++ ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef/attribute.html Thu Jul 8 10:00:21 2010 @@ -0,0 +1,140 @@ + + + + + + + +attribute | Apache Ivy + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + +
+ + +
+ + +
+ + + + + + + +
+
+ +

attribute

+
Tag: attribute

Defines a macrodef attribute. See macrodef for details.

Attributes

+ + + + + + + + + + +
AttributeDescriptionRequired
namethe name of the attributeYes
defaultthe default value of the attribute if none is specifiedNo, by default attribute are required
+ + + +
+
+ + + + + + + + + + + + +
+ + Propchange: ant/ivy/site/target/history/2.2.0-rc1/settings/macrodef/attribute.html ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/site/target/history/2.2.0-rc1/settings/module.html URL: http://svn.apache.org/viewvc/ant/ivy/site/target/history/2.2.0-rc1/settings/module.html?rev=961685&view=auto ============================================================================== --- ant/ivy/site/target/history/2.2.0-rc1/settings/module.html (added) +++ ant/ivy/site/target/history/2.2.0-rc1/settings/module.html Thu Jul 8 10:00:21 2010 @@ -0,0 +1,180 @@ + + + + + + + +module | Apache Ivy + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + +
+ + +
+ + +
+ + + + + + + +
+
+ +

module

+
Tag: module

Define a module set rule. The tag defines a module set, by giving an expression and the matcher to use for organisation, name, revision and any extra attribute identifying your modules. The rule matching is performed in order, and is using a pattern matcher. Hence you can use * to specify all, or simply avoid specifying the attribute.

The revision and extra attributes are only used for rules defining the resolver to use. For other settings, use only organisation and module name.

It also gives the specific setting to use for this module set.

For each module set, you can configure: + + +

Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
organisationthe organisation to match to apply the rule.No, defaults to *
namethe module's name to match to apply the rule.No, defaults to *
revisionthe module's revision to match to apply the rule. Note that the version may not be resolved yet (be latest.integration for instance), so be very careful when using this attribute. since 2.0No, defaults to *
any extra attributean extra attribute to match to apply the rule. since 2.0No, defaults to *
matcherthe matcher to use to match the modules to which the resolver should be applied since 1.3No, defaults to exactOrRegexp
resolverthe name of the resolver to apply. The resolver must have been defined in the resolvers section of the configuration file.No
conflict-managerthe name of the conflict manager to apply. since 1.4No
branchthe default branch to apply. since 1.4No
resolveModethe resolve mode to use. since 2.0No
+

Examples

+
+<modules>
<module organisation="apache" name="*" resolver="myprojectsresolver"/>
</modules> +
+Uses myprojectresolver for all modules from Apache.

+
+<modules>
<module organisation="apache" name="commons-*" matcher="glob" resolver="myapachecommonsresolver"/>
</modules> +
+Uses myapachecommonsresolver for all modules beginning by commons- from apache.

+
+<modules>
<module organisation="apache" name="commons-[a-z]+" myextra="val.*" matcher="regexp" resolver="myapachecommonsresolver"/>
</modules> +
+Uses myapachecommonsresolver for all modules from 'apache' beginning by 'commons-' followed by any number of alphabetic lowercase characters, and with the extra attribute 'myextra' having a value starting with 'val'.

+
+<modules>
<module organisation="apache" name="ivy*" matcher="glob" conflict-manager="latest-time"/>
</modules> +
+Uses latest-time conflict manager for all modules from apache which name begins with ivy.

+
+<modules>
<module organisation="apache" name="ivy*" matcher="glob" branch="fix-103"/>
</modules> +
+Uses 'fix-103' as default branch for all modules from apache which name begins with ivy.



+
+
+ + + + + + + + + + + + +
+ + Propchange: ant/ivy/site/target/history/2.2.0-rc1/settings/module.html ------------------------------------------------------------------------------ svn:mime-type = text/plain Added: ant/ivy/site/target/history/2.2.0-rc1/settings/modules.html URL: http://svn.apache.org/viewvc/ant/ivy/site/target/history/2.2.0-rc1/settings/modules.html?rev=961685&view=auto ============================================================================== --- ant/ivy/site/target/history/2.2.0-rc1/settings/modules.html (added) +++ ant/ivy/site/target/history/2.2.0-rc1/settings/modules.html Thu Jul 8 10:00:21 2010 @@ -0,0 +1,139 @@ + + + + + + + +modules | Apache Ivy + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ +
+ +
+ + + + +
+ + +
+ + +
+ + + + + + + +
+
+ +

modules

+
Tag: modules

Defines per module or module set settings. + +The rules are given by defining a module set, using pattern for module organisation and name, and giving some settings for the set, like the name of the corresponding resolver to use.

If no rule match a given module, the default setting will be used.

Even if not required, because the use of a default big resolver (chain, for instance) able to resolve all dependencies can answer all the needs, the configuration of smaller resolvers used for different cases can improve performances a lot. For instance, if you have a local repository for your modules and a distant repository for third party libraries, it is a good idea to have two separate resolvers, and configure ivy to use one for all your modules and another for the rest (the default one).

Child elements

+ + + + + + + + +
ElementDescriptionCardinality
moduledefines a module set rule1..n
+ + +
+
+ + + + + + + + + + + + +
+ + Propchange: ant/ivy/site/target/history/2.2.0-rc1/settings/modules.html ------------------------------------------------------------------------------ svn:mime-type = text/plain