| Index: recipes.py
|
| diff --git a/recipes.py b/recipes.py
|
| index 5f6a2091752e774da566aa7db97a8df0e558ab6b..c8a6d1ebdb5980173689f28a8111c0fe0de83953 100755
|
| --- a/recipes.py
|
| +++ b/recipes.py
|
| @@ -218,6 +218,34 @@ def info(args):
|
| print package_spec.recipes_path
|
|
|
|
|
| +def isolate(package_deps, args):
|
| + from recipe_engine import package
|
| +
|
| + repo_root, config_file = get_package_config(args)
|
| + context = package.PackageContext.from_proto_file(repo_root, config_file)
|
| + base_path = package_deps.root_package.recipes_dir
|
| + def norm(p):
|
| + return os.path.relpath(p, base_path)
|
| + recipes_tool = norm(os.path.join(
|
| + package_deps.get_package('recipe_engine').recipes_dir,
|
| + 'recipes.py'))
|
| +
|
| + overrides = [ '-O %s=%s' % (k, norm(v))
|
| + for k,v in args.project_override.iteritems() ]
|
| +
|
| + print json.dumps({
|
| + 'variables': {
|
| + 'files': [norm(f) for f in package_deps.root_package.all_files(context)],
|
| + 'command': [
|
| + 'python',
|
| + recipes_tool,
|
| + '--package', norm(
|
| + package_deps.root_package.repo_spec.proto_file(context).path),
|
| + '--no-fetch',
|
| + ] + overrides,
|
| + },
|
| + }, indent=2, separators=(',', ': '))
|
| +
|
| def main():
|
| from recipe_engine import package
|
|
|
| @@ -244,6 +272,7 @@ def main():
|
| help='Path to the script used to bootstrap this tool (internal use only)')
|
| parser.add_argument('-O', '--project-override', metavar='ID=PATH',
|
| action=ProjectOverrideAction,
|
| + default={},
|
| help='Override a project repository path with a local one.')
|
|
|
| subp = parser.add_subparsers()
|
| @@ -315,6 +344,12 @@ def main():
|
| '--recipes-dir', action='store_true',
|
| help='Get the subpath where the recipes live relative to repository root')
|
|
|
| + isolate_p = subp.add_parser(
|
| + 'isolate',
|
| + help='Write an isolate file to stdout for the recipe toolchain of the '
|
| + 'current project')
|
| + isolate_p.set_defaults(command='isolate')
|
| +
|
| args = parser.parse_args()
|
|
|
| if args.verbose:
|
| @@ -343,6 +378,8 @@ def main():
|
| return doc(package_deps, args)
|
| elif args.command == 'info':
|
| return info(args)
|
| + elif args.command == 'isolate':
|
| + return isolate(package_deps, args)
|
| else:
|
| print """Dear sir or madam,
|
| It has come to my attention that a quite impossible condition has come
|
|
|