From a0a494b4f8d188bbc39dec170d2ba40f7fcc9e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= Date: Fri, 5 Feb 2021 15:56:24 +0000 Subject: [PATCH] Add stubs for clean/test/install. --- ognibuild/__init__.py | 16 ++++++++++++++++ ognibuild/__main__.py | 17 +++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/ognibuild/__init__.py b/ognibuild/__init__.py index a9dfcac..b4f0492 100644 --- a/ognibuild/__init__.py +++ b/ognibuild/__init__.py @@ -87,6 +87,22 @@ def run_with_build_fixer(session, args): session.check_call(args) +def run_build(session): + raise NotImplementedError + + +def run_clean(session): + raise NotImplementedError + + +def run_test(session): + raise NotImplementedError + + +def run_install(session): + raise NotImplementedError + + def run_dist(session): # TODO(jelmer): Check $PATH rather than hardcoding? if not os.path.exists('/usr/bin/git'): diff --git a/ognibuild/__main__.py b/ognibuild/__main__.py index d2b5f3a..2571abc 100644 --- a/ognibuild/__main__.py +++ b/ognibuild/__main__.py @@ -17,13 +17,18 @@ import os import sys -from . import run_dist, NoBuildToolsFound, note +from . import ( + run_dist, run_build, run_clean, run_install, run_test, NoBuildToolsFound, + note + ) def main(): import argparse parser = argparse.ArgumentParser() - parser.add_argument('subcommand', type=str, choices=['dist']) + parser.add_argument( + 'subcommand', type=str, + choices=['dist', 'build', 'clean', 'test', 'install']) parser.add_argument( '--directory', '-d', type=str, help='Directory for project.', default='.') @@ -41,6 +46,14 @@ def main(): try: if args.subcommand == 'dist': run_dist(session) + if args.subcommand == 'build': + run_build(session) + if args.subcommand == 'clean': + run_clean(session) + if args.subcommand == 'install': + run_install(session) + if args.subcommand == 'test': + run_test(session) except NoBuildToolsFound: note('No build tools found.') return 1