/omega-edit

Open source library for building editors that can handle massive files, multiple authors, and multiple viewports.

Primary LanguageC++Apache License 2.0Apache-2.0

Omega Edit Logo

Ωedit Library

Release Build Status CodeQL codecov Total alerts Language grade: C/C++ Language grade: JavaScript FOSSA Status

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

Development requirements:

Build the core library (C/C++)

These commands should be executed at the root level of the repository

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:

OPTION 1: Use nvm (Node Version Manager)

Using Node v14 in nvm looks like this:

nvm use 14

OPTION 2: Setup a Node v14 virtual environment using nodeenv

nodeenv --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.

License

FOSSA Status