aac.plugins.generate.generate_impl

AaC Plugin implementation module for the Version plugin.

Functions

backup_file(file_path)

Backs up a file by appending .aac_backup to the file name.

clean(aac_file, code_output, test_output, ...)

Clean up generated code, tests, and docs.

generate(aac_file, generator_file, ...)

Generate content from your AaC architecture.

get_callable(package_name, file_name, ...)

Returns a callable function from a package, file, and function name.

get_output_directories(message, ...)

Returns the output directories for code, tests, and docs.

get_output_file_path(root_output_directory, ...)

Returns the output file path for a generator template.

load_template(template_abs_path[, ...])

Load a jinja2 template from a file.

aac.plugins.generate.generate_impl.backup_file(file_path: str) str[source]

Backs up a file by appending .aac_backup to the file name.

Parameters:

file_path (str)

Return type:

str

aac.plugins.generate.generate_impl.clean(aac_file: str, code_output: str, test_output: str, doc_output: str, no_prompt: bool) ExecutionResult[source]

Clean up generated code, tests, and docs.

Parameters:
  • aac_file (str)

  • code_output (str)

  • test_output (str)

  • doc_output (str)

  • no_prompt (bool)

Return type:

ExecutionResult

aac.plugins.generate.generate_impl.generate(aac_file: str, generator_file: str, code_output: str, test_output: str, doc_output: str, no_prompt: bool, force_overwrite: bool, evaluate: bool) ExecutionResult[source]

Generate content from your AaC architecture.

Parameters:
  • aac_file (str)

  • generator_file (str)

  • code_output (str)

  • test_output (str)

  • doc_output (str)

  • no_prompt (bool)

  • force_overwrite (bool)

  • evaluate (bool)

Return type:

ExecutionResult

aac.plugins.generate.generate_impl.get_callable(package_name: str, file_name: str, function_name: str) Callable[source]

Returns a callable function from a package, file, and function name.

Parameters:
  • package_name (str)

  • file_name (str)

  • function_name (str)

Return type:

Callable

aac.plugins.generate.generate_impl.get_output_directories(message: str, aac_plugin_file: str, code_output: str, test_output: str, doc_output: str, no_prompt: bool) tuple[str, str, str][source]

Returns the output directories for code, tests, and docs.

Parameters:
  • message (str)

  • aac_plugin_file (str)

  • code_output (str)

  • test_output (str)

  • doc_output (str)

  • no_prompt (bool)

Return type:

tuple[str, str, str]

aac.plugins.generate.generate_impl.get_output_file_path(root_output_directory: str, generator_template, source_package: str, source_name: str) str[source]

Returns the output file path for a generator template.

Parameters:
  • root_output_directory (str)

  • source_package (str)

  • source_name (str)

Return type:

str

aac.plugins.generate.generate_impl.load_template(template_abs_path: str, helper_functions: dict[str, Callable] = {}) Template[source]

Load a jinja2 template from a file.

Parameters:
  • template_abs_path (str)

  • helper_functions (dict[str, Callable])

Return type:

Template