manifest-format.txt 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. repo Manifest Format
  2. ====================
  3. A repo manifest describes the structure of a repo client; that is
  4. the directories that are visible and where they should be obtained
  5. from with git.
  6. The basic structure of a manifest is a bare Git repository holding
  7. a single 'default.xml' XML file in the top level directory.
  8. Manifests are inherently version controlled, since they are kept
  9. within a Git repository. Updates to manifests are automatically
  10. obtained by clients during `repo sync`.
  11. XML File Format
  12. ---------------
  13. A manifest XML file (e.g. 'default.xml') roughly conforms to the
  14. following DTD:
  15. <!DOCTYPE manifest [
  16. <!ELEMENT manifest (notice?,
  17. remote*,
  18. default?,
  19. manifest-server?,
  20. remove-project*,
  21. project*,
  22. repo-hooks?)>
  23. <!ELEMENT notice (#PCDATA)>
  24. <!ELEMENT remote (EMPTY)>
  25. <!ATTLIST remote name ID #REQUIRED>
  26. <!ATTLIST remote fetch CDATA #REQUIRED>
  27. <!ATTLIST remote review CDATA #IMPLIED>
  28. <!ELEMENT default (EMPTY)>
  29. <!ATTLIST default remote IDREF #IMPLIED>
  30. <!ATTLIST default revision CDATA #IMPLIED>
  31. <!ATTLIST default sync-j CDATA #IMPLIED>
  32. <!ATTLIST default sync-c CDATA #IMPLIED>
  33. <!ELEMENT manifest-server (EMPTY)>
  34. <!ATTLIST url CDATA #REQUIRED>
  35. <!ELEMENT project (annotation?)>
  36. <!ATTLIST project name CDATA #REQUIRED>
  37. <!ATTLIST project path CDATA #IMPLIED>
  38. <!ATTLIST project remote IDREF #IMPLIED>
  39. <!ATTLIST project revision CDATA #IMPLIED>
  40. <!ATTLIST project groups CDATA #IMPLIED>
  41. <!ATTLIST project sync-c CDATA #IMPLIED>
  42. <!ELEMENT annotation (EMPTY)>
  43. <!ATTLIST annotation name CDATA #REQUIRED>
  44. <!ATTLIST annotation value CDATA #REQUIRED>
  45. <!ATTLIST annotation keep CDATA "true">
  46. <!ELEMENT remove-project (EMPTY)>
  47. <!ATTLIST remove-project name CDATA #REQUIRED>
  48. <!ELEMENT repo-hooks (EMPTY)>
  49. <!ATTLIST repo-hooks in-project CDATA #REQUIRED>
  50. <!ATTLIST repo-hooks enabled-list CDATA #REQUIRED>
  51. ]>
  52. A description of the elements and their attributes follows.
  53. Element manifest
  54. ----------------
  55. The root element of the file.
  56. Element remote
  57. --------------
  58. One or more remote elements may be specified. Each remote element
  59. specifies a Git URL shared by one or more projects and (optionally)
  60. the Gerrit review server those projects upload changes through.
  61. Attribute `name`: A short name unique to this manifest file. The
  62. name specified here is used as the remote name in each project's
  63. .git/config, and is therefore automatically available to commands
  64. like `git fetch`, `git remote`, `git pull` and `git push`.
  65. Attribute `fetch`: The Git URL prefix for all projects which use
  66. this remote. Each project's name is appended to this prefix to
  67. form the actual URL used to clone the project.
  68. Attribute `review`: Hostname of the Gerrit server where reviews
  69. are uploaded to by `repo upload`. This attribute is optional;
  70. if not specified then `repo upload` will not function.
  71. Element default
  72. ---------------
  73. At most one default element may be specified. Its remote and
  74. revision attributes are used when a project element does not
  75. specify its own remote or revision attribute.
  76. Attribute `remote`: Name of a previously defined remote element.
  77. Project elements lacking a remote attribute of their own will use
  78. this remote.
  79. Attribute `revision`: Name of a Git branch (e.g. `master` or
  80. `refs/heads/master`). Project elements lacking their own
  81. revision attribute will use this revision.
  82. Element manifest-server
  83. -----------------------
  84. At most one manifest-server may be specified. The url attribute
  85. is used to specify the URL of a manifest server, which is an
  86. XML RPC service that will return a manifest in which each project
  87. is pegged to a known good revision for the current branch and
  88. target.
  89. The manifest server should implement:
  90. GetApprovedManifest(branch, target)
  91. The target to use is defined by environment variables TARGET_PRODUCT
  92. and TARGET_BUILD_VARIANT. These variables are used to create a string
  93. of the form $TARGET_PRODUCT-$TARGET_BUILD_VARIANT, e.g. passion-userdebug.
  94. If one of those variables or both are not present, the program will call
  95. GetApprovedManifest without the target paramater and the manifest server
  96. should choose a reasonable default target.
  97. Element project
  98. ---------------
  99. One or more project elements may be specified. Each element
  100. describes a single Git repository to be cloned into the repo
  101. client workspace.
  102. Attribute `name`: A unique name for this project. The project's
  103. name is appended onto its remote's fetch URL to generate the actual
  104. URL to configure the Git remote with. The URL gets formed as:
  105. ${remote_fetch}/${project_name}.git
  106. where ${remote_fetch} is the remote's fetch attribute and
  107. ${project_name} is the project's name attribute. The suffix ".git"
  108. is always appended as repo assumes the upstream is a forrest of
  109. bare Git repositories.
  110. The project name must match the name Gerrit knows, if Gerrit is
  111. being used for code reviews.
  112. Attribute `path`: An optional path relative to the top directory
  113. of the repo client where the Git working directory for this project
  114. should be placed. If not supplied the project name is used.
  115. Attribute `remote`: Name of a previously defined remote element.
  116. If not supplied the remote given by the default element is used.
  117. Attribute `revision`: Name of the Git branch the manifest wants
  118. to track for this project. Names can be relative to refs/heads
  119. (e.g. just "master") or absolute (e.g. "refs/heads/master").
  120. Tags and/or explicit SHA-1s should work in theory, but have not
  121. been extensively tested. If not supplied the revision given by
  122. the default element is used.
  123. Attribute `groups`: List of groups to which this project belongs,
  124. whitespace or comma separated. All projects belong to the group
  125. "default".
  126. Element annotation
  127. ------------------
  128. Zero or more annotation elements may be specified as children of a
  129. project element. Each element describes a name-value pair that will be
  130. exported into each project's environment during a 'forall' command,
  131. prefixed with REPO__. In addition, there is an optional attribute
  132. "keep" which accepts the case insensitive values "true" (default) or
  133. "false". This attribute determines whether or not the annotation will
  134. be kept when exported with the manifest subcommand.
  135. Element remove-project
  136. ----------------------
  137. Deletes the named project from the internal manifest table, possibly
  138. allowing a subsequent project element in the same manifest file to
  139. replace the project with a different source.
  140. This element is mostly useful in the local_manifest.xml, where
  141. the user can remove a project, and possibly replace it with their
  142. own definition.
  143. Local Manifest
  144. ==============
  145. Additional remotes and projects may be added through a local
  146. manifest, stored in `$TOP_DIR/.repo/local_manifest.xml`.
  147. For example:
  148. $ cat .repo/local_manifest.xml
  149. <?xml version="1.0" encoding="UTF-8"?>
  150. <manifest>
  151. <project path="manifest"
  152. name="tools/manifest" />
  153. <project path="platform-manifest"
  154. name="platform/manifest" />
  155. </manifest>
  156. Users may add projects to the local manifest prior to a `repo sync`
  157. invocation, instructing repo to automatically download and manage
  158. these extra projects.