File: cache.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 (92 lines) | stat: -rw-r--r-- 5,605 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
<!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>
	<script type="text/javascript">var xookiConfig = {level: 2};</script>	
	<script type="text/javascript" src="../../xooki/xooki.js"></script>
</head>
<body>
	<textarea id="xooki-source">
<b>Tag:</b> cache

<span class="since">Since 2.0</span>.

<span class="tagdoc" id="ivysettings.caches.cache">Defines a repository cache instance based on the default repository cache implementation.</span>

The default repository cache implementation caches files on the local filesystem in subdirectories of a configured base directory.

By default also, the parsed module descriptor read from the cache are kept in a memory cache in case they are reused.  This may enhance the performance of multi-module build, provided that all modules are build using the same ivy instance.  The size of this memory cache is configurable in term of number of module descriptors.  A size of 0 means no memory caching.

<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>name</td><td>name of the cache instance</td>
        <td>Yes</td></tr>
    <tr><td>basedir</td><td>the path of the base directory to use to put repository cache data. <strong>This should not point to a directory used as a repository!</strong></td>
        <td>No, defaults to repositoryCacheDir defined in [[settings/caches]]</td></tr>
    <tr><td>ivyPattern</td><td>the pattern to use to store cached ivy files</td>
        <td>No, defaults to default cache ivy pattern as configured in [[settings/caches]]</td></tr>
    <tr><td>artifactPattern</td><td>the pattern to use to store cached artifacts</td>
        <td>No, defaults to default cache artifact pattern as configured in [[settings/caches]]</td></tr>
    <tr><td>useOrigin</td><td>true to avoid the copy of local artifacts to the cache and use directly their original location, false otherwise. 
To know if an artifact is local ivy asks to the resolver. Only filesystem resolver is considered local by default, but this can be disabled if you want to force the copy on one filesystem resolver and use the original location on another. Note that it is safe to use useOrigin even if you use the cache for some non local resolvers. In this case the cache will behave as usual, copying files to the cache. Note also that this only applies to artifacts, not to ivy files, which are still copied in the cache.</td>
        <td>No. defaults to the default value configured in [[settings/caches]]</td></tr>
    <tr><td>lockStrategy</td><td>the name of the [[settings/lock-strategies lock strategy]] to use for this cache</td>
        <td>No, defaults to default lock strategy as configured in [[settings/caches]]</td></tr>
    <tr><td>defaultTTL</td><td>the default [[settings/caches/ttl TTL]] to use when no specific one is defined</td>
        <td>No, defaults to ${ivy.cache.ttl.default}</td></tr>
    <tr><td>memorySize</td><td>the number of parsed module descriptors to keep in a memory cache.</td><td>No, default to 150</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>[[settings/caches/ttl]]</td><td>defines a TTL rule</td>
        <td>0..n</td></tr>
</tbody>
</table>

<h1>Examples</h1>
<code>
<cache name="mycache" 
       basedir="/path/to/mycache"
       ivyPattern="[module]/ivy-[revision].xml" 
       artifactPattern="[module]/[artifact]-[revision].[ext]"
       lockStrategy="no-lock"
       defaultTTL="1s">
    <ttl revision="latest.integration" duration="200ms" />
    <ttl organisation="org1" duration="10m 20s" />
    <ttl organisation="org2" duration="5h" />
    <ttl organisation="org3" duration="2d 12h" />
</cache>
</code>
Defines a cache called 'mycache', storing files in the '/path/to/mycache' directory using '[module]/ivy-[revision].xml' as pattern to store Ivy files and '[module]/[artifact]-[revision].[ext]' as pattern to store other artifacts.
The lock strategy used by this cache is the 'no-lock' strategy, which does not perform any locking. 
The defaultTTL used is of 1s, meaning that by default dynamic revision result will be stored and used for one second. TTL rules then define that all 'latest.integration' revisions will be stored and used for 200ms, while other dynamic revisions from org1 org2 and org3 modules will be stored respectively for 10 minutes 20 seconds; 5 hours; and 2 days and 12 hours.</textarea>
<script type="text/javascript">xooki.postProcess();</script>
</body>
</html>