Skip to content

Commit

Permalink
update build documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
scholarsmate committed Oct 5, 2023
1 parent 02ca17e commit a496f0c
Show file tree
Hide file tree
Showing 14 changed files with 127 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:
jobs:
analyze:
name: Analyze
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ratCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
check:
name: Rat Check
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
defaults:
run:
shell: bash
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Count lines of code (CLOC)
- name: Count lines of code (CLOC) 📐
uses: djdefi/cloc-action@5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
checkName: "CLOC"
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Check ratCheck
- name: Check ratCheck
uses: fountainhead/[email protected]
id: rat-check
with:
Expand All @@ -46,7 +46,7 @@ jobs:
checkName: "Rat Check"
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Check scala format
- name: Check Scala format
uses: fountainhead/[email protected]
id: scala-format
with:
Expand All @@ -55,7 +55,7 @@ jobs:
checkName: "Scala code is properly formatted"
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Check typescript format
- name: Check TypeScript format
uses: fountainhead/[email protected]
id: ts-format
with:
Expand All @@ -64,7 +64,7 @@ jobs:
checkName: "TypeScript code is properly formatted"
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Check tests - macos
- name: Check tests - macOS ✅
uses: fountainhead/[email protected]
id: macos-tests
with:
Expand All @@ -73,7 +73,7 @@ jobs:
checkName: "Build middleware macos-11 🔧"
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Check tests - ubuntu
- name: Check tests - Linux ✅
uses: fountainhead/[email protected]
id: ubuntu-tests
with:
Expand All @@ -82,7 +82,7 @@ jobs:
checkName: "Build middleware ubuntu-20.04 🔧"
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Check tests - windows
- name: Check tests - Windows ✅
uses: fountainhead/[email protected]
id: windows-tests
with:
Expand All @@ -91,7 +91,7 @@ jobs:
checkName: "Build middleware windows-2019 🔧"
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- name: Quality gate
- name: Quality Gate ✅
if: steps.rat-check.outputs.conclusion != 'success' || steps.scala-format.outputs.conclusion != 'success' || steps.ts-format.outputs.conclusion != 'success' || steps.macos-tests.outputs.conclusion != 'success' || steps.ubuntu-tests.outputs.conclusion != 'success' || steps.windows-tests.outputs.conclusion != 'success'
run: |
echo "Rat Check Status: ${{ steps.rat-check.conclusion }}"
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
with:
name: upload_url

- name: Add upload_url to GITHUB_ENV
- name: Add upload_url to GITHUB_ENV 📐
run: |
UPLOAD_URL=$(cat upload_url)
echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scala-steward.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ on:

jobs:
scala-steward:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
name: Scala Steward 🔔
steps:
- name: Scala Steward 🔔
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ jobs:
timeout-minutes: 30

- name: Yarn Install 🏗️
if: runner.os != 'Windows' # TODO: Make sure tests run on windows
run: yarn
shell: bash

- name: Yarn Package - Server 📦
if: runner.os != 'Windows' # TODO: Make sure tests run on windows
run: yarn workspace @omega-edit/server package
shell: bash
timeout-minutes: 30

- name: Yarn Test - Client 🧑‍💼
if: runner.os != 'Windows' # TODO: Make sure tests run on windows
Expand Down
123 changes: 56 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,136 +30,125 @@

## Goal

