Skip to content

Commit

Permalink
Merge branch rapidjson
Browse files Browse the repository at this point in the history
  • Loading branch information
djellemah committed May 4, 2024
2 parents 1440940 + 334746b commit 04d2632
Show file tree
Hide file tree
Showing 13 changed files with 641 additions and 17 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,21 @@ jobs:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
- target: x86_64-pc-windows-msvc
runs-on: windows-latest
# - target: x86_64-unknown-linux-musl
# runs-on: ubuntu-latest
- target: x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
- target: x86_64-apple-darwin
- target: aarch64-apple-darwin
runs-on: macos-latest

runs-on: ${{ matrix.runs-on }}
steps:
- uses: actions/checkout@v4
with:
submodules: true

- run: rustup default nightly
- name: compile
run: cargo build --release
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "rapidjson"]
path = rapidjson
url = https://github.com/Tencent/rapidjson.git
22 changes: 11 additions & 11 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'cln'",
"name": "Debug executable 'jch'",
"cargo": {
"args": [
"run",
"--bin=cln",
"--package=cln"
"build",
"--bin=jch",
"--package=jch",
],
"filter": {
"name": "cln",
"name": "jch",
"kind": "bin"
}
},
},
"args": ["../things.json"],
"args": ["-r", "../data/large-file.json"],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'cln'",
"name": "Debug unit tests in executable 'jch'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=cln",
"--package=cln"
"--bin=jch",
"--package=jch"
],
"filter": {
"name": "cln",
"name": "jch",
"kind": "bin"
}
},
Expand Down
180 changes: 180 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,8 @@ rmp = "*"
json-event-parser = {version = "0.2.0"}
crossbeam = "0.8"
rustc-hash = "1.1.0"
cxx = "1.0"
rtrb = "0.3"

[build-dependencies]
cxx-build = "1.0"
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ See releases on the right of this repo page. Executables for linux, windows, mac

If there's no executable to suit you, you'll need to build your own:

Clone this repo.
Clone this repo:
```
git clone --recurse-submodules --shallow-submodules https://github.com/djellemah/jch.git
```

Build it:
``` bash
cargo build --release
```
Expand Down Expand Up @@ -91,3 +95,19 @@ Left hand column is the aggregated type of all leaves at the path in the right-h
- `Xxx:nnnn` means `nnnn` was the number of values encountered, ie the number of leaf nodes matching the path.

- If more than one type was encountered at the path, the left hand column will contain an array of characteristics, as above. That is, it's a sum type.

# Advanced Build
You can use an existing rapidjson tree by specifying the `RAPIDJSON_INCLUDE` env var.

Either on the command line

```
RAPIDJSON_INCLUDE=your_source_dir cargo build
```

or in `.config/cargo.toml` like this

```
[env]
RAPIDJSON_INCLUDE = "rapidjson/include"
```
Loading

0 comments on commit 04d2632

Please sign in to comment.