Skip to content

Commit

Permalink
Merge pull request #13 from bigladder/lattice-with-232
Browse files Browse the repository at this point in the history
Lattice with 232
  • Loading branch information
nealkruis authored Feb 3, 2025
2 parents eed9212 + 9afac7d commit bd4b51b
Show file tree
Hide file tree
Showing 118 changed files with 133,792 additions and 7,290 deletions.
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

0 comments on commit bd4b51b

Please sign in to comment.