Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lattice with 232 #13

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cpp/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dependencies:
- name: "nlohmann_json"
- name: "courier"
- name: "fmt"
32 changes: 26 additions & 6 deletions dodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,45 @@

from lattice import Lattice

data_model = Lattice()
data_model = Lattice(build_validation=False)


def task_generate_meta_schemas():
"""Generate JSON meta schemas"""
return {
"file_dep": [schema.file_path for schema in data_model.schemas],
"targets": [schema.meta_schema_path for schema in data_model.schemas],
"actions": [(data_model.generate_meta_schemas, [])],
"clean": True,
}

def task_validate_schemas():
"""Validate the example schemas against the JSON meta schema"""
return {
"task_dep": [f"generate_meta_schemas"],
"file_dep": [schema.file_path for schema in data_model.schemas]
+ [schema.meta_schema_path for schema in data_model.schemas],
"actions": [(data_model.validate_schemas, [])],
}

def task_validate_example_files():
"""Validates the example files against the JSON schema (and other validation steps)"""
return {
"task_dep": [f"validate_schemas"],
"file_dep": data_model.examples
+ [schema.path for schema in data_model.schemas],
+ [schema.file_path for schema in data_model.schemas],
"actions": [(data_model.validate_example_files, [])],
}


def task_generate_cpp_code():
"""Generate CPP headers and source for example schema."""
return {
"file_dep": [schema.path for schema in data_model.cpp_schemas]
"task_dep": [f"validate_schemas"],
"file_dep": [schema.file_path for schema in data_model.cpp_schemas]
+ [schema.meta_schema_path for schema in data_model.schemas],
"targets": [schema.cpp_header_path for schema in data_model.cpp_schemas]
+ [schema.cpp_source_path for schema in data_model.cpp_schemas],
"actions": [(data_model.generate_cpp_project, [[]])],
"targets": [schema.cpp_header_file_path for schema in data_model.cpp_schemas]
+ [schema.cpp_source_file_path for schema in data_model.cpp_schemas],
"actions": [(data_model.generate_cpp_project, [])],
"clean": True,
}
Loading
Loading