The goal of this project is to provide an open source library for building editors that can handle massive files, and multiple viewports.
The goal of this project is to provide an open source library for building editors that can handle massive files, 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
- **conan** C/C++ package manager (https://conan.io)
- **git** for version control (https://git-scm.com)
- **make** or **ninja** for running the build scripts (https://www.gnu.org/software/make/ or https://ninja-build.org)
- **nvm** or **nodeenv** for using specific versions of node.js
- **doxygen** to generate API documentation (https://www.doxygen.nl)
- **graphviz** to generate API documentation (https://graphviz.org)
- **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**
- **scala/sbt/java** for building and running the gRPC server (https://www.scala-lang.org)
- **yarn** for building, testing, and packaging the node artifacts (https://yarnpkg.com)

### IDE

The Ωedit™ project is built primarily using [CLion](https://www.jetbrains.com/clion/), though [Visual
Studio Code](https://code.visualstudio.com/) also works well.

## Build the core library (C/C++)

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

### Install conan:

Conan is the package manager used to install the C/C++ dependencies. It can be installed via pip.

```bash
pip install conan
```

### Configure a debug build:
### Configure a build:

Depending on your linking needs, Ωedit™ can be built as either as a static (e.g., libomega_edit.a) or shared (e.g., libomega_edit.so) library.
Depending on your linking needs, Ωedit™ can be built _either_ as a static (e.g., libomega_edit.a) or shared
(e.g., libomega_edit.so) library. `Release` or `Debug` versions can be created. Example programs and documentation can
also be built if desired. The Scala server _requires_ a shared library.

- #### Static:
Here is how to build a debug version of a shared library, with no documentation or example programs.

```bash
cmake -S core -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug
```

- #### Shared:

```bash
cmake -S core -B cmake-build-debug -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=YES
cmake -S . -B _build -DCMAKE_BUILD_TYPE=Debug -DBUILD_DOCS=NO -DBUILD_EXAMPLES=NO -DBUILD_SHARED_LIBS=YES
```

### Build the configured build:

This will build the core library, and any example programs or documentation if configured. Note that the config type
(`Debug` or `Release`) must match the config type (`CMAKE_BUILD_TYPE`) used when configuring the build.

```bash
cmake --build cmake-build-debug
cmake --build _build --config Debug
```

### Run the test suite:

This will run the test suite for the core library. Note that the build config (`Debug` or `Release`) must match the
config type (`CMAKE_BUILD_TYPE`) used when configuring the build.

```bash
cmake -S core/src/tests -B cmake-build-tests -DCMAKE_BUILD_TYPE=Debug
pushd cmake-build-tests && ctest -C Debug --output-on-failure && popd
ctest --build-config Debug --test-dir _build/core --output-on-failure
```

## Packaging Ωedit™

### Scala API and Native

This publishes for Scala version 2.13 to GitHub packages.
### Install the core library:

- Requires the `GITHUB_TOKEN` environment variable to be set
We're installing in a directory named `_install` in the root of the repository. This is is where the Scala server will
look for the shared library by default or it can use the OE_LIB_DIR environment variable if different than the default
location. If you just want to use the library itself, you can install it anywhere you like (e.g., `/usr/local`).

```bash
sbt publishAll
cmake --install _build --config Debug --prefix _install
```

### Scala Reference Server
## Packaging Ωedit™ gRPC Server and Node Client

This packages the reference Scala server to a local zip folder
:exclamation: These commands should be executed at the root level of the repository after building/installing the core
library :exclamation:

```bash
cd server/scala
sbt universal:packageBin
```

Zip file will be located at
Build, test, and package the server and client node packages. The server package will include the shared library built
in the previous step and packages a gRPC server that runs in a Java Virtual Machine (JVM). The client package will
include the node client.

```bash
server/scala/target/universal/omega-edit-grpc-server-${VERSION}.zip
yarn install
yarn workspace @omega-edit/server package
yarn workspace @omega-edit/client test
```

### TypeScript Client

This package is normally uploaded to npmjs.com

:exclamation: Node needs to be installed but shouldn't matter what version you use. :exclamation:

- Create local `.tgz` file

```bash
cd packages/client
yarn install # if not ran before
yarn package
```

- File will be at
Node packages will be in `.tgz` files located at:

```bash
packages/client/omega-edit-node-client-v${VERSION}.tgz
```

- Publish `.tgz` file to npmjs -- requires auth

```bash
yarn publish omega-edit-v${VERSION}.tgz
```

## Development

Currently, the repo holds bindings for both Scala and node.
```
/packages/server/omega-edit-node-server-${VERSION}.tgz
/packages/client/omega-edit-node-client-${VERSION}.tgz
```

## Release Binaries

[Binary releases](https://github.com/ctc-oss/omega-edit/releases) for macOS (ARM and x86), Windows (x86), and Linux (ARM, and x86; glibc 2.31 or greater required) are built and published via GitHub CI workflows.
[Binary releases](https://github.com/ctc-oss/omega-edit/releases) for macOS (Apple Silicon and x86), Windows (x86), and
Linux (ARM, and x86; glibc 2.31 or greater required) are built and published via GitHub CI workflows.

## Versioning

Ωedit™ follows [Semantic Versioning](http://semver.org/).

## ⚡Powered by Ωedit™

- [Apache Daffodil™ Extension for Visual Studio Code](https://github.com/apache/daffodil-vscode) - The Data Editor
component of this Visual Studio Code extension is powered by Ωedit™.

## License

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fctc-oss%2Fomega-edit.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fctc-oss%2Fomega-edit?ref=badge_large)
12 changes: 3 additions & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,14 @@ done
# shellcheck disable=SC2155
export OE_LIB_DIR="$(readlink -f "$install_dir-shared-$type/lib")"

# Build and test the Scala server
pushd server/scala
sbt test
sbt serv/test
popd

# install common packages and check lint for client and server
yarn install
yarn lint

# Package scala server node module
yarn workspace @omega-edit/server package # this creates the server zip as well
# Build, test, and package Scala server node module
yarn workspace @omega-edit/server package

# Build and test the TypeScript client
# Build, test, and package the TypeScript client node module
yarn workspace @omega-edit/client test

echo "✔ Done! ✨"
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.9.74",
"private": "true",
"description": "OmegaEdit Client and Server",
"publisher": "ctc-oss",
"publisher": "CTC-OSS",
"repository": {
"url": "https://github.com/ctc-oss/omega-edit",
"type": "git"
},
"bugs": {
"url": "https://github.com/ctc-oss/omega-edit/issues"
},
"author": "Shane Dell, Davin Shearer, John Wass",
"author": "CTC-OSS",
"license": "Apache-2.0",
"workspaces": [
"packages/*"
Expand All @@ -33,6 +33,7 @@
"eslint-plugin-prettier": "^5.0.0",
"mocha": "^10.0.0",
"prettier": "^3.0.3",
"run-script-os": "^1.1.6",
"ts-loader": "^9.4.4",
"ts-node": "^10.9.1",
"typedoc": "^0.25.1",
Expand Down
5 changes: 2 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"bugs": {
"url": "https://github.com/ctc-oss/omega-edit/issues"
},
"author": "Shane Dell, Davin Shearer, John Wass",
"author": "CTC-OSS",
"license": "Apache-2.0",
"scripts": {
"build": "webpack --mode=production",
Expand All @@ -31,8 +31,7 @@
},
"devDependencies": {
"grpc-tools": "^1.12.4",
"grpc_tools_node_protoc_ts": "^5.3.3",
"run-script-os": "^1.1.6"
"grpc_tools_node_protoc_ts": "^5.3.3"
},
"dependencies": {
"@grpc/grpc-js": "1.9.4",
Expand Down
Loading

0 comments on commit a496f0c

Please sign in to comment.