help="Path to main android project subdirectory, if not in root.")
parser.add_option("-r", "--repo", default=None,
help="Allows a different repo to be specified for a multi-repo google code project")
+ parser.add_option("--rev", default=None,
+ help="Allows a different revision (or git branch) to be specified for the initial import")
(options, args) = parser.parse_args()
if not options.url:
if os.path.exists(src_dir):
shutil.rmtree(src_dir)
vcs = common.getvcs(repotype, repo, src_dir, sdk_path)
- vcs.gotorevision(None)
+ vcs.gotorevision(options.rev)
if options.subdir:
root_dir = os.path.join(src_dir, options.subdir)
else:
print "Couldn't find package ID"
sys.exit(1)
if not version:
- print "Couldn't find latest version name"
- sys.exit(1)
+ print "WARNING: Couldn't find latest version name"
if not vercode:
- print "Couldn't find latest version code"
- sys.exit(1)
+ print "WARNING: Couldn't find latest version code"
# Make sure it's actually new...
for app in apps:
# Create a build line...
build = {}
- build['version'] = version
- build['vercode'] = vercode
+ build['version'] = version if version else '?'
+ build['vercode'] = vercode if vercode else '?'
build['commit'] = '?'
+ build['disable'] = 'Generated by import.py - check/set version fields and commit id'
if options.subdir:
build['subdir'] = options.subdir
if os.path.exists(os.path.join(root_dir, 'jni')):
build['buildjni'] = 'yes'
app['builds'].append(build)
- app['comments'].append(('build:' + version,
- "#Generated by import.py - check this is the right version, and find the right commit!"))
# Keep the repo directory to save bandwidth...
if not os.path.exists('build'):