1 2 3 4 5 6 7 8 9 10 11
12 13 14
15 package xdc.bld;
16
17 /*!
18 * ======== Repository ========
19 * Model of a package repository
20 */
21 metaonly module 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 this repo is a part of */
37 Bool search; /*! true => search path for packages */
38 String archivePath; /*! search path for package archives */
39 };
40
41 instance:
42 /*!
43 * ======== create ========
44 * @_nodoc
45 * Instances should only be created via PackageContents.addRepository()
46 */
47 create();
48
49 /*!
50 * ======== name ========
51 * The repository's directory name
52 */
53 config String name;
54
55 /*!
56 * ======== attrs ========
57 * The repository's attributes
58 */
59 config Attrs attrs;
60
61 /*!
62 * ======== addPackages ========
63 * Add specified package releases to this repository
64 *
65 * @param(names) An array of strings naming package releases to be added
66 * to the repository. Package releases are named as follows:
67 * @p(code)
68 * <pkgName>:<releaseName>
69 * @p
70 * where `<pkgName>` is the name of the package to add to the
71 * repository and `<releaseName>` is the name of one of that
72 * package's releases. A package release name may be either the
73 * archive file name (relative to the package's base directory)
74 * of the release archive or the name used create the release in
75 * package named `<pkgName>`.
76 *
77 * For example, if the package `ti.bios` had a release named
78 * `exports/ti_bios,src`, the following statements would add
79 * this release to the repository named `packages`:
80 * @p(code)
81 * var r = Pkg.addRepository("packages");
82 * r.addPackages(["ti.bios:exports/ti_bios,src"]);
83 * @p
84 *
85 * Alternatively, one can specify the archive file name:
86 * @p(code)
87 * var r = Pkg.addRepository("packages");
88 * r.addPackages(["ti.bios:exports/ti_bios,src.tar"]);
89 * @p
90 *
91 * It is possible to get a list of release archive names from a
92 * package via the
93 * `{@link xdc.bld.BuildEnvironment#getReleaseDescs()}`
94 * method. For example, to get the physical archive name of the
95 * default release of the `ti.bios` package, the following loop
96 * can be added to a build script:
97 * @p(code)
98 * var archiveName;
99 * var rels = Build.getReleaseDescs('ti.bios');
100 * for (var j = 0; j < rels.length; j++) {
101 * if (rels[j].label == "default") {
102 * archiveName = rels[j].aname;
103 * break;
104 * }
105 * }
106 * // archiveName is now set to the file name of the ti.bios
107 * // default release archive (or undefined)
108 * @p
109 *
110 * @see xdc.bld.BuildEnvironment#getReleaseDescs()
111 */
112 Void addPackages(String names[]);
113 }
114 115 116
117