What is the manifest format of the Android repo tool?
Asked Answered
G

2

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://[email protected]"/>
  <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>
Gravestone answered 4/9, 2013 at 8:45 Comment(0)
G
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)
Gravestone answered 4/9, 2013 at 8:50 Comment(1)
Note: the manifest-format.txt link in the above answer has since been renamed to this: gerrit.googlesource.com/git-repo/+/master/docs/…Glycosuria
R
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).

Rhizopod answered 14/2, 2014 at 14:46 Comment(2)
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"?Maryjanemaryjo
Way late to answer winwin's question, but just in case anyone else ends up here, here's where the actual copy takes place: gerrit.googlesource.com/git-repo/+/master/project.py#232 (which calls shutil.copy(src, dest), see also: docs.python.org/3/library/shutil.html#shutil.copy) TL;DR - copyfile copies a file, not a directory; delegates to shutil.copyRomansh

© 2022 - 2024 — McMap. All rights reserved.