5

I've used the repo command line for a new project based on many Git repositories. What is the manifest format? I haven't found any specification/manual/documentation about it.

For example this is a simplified default.xml

<manifest>
  <remote  name="aosp" fetch="https://android.googlesource.com" review="android-review.googlesource.com"/>
  <remote  name="github" fetch=".." review="review.cyanogenmod.org"/>
  <remote  name="private" fetch="ssh://git@github.com"/>
  <default revision="refs/tags/1.3-1" remote="github" sync-c="true" sync-j="4"/>
  <project path="build" name="CyanogenMod/android_build">
    <copyfile src="core/root.mk" dest="Makefile"/>
  </project>
  <project path="android" name="CyanogenMod/android"/>
  <project path="abi/cpp" name="CyanogenMod/android_abi_cpp"/>
</manifest>
Mogsdad
  • 44,709
  • 21
  • 151
  • 275
oHo
  • 51,447
  • 27
  • 165
  • 200

2 Answers2

7

I finally found some documentations, I post them here to be useful for others ;)

  1. Enter the command repo help manifest (from Edward Falk's comment)
  2. Edit the file .repo/repo/docs/manifest-format.txt (from Bjarke Freund-Hansen's answer)
  3. Go to https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.txt (from David Fraser's comment)
Community
  • 1
  • 1
oHo
  • 51,447
  • 27
  • 165
  • 200
  • Note: the manifest-format.txt link in the above answer has since been renamed to this: https://gerrit.googlesource.com/git-repo/+/master/docs/manifest-format.md – David Baird Apr 06 '20 at 12:16
1

I found this question looking for copyfile tag and after searching into the source code I discovered this in repo/manifest_xml.py

def _ParseCopyFile(self, project, node):
  src = self._reqatt(node, 'src')
  dest = self._reqatt(node, 'dest')
  if not self.IsMirror:
    # src is project relative;
    # dest is relative to the top of the tree
    project.AddCopyFile(src, dest, os.path.join(self.topdir, dest))

so <copyfile> copies a file from the given project into the file as described in the dest attribute (but relative to the top of the tree).

gipi
  • 2,432
  • 22
  • 25
  • Does it copy a directory? i.e if src=gradle (that gradle dir has gradle/wrapper/gradle-wrapper.properties and .jar), dest=gradle, would the whole gradle dir and contents be copied over recursively like "cp -r"? – simonso Dec 04 '14 at 07:43
  • 1
    Way late to answer winwin's question, but just in case anyone else ends up here, here's where the actual copy takes place: https://gerrit.googlesource.com/git-repo/+/master/project.py#232 (which calls `shutil.copy(src, dest)`, see also: https://docs.python.org/3/library/shutil.html#shutil.copy) **TL;DR - copyfile copies a file, not a directory; delegates to shutil.copy** – dherman Aug 06 '16 at 05:14