Skip to content

Commit

Permalink
1.0 code complete (#1)
Browse files Browse the repository at this point in the history
* wip

* wip

* wip: mostly done with initial tests

* v1.0 tests implemented

* wip: adding examples

* add examples to test

* examples entered.

* update help

* get rid of inapplicable message

* fix literal encoding for Win
  • Loading branch information
rpatters1 authored Jan 21, 2025
1 parent faa2a94 commit 5a79a30
Show file tree
Hide file tree
Showing 67 changed files with 10,206 additions and 345 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ Thumbs.db
callgrind.out.*


# Ignore everything in tests/data
tests/data/*

# Allow tests/data/inputs and its contents
!tests/data/inputs/
!tests/data/inputs/**

# Explicitly exclude unwanted files in tests/data/inputs
tests/data/inputs/**/.DS_Store
27 changes: 3 additions & 24 deletions cmake/GenerateMnxSchemaXxd.cmake
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
# GenerateMnxSchemaXxd.cmake

# Define the paths
set(MNX_SCHEMA_JSON "${CMAKE_BINARY_DIR}/third_party/mnx-schema.json")
set(MNX_SCHEMA_DIR "${CMAKE_SOURCE_DIR}/schema")
set(MNX_SCHEMA_JSON "${MNX_SCHEMA_DIR}/mnx-schema.json")
set(GENERATED_MNX_XXD "${GENERATED_DIR}/mnx_schema.xxd")
set(MNX_SCHEMA_URL "https://w3c.github.io/mnx/docs/mnx-schema.json")

file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/third_party")

# Only download if the file doesn't exist
if(NOT EXISTS "${MNX_SCHEMA_JSON}")
message(STATUS "Downloading ${MNX_SCHEMA_URL}...")
execute_process(
COMMAND curl --fail --location --output "${MNX_SCHEMA_JSON}" "${MNX_SCHEMA_URL}"
RESULT_VARIABLE download_result
OUTPUT_QUIET
ERROR_QUIET
)

if(NOT download_result EQUAL 0)
message(FATAL_ERROR "Failed to download ${MNX_SCHEMA_URL}")
else()
message(STATUS "Downloaded ${MNX_SCHEMA_URL} to ${MNX_SCHEMA_JSON}")
endif()
else()
message(STATUS "Schema file already exists; skipping download.")
endif()

# Step 2: Convert mnx-schema.json to mnx_schema.xxd
add_custom_command(
OUTPUT "${CMAKE_BINARY_DIR}/generated/mnx_schema.xxd"
COMMAND ${CMAKE_COMMAND} -E echo "Generating mnx_schema.xxd..."
COMMAND ${CMAKE_COMMAND} -E make_directory "${GENERATED_DIR}"
COMMAND ${CMAKE_COMMAND} -E chdir "${CMAKE_BINARY_DIR}/third_party"
COMMAND ${CMAKE_COMMAND} -E chdir "${MNX_SCHEMA_DIR}"
xxd -i "mnx-schema.json" > "${GENERATED_MNX_XXD}"
DEPENDS "${MNX_SCHEMA_JSON}"
COMMENT "Converting mnx-schema.json to mnx_schema.xxd"
Expand Down
Loading

0 comments on commit 5a79a30

Please sign in to comment.