diff --git a/src/sinol_make/commands/gen/__init__.py b/src/sinol_make/commands/gen/__init__.py index 18719100..7dbd1850 100644 --- a/src/sinol_make/commands/gen/__init__.py +++ b/src/sinol_make/commands/gen/__init__.py @@ -5,6 +5,7 @@ from sinol_make.commands.outgen import Command as OutgenCommand from sinol_make.helpers import parsers from sinol_make.interfaces.BaseCommand import BaseCommand +from sinol_make.task_type import get_task_type class Command(BaseCommand): @@ -40,6 +41,7 @@ def configure_subparser(self, subparser): def run(self, args: argparse.Namespace): args = util.init_package_command(args) + task_type = get_task_type() self.args = args self.ins = args.only_inputs @@ -53,6 +55,6 @@ def run(self, args: argparse.Namespace): command = IngenCommand() command.run(args) - if self.outs: + if self.outs and task_type.run_outgen(): command = OutgenCommand() command.run(args) diff --git a/src/sinol_make/commands/outgen/__init__.py b/src/sinol_make/commands/outgen/__init__.py index 3a188484..b708b3e6 100644 --- a/src/sinol_make/commands/outgen/__init__.py +++ b/src/sinol_make/commands/outgen/__init__.py @@ -10,6 +10,7 @@ from sinol_make.structs.gen_structs import OutputGenerationArguments from sinol_make.helpers import parsers, package_util, cache, paths from sinol_make.interfaces.BaseCommand import BaseCommand +from sinol_make.task_type import get_task_type class Command(BaseCommand): @@ -106,6 +107,9 @@ def clean_cache(self, inputs): def run(self, args: argparse.Namespace): args = util.init_package_command(args) + task_type = get_task_type() + if not task_type.run_outgen(): + util.exit_with_error('This task type does not support output generation.') self.args = args self.task_id = package_util.get_task_id() diff --git a/src/sinol_make/task_type/base.py b/src/sinol_make/task_type/base.py index 0794a97f..e24399ea 100644 --- a/src/sinol_make/task_type/base.py +++ b/src/sinol_make/task_type/base.py @@ -16,6 +16,9 @@ def __init__(self, task_id): self.task_id = task_id self._has_checker = False + def run_outgen(self): + return True + def get_files_to_compile(self) -> List[Tuple[str, List[str], Dict[str, Any]]]: """ Returns a list of tuples where: diff --git a/src/sinol_make/task_type/interactive_io.py b/src/sinol_make/task_type/interactive_io.py index 2d6a97f9..41f201be 100644 --- a/src/sinol_make/task_type/interactive_io.py +++ b/src/sinol_make/task_type/interactive_io.py @@ -15,6 +15,9 @@ def __init__(self, task_id): self.interactor = None self.interactor_exe = None + def run_outgen(self): + return False + def get_files_to_compile(self): super().get_files_to_compile() interactors = package_util.get_files_matching_pattern(self.task_id, f'{self.task_id}soc.*')