Skip to content

Commit 1af7f0e

Browse files
Oleksandr Muzyka (EPAM)Oleksandr Muzyka (EPAM)
authored andcommitted
Extend SAMM CLI with new functions + test coverage:
* prettyprint: Format Aspect Model files * to_java: Generate Java classes from Aspect Models * to_asyncapi: Generate AsyncAPI specifications * to_jsonld: Generate JSON-LD representations * to_sql: Generate SQL scripts for Aspect data * to_aas: Generate Asset Administration Shell templates * edit_move: Move model elements between files/namespaces * edit_newversion: Create new versions of models * usage: Show where model elements are used * aas_to_aspect: Convert AAS templates to Aspect Models * aas_list: List submodel templates in AAS files * package_import: Import namespace packages * package_export: Export models as namespace packages - Enhance _call_function method to support different command types (aspect, aas, package) - Add support for repeated parameters (lists in kwargs) - Add integration test suite that: * Tests all possible model transformations * Verifies output file validity * Tests language-specific outputs * Tests package export/import functionality * Uses realistic test Aspect Model
1 parent 4bd5bc8 commit 1af7f0e

File tree

88 files changed

+1483
-331
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1483
-331
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,4 +70,4 @@ dmypy.json
7070
# SAMM
7171
core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_aspect_meta_model/samm/
7272
/core/esmf-aspect-meta-model-python/samm-cli/
73-
/core/esmf-aspect-meta-model-python/tests/integration/java_models/resources/
73+
/core/esmf-aspect-meta-model-python/tests/integration/aspect_model_loader/java_models/resources/

AUTHORS.md

Lines changed: 1 addition & 0 deletions

core/esmf-aspect-meta-model-python/README.md

Lines changed: 14 additions & 1 deletion
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .base import SammCli

core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli/base.py

Lines changed: 508 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Copyright (c) 2023 Robert Bosch Manufacturing Solutions GmbH
2+
#
3+
# See the AUTHORS file(s) distributed with this work for additional
4+
# information regarding authorship.
5+
#
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
#
10+
# SPDX-License-Identifier: MPL-2.0
11+
"""Constants for SAMM CLI commands and types."""
12+
13+
14+
class SAMMCLICommands:
15+
"""SAMM CLI command names."""
16+
17+
VALIDATE = "validate"
18+
TO_OPENAPI = "to openapi"
19+
TO_SCHEMA = "to schema"
20+
TO_JSON = "to json"
21+
TO_HTML = "to html"
22+
TO_PNG = "to png"
23+
TO_SVG = "to svg"
24+
PRETTYPRINT = "prettyprint"
25+
TO_JAVA = "to java"
26+
TO_ASYNCAPI = "to asyncapi"
27+
TO_JSONLD = "to jsonld"
28+
TO_SQL = "to sql"
29+
TO_AAS = "to aas"
30+
EDIT_MOVE = "edit move"
31+
EDIT_NEWVERSION = "edit newversion"
32+
USAGE = "usage"
33+
AAS_TO_ASPECT = "to aspect"
34+
AAS_LIST = "list"
35+
PACKAGE_IMPORT = "import"
36+
PACKAGE_EXPORT = "export"
37+
38+
39+
class SAMMCLICommandTypes:
40+
"""SAMM CLI command types."""
41+
42+
ASPECT = "aspect"
43+
AAS = "aas"
44+
PACKAGE = "package"

core/esmf-aspect-meta-model-python/esmf_aspect_meta_model_python/samm_cli_functions.py

Lines changed: 0 additions & 155 deletions
This file was deleted.

core/esmf-aspect-meta-model-python/scripts/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,4 @@ class TestModelConstants:
3434
"esmf-test-aspect-models-$version_number.jar"
3535
)
3636
SAMM_VERSION = SAMM_VERSION
37-
TEST_MODELS_PATH = join("tests", "integration", "java_models", "resources")
37+
TEST_MODELS_PATH = join("tests", "integration", "aspect_model_loader", "java_models", "resources")

core/esmf-aspect-meta-model-python/tests/integration/java_models/__init__.py renamed to core/esmf-aspect-meta-model-python/tests/integration/aspect_model_loader/__init__.py

File renamed without changes.

core/esmf-aspect-meta-model-python/tests/integration/aspect_model_loader/java_models/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)