1 /* --COPYRIGHT--,EPL
2 * Copyright (c) 2008 Texas Instruments and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * Texas Instruments - initial implementation
10 *
11 * --/COPYRIGHT--*/
12 /*
13 * ======== Repository.xdc ========
14 */
15 package xdc.bld;
16
17 /*!
18 * ======== Repository ========
19 * Model of a package repository
20 */
21 metaonlymodule Repository {
22
23 /*!
24 * ======== Attrs ========
25 * Optional attributes for a repository
26 *
27 * @field(releases) This array contains releases that will contain the
28 * repository. Thus, a single repository can be part of any set
29 * of releases. Each repository is always added to the
30 * package's "default release" in addition to any releases
31 * specified in the releases array.
32 *
33 * @see #attrs
34 */
35 struct Attrs {
36 Release.Instance releases[]; /*! releases that this rep is a part of */
37 };
38
39 instance:
40 /*!
41 * ======== create ========
42 * @_nodoc 43 * Instances should only be created via PackageContents.addRepository()
44 */
45 create();
46
47 /*!
48 * ======== name ========
49 * The repository's directory name
50 */
51 config String name;
52
53 /*!
54 * ======== attrs ========
55 * The repository's attributes
56 */
57 config Attrs attrs;
58
59 /*!
60 * ======== addPackages ========
61 * Add specified package releases to this repository
62 *
63 * @param(names) An array of strings naming package releases to be added
64 * to the repository. Package releases are named as follows:
65 * @p(code) 66 * <pkgName>:<releaseName>
67 * @p 68 * where `<pkgName>` is the name of the package to add to the
69 * repository and `<releaseName>` is the name of one of that
70 * package's releases. A package release name may be either the
71 * archive file name (relative to the package's base directory)
72 * of the release archive or the name used create the release in
73 * package named `<pkgName>`.
74 *
75 * For example, if the package `ti.bios` had a release named
76 * `exports/ti_bios,src`, the following statements would add
77 * this release to the repository named `packages`:
78 * @p(code) 79 * var r = Pkg.addRepository("packages");
80 * r.addPackages(["ti.bios:exports/ti_bios,src"]);
81 * @p 82 *
83 * Alternatively, one can specify the archive file name:
84 * @p(code) 85 * var r = Pkg.addRepository("packages");
86 * r.addPackages(["ti.bios:exports/ti_bios,src.tar"]);
87 * @p 88 *
89 * It is possible to get a list of release archive names from a
90 * package via the
91 * `{@link xdc.bld.BuildEnvironment#getReleaseDescs()}`
92 * method. For example, to get the physical archive name of the
93 * default release of the `ti.bios` package, the following loop
94 * can be added to a build script:
95 * @p(code) 96 * var archiveName;
97 * var rels = Build.getReleaseDescs('ti.bios');
98 * for (var j = 0; j < rels.length; j++) {
99 * if (rels[j].label == "default") {
100 * archiveName = rels[j].aname;
101 * break;
102 * }
103 * }
104 * // archiveName is now set to the file name of the ti.bios
105 * // default release archive (or undefined)
106 * @p 107 *
108 * @see xdc.bld.BuildEnvironment#getReleaseDescs()
109 */
110 Void addPackages(String names[]);
111 }
112 /*
113 * @(#) xdc.bld; 1, 0, 2,238; 2-22-2010 10:33:32; /db/ztree/library/trees/xdc/xdc-u17x/src/packages/
114 */
115