EntityLib is a library which allow to store and edit complex and huge json data using schemas.
- Use schemas to keep your data consistent
- Import/Instantiate/Reference a json file in an other
- Override imported data
- Generate strong typed C++/python class for easy and safe coding
- Use JSON schema in VSCode for easy/safe manual edition
Ensure to checkout all git submodules :
git submodule update --init --recursiveLets say you doesn't need the python binding or you have only one python installed:
- Ensure you have cmake installed
- Run the build.bat or build.sh file.
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target BuildAllButUnitTestsNote that you just have to build the target BuildAllButUnitTests. At this point the unit tests are not buildable.
If you have several python installed and want to choose which one to use.
- Ensure you have cmake installed and in you environment path
- Use cmake-gui or ccmake to configure your project in the directory you want (https://cmake.org/runningcmake/)
- Edit options
PYTHON_INCLUDE_DIRto point the the include directory inside your python dirPYTHON_LIBRARYto point to the pythonXY.lib inside you python dir
- Generate !
- Then go in build and open EntityLib.sln.
- Build EntityLib
- Build EntityLibPy to get the python binding
- Build EntGenAPIGenerator and run to get the strong typed API You can do this for several python version on the same machine. Just change the target directory.
You can just run the run_unit_tests.bat or run_unit_tests.sh Or:
build/Release/UpdateSchemas -o build/Schemas -e DemoSchemas/EditionComponents.json,DemoSchemas/Scene-schema.json -r DemoSchemas/RuntimeComponents.jsonbuild/UpdateSchemas -o build/Schemas -e DemoSchemas/EditionComponents.json,DemoSchemas/Scene-schema.json -r DemoSchemas/RuntimeComponents.jsonThis will also produce a json schemas file for each type in the subdirectory "all". This json schema files are usable as a validator for your data files in editors like VSCode or sublime text.
build/Release/EntLibAPIGenerator -s build/Schemas -d build/EntGen -r EntLibAPIGenerator/resourcesbuild/EntLibAPIGenerator -s build/Schemas -d build/EntGen -r EntLibAPIGenerator/resourcescmake --build build --config Release --target TestEntityDLL
cd Test
../build/Release/TestEntityDLLcmake --build build --config Release --target TestEntityDLL
cd Test
../build/TestEntityDLL- Build EntityLib (How to build ?)
- If you want to use the python binding, build EntityLibPy
- Write your schema files (or export them from your engine)
- Merge your schemas (if more than one file) (Merge Custom schemas with Engine schemas)
- Generate strong typed API (optional) (Generate the strong typed API)
- For a c++ project, link EntityLib.lib
- For a python project, import EntityLibPy.pyd