Goal
The goal of this project is to provide an open source library for building editors that can handle massive files, multiple authors, and multiple viewports.
User documentation
User documentation is published to https://ctc-oss.github.io/omega-edit/.
Requirements
IDE
The Ωedit project is built primarily using CLion. If using CLion everything should build seamlessly, though Visual Studio Code also works well.
Command line tools
- C/C++ compiler (such as clang, gcc, mingw, or MSVC)
- CMake (https://cmake.org/download/)
- conan C/C++ package manager
- make or ninja for running the build scripts
- nvm or nodeenv for using specific versions of node.js
- node-gyp (to run
package.json
scripts)npm install -g node-gyp
- doxygen to generate API documentation (https://www.doxygen.nl)
- sphinx to generate user documentation (https://www.sphinx-doc.org)
- sphinx RTD theme (https://github.com/readthedocs/sphinx_rtd_theme)
- breathe ReStructuredText and Sphinx bridge to Doxygen (https://github.com/michaeljones/breathe)
- scala/sbt/java
Development requirements:
- swig to generate language bindings (http://www.swig.org/svn.html)
Build the core library (C/C++)
Install conan:
pip install conan
Configure debug build:
cmake -S . -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug
Run debug build:
cmake --build cmake-build-debug
Run unit tests:
cd cmake-build-debug/src/tests/
./omega_test -d yes --order lex
cd ../../../
Build Node bindings
The SWIG bindings are generated for Node v14, so we need to setup the environment accordingly. There are several reasonable ways to do this. Here are two options:
Node Version Manager)
OPTION 1: Use nvm (Using Node v14 in nvm looks like this:
nvm use 14
nodeenv
OPTION 2: Setup a Node v14 virtual environment usingnodeenv --node=14.16.0 venv
Activate the Node virtual environment:
source ./venv/bin/activate
Building and testing
Using Node v14 (by whatever method), build the bindings, and run an example:
node ci
node src/examples/omega_simple.js
Creating Java Native/Shared Library - Manual
Create C++ binary
cmake -S . -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug
cmake --build cmake-build-debug
Create wrapper binary
g++ -std=c++11 -c -fPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/darwin src/bindings/java/omega_edit_wrap.cxx -o lib/omega_edit_wrap.o
Create library file
g++ -std=c++11 -dynamiclib -o lib/libomega_edit.dylib cmake-build-debug/libomega_edit.a lib/omega_edit_wrap.o -lc
Running API
For the Scala code the build.sbt
runs everything listed above automatically. This is to ensure the environment is setup so that the API can run without errors.
Command to start up API:
sbt run
If you navigate to http://localhost:9000/no_params?methodName=omega_license_get
in the browser you get the license text.
Packaging Ωedit
Package file follows naming pattern omega_edit-$omegaEditVer
, eg omega_edit-1.0.0-0.1.0-SNAPSHOT.zip
.
The libomega_edit.*
files that are stored in lib
are added the package when the command is ran.
sbt universal:packageBin
Development
Currently, the repo holds bindings for both java and node.
Regenerate Node and Java bindings using SWIG (as required)
If any header files have been added, removed, or changed, regenerate the API wrapper code using SWIG:
swig -javascript -node -v -c++ -outdir src/bindings/node src/bindings/node/omega_edit.i
swig -v -c++ -java -outdir src/bindings/java src/bindings/java/omega_edit.i
Versioning
Ωedit follows Semantic Versioning.