File: configurations.html

package info (click to toggle)
sbt-ivy 2.4.0~rc1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 27,784 kB
  • sloc: xml: 217,953; java: 72,172; makefile: 21
file content (114 lines) | stat: -rw-r--r-- 7,043 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.    
-->
<html>
<head>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
	<script type="text/javascript">var xookiConfig = {level: 1};</script>	
	<script type="text/javascript" src="../xooki/xooki.js"></script>
</head>
<body>
	<textarea id="xooki-source">
<b>Tag:</b> configurations <b>Parent:</b> <a href="../ivyfile.html">ivy-module</a>

A container for configuration elements. If this container is not present, it is assumed that the module has one public configuration called 'default'.

<span class="since">since 2.2</span> You can define the default conf on this container by specifying the defaultconf attribute.  This attribute defines the conf mapping to use when no conf mapping is specified for a dependency in this ivy file.

<span class="since">since 1.3</span> You can define a default conf mapping on this container by specifying the defaultconfmapping attribute.

This attribute modifies the way ivy interprets conf mapping with no mapped conf. In this case, Ivy will look in the default conf mapping and use the conf mapping defined in the default conf mapping for the conf for which there is no mapped conf.

In order to maintain backwards compatibility with Ivy 2.1.0 and earlier, the defaultconfmapping also provides one additional function.  If no defaultconf is specified (on either the configurations tag or the dependencies tag), the defaultconfmapping becomes the default configuration for dependencies in this ivy file when no configuration is specified.  In other words, in addition to altering the interpretation of individual configurations with no mapping, defaultconfmapping also performs exactly like defaultconf in the absence of a definition for defaultconf.

If several defaultconfmapping or defaultconf attributes are defined (in the configurations tag, one or several in an included configurations file, and/or in the dependency tag, then it's only the last definition of each property which is taken into account.  The others will have no effect at all.

See <a href="#defaultconfmapping">examples below</a> to clarify the behavior of these two attributes together.

<span class="since">since 1.4</span> You can activate a confmappingoverride mode for all configurations, in which case the extending configurations will override the mappings of the configurations they extend from.


<h1>Attributes</h1>
<table class="ivy-attributes">
<thead>
    <tr><th class="ivy-att">Attribute</th><th class="ivy-att-desc">Description</th><th class="ivy-att-req">Required</th></tr>
</thead>
<tbody>
    <tr><td>defaultconf</td><td>the default conf to use in this ivy file <span class="since">since 2.2</span></td><td>No, defaults to no default conf</td></tr>
    <tr><td>defaultconfmapping</td><td>the default conf mapping to use in this ivy file <span class="since">since 1.3</span></td>
        <td>No, defaults to no default conf mapping</td></tr>
    <tr><td>confmappingoverride</td><td>true to activate configuration mapping override, false otherwise <span class="since">since 1.4</span></td>
        <td>No, defaults to false</td></tr>
</tbody>
</table>
<h1>Child elements</h1>
<table class="ivy-children">
<thead>
    <tr><th class="ivy-chld">Element</th><th class="ivy-chld-desc">Description</th><th class="ivy-chld-card">Cardinality</th></tr>
</thead>
<tbody>
    <tr><td><a href="../ivyfile/conf.html">conf</a></td><td>declares a configuration of this module</td>
        <td>0..n</td></tr>
    <tr><td><a href="../ivyfile/include.html">include</a></td><td>include configurations from another file</td>
        <td>0..n</td></tr>
</tbody>
</table>

<h1>Configuration mappings details</h1>
When Ivy parses your Ivy file, it will create (internally) modify the configuration mapping of your dependencies.
For instance, say you have:
<code type="xml">
<configurations defaultconfmapping="conf1->other1;conf2->other2">
   <conf name="conf1" />
   <conf name="conf2" extends="conf1" />
</configurations>
<dependencies>
   <dependency name="other-module" conf="conf1" />
</dependencies>
</code>
When Ivy parses this file, it will construct the following dependency (in-memory only):
<code type="xml"><dependency name="other-module" conf="conf1->other1" /></code>

So, if you now resolve the conf2 configuration, you will only get the other1 dependencies of your other-module.

But when you set confmappingoverride to true, Ivy will construct the following dependency in memory:
<code type="xml"><dependency name="other-module" conf="conf1->other1;conf2->other2" /></code>
As you can see, the defaultmappings of the extending configurations are also added (although you didn't explicitly defined them)

When you now resolve the conf2 configuration, you'll get the other2 dependencies of your other-module. 

<h1>Examples involving defaultconf and defaultconfmapping</h1>
The table below indicates how Ivy interprets the conf attribute according to how [[ivyfile/configurations defaultconfmapping]] and [[ivyfile/configurations defaultconf]] are set:<table class="ivy-attributes"><thead><tr><th>defaultconf</th><th>defaultconfmapping</th><th>conf</th><th>ivy interpretation</th></tr>
</thead>
<tbody>
<tr><td></td><td></td><td></td><td><code>*->*</code></td></tr>
<tr><td></td><td></td><td>runtime</td><td><code>runtime->runtime</code></td></tr>
<tr><td></td><td></td><td>test</td><td><code>test->test</code></td></tr>
<tr><td><code>runtime</code></td><td></td><td></td><td><code>runtime->runtime</code></td></tr>
<tr><td><code>runtime</code></td><td><code>runtime->*;test->default</code></td><td></td><td>runtime->*</td></tr>
<tr><td><code>runtime</code></td><td><code>runtime->*;test->default</code></td><td>test</td><td>test->default</td></tr>
<tr><td></td><td><code>runtime->*;test->default</code></td><td></td><td><code>runtime->*;test->default</code></td></tr>
<tr><td></td><td><code>runtime->*;test->default</code></td><td>runtime</td><td><code>runtime->*</code></td></tr>
<tr><td></td><td><code>runtime->*;test->default</code></td><td>test</td><td><code>test->default</code></td></tr>
</tbody>
</table>
</textarea>
<script type="text/javascript">xooki.postProcess();</script>
</body>
</html>