Skip to content

Commit

Permalink
Updated project to be an Erlang wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
oubiwann committed Jan 14, 2025
1 parent 7b6fc79 commit 57a1cc5
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 441 deletions.
41 changes: 36 additions & 5 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,44 @@ on:

jobs:

core-builds:
new-builds:
name: Erlang ${{ matrix.otp_version }} build
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

strategy:
matrix:
otp_version: ['24.3', '25.3', '26.1']
otp_version: ['27']

steps:
- uses: actions/checkout@v2
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.otp_version }}
rebar3-version: '3.24'
- name: Install Deps
run: sudo apt-get update && sudo apt-get install -y gnuplot
- name: Compile
run: rebar3 compile
- name: Xref Checks
run: rebar3 xref
- name: Dialyzer
run: rebar3 dialyzer
- name: Proper Tests
run: rebar3 as test do compile, proper --regressions
# - name: Run Tests
# run: rebar3 ct -c
- name: Run Unit Tests
run: rebar3 as test lfe ltest -tall
# - name: Test Coverage
# run: rebar3 as test do proper -c, cover -v --min_coverage=0

stable-builds:
name: Erlang ${{ matrix.otp_version }} build
runs-on: ubuntu-24.04

strategy:
matrix:
otp_version: ['26', '25', '24']

steps:
- uses: actions/checkout@v2
Expand All @@ -44,12 +75,12 @@ jobs:
# run: rebar3 as test do proper -c, cover -v --min_coverage=0

older-builds:
name: Old Erlang ${{ matrix.otp_version }} build
name: Erlang ${{ matrix.otp_version }} build
runs-on: ubuntu-20.04

strategy:
matrix:
otp_version: ['21.3', '22.3', '23.3']
otp_version: ['23', '22', '21']

steps:
- uses: actions/checkout@v2
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

## About

Until all supported Erlang versions have `json` and support a backwards-compatible feature set, this library will be around.
ljson provides a very thin wrapper around the `encode/1`, `encode/2` functions of the jsx library when running in OTP versions 26 and below; it provides a similar wrapper for `encode/1`, `encode/3` when running in OTP 27 and above.

In both cases, binary is returned. Since Erlang 27's `json` returns an iolist, this does add a step for Erlang 27+ and breaks a bit of that compatibility in the interest of preserving more backwards compatibility for projects that have used jsx.

How long will this library be around? Until there's a better library easily usable from LFE projects, or until all supported Erlang versions have `json` and provide a backwards-compatible feature set, this library will be around.

## Usage

Expand Down
97 changes: 0 additions & 97 deletions priv/make/code.mk

This file was deleted.

60 changes: 0 additions & 60 deletions priv/make/docs.mk

This file was deleted.

101 changes: 50 additions & 51 deletions rebar.config
Original file line number Diff line number Diff line change
@@ -1,59 +1,58 @@
{erl_opts, [debug_info]}.

{deps, [
{lfe, {git, "https://github.com/lfe/lfe.git", {branch, "bleeding-edge"}}},
{lutil, {git, "https://github.com/lfex/lutil.git", {branch, "master"}}},
{jsx, {git, "https://github.com/talentdeficit/jsx.git", {tag, "v2.9.0"}}},
{mochiweb, {git, "https://github.com/mochi/mochiweb.git", {tag, "v2.19.0"}}}
]}.
{jsx, "~> 3.1"}
]}.

{plugins, [
{lfe, {git, "https://github.com/lfe/lfe.git", {branch, "bleeding-edge"}}},
{'lfe-compile', {git, "https://github.com/lfe-rebar3/compile.git", {branch, "master"}}},
{'lfe-test', {git, "https://github.com/lfe-rebar3/test.git", {branch, "master"}}},
{'lfe-clean', {git, "https://github.com/lfe-rebar3/clean.git", {branch, "master"}}}
]}.
{project_plugins, [
{rebar3_lfe, "~> 0.4"}
]}.

{provider_hooks, [
{pre, [{compile, {lfe, compile}}]}
]}.
{pre, [{compile, {lfe, compile}}]}
]}.

{xref_checks,[
undefined_function_calls,undefined_functions,locals_not_used,
deprecated_function_calls,deprecated_functions
]}.

{profiles, [
%% As an alternative to the default Github repos, you can use the Gitlab
%% mirror with the following:
%% $ rebar3 as gitlab compile
{gitlab, [
{deps, [
{lfe, {git, "https://gitlab.com/lfe/lfe.git", {tag, "v1.2.0"}}},
{ltest, {git, "https://gitlab.com/lfex/ltest.git", {tag, "0.10.0-rc2"}}}]},
{plugins, [
{'lfe-compile', {git, "https://gitlab.com/lfe-rebar3/compile.git", {tag, "0.8.0-rc2"}}},
{'lfe-test', {git, "https://gitlab.com/lfe-rebar3/test.git", {tag, "0.4.0-rc2"}}}]}
]},
%% Or use Hex.pm instead with:
%% $ rebar3 as hexpm compile
{hexpm, [
{deps, [{lfe, "1.2.0"},
{ltest, "0.10.0-rc2"}]},
{plugins, [{rebar3_lfe_compile, "0.8.0-rc2"},
{rebar3_lfe_test, "0.4.0-rc2"},
{rebar3_lfe_clean, "0.4.0-rc2"}]},
{erl_opts, [{src_dirs, ["src", "test"]}]}
{test, [
{deps, [
{proper, "~> 1.3"},
{ltest, "~> 0.13.11"}
]},
{plugins, [
{rebar3_proper, "~> 0.12"}
]},
{eunit_opts, [verbose]},
{erl_opts, [{src_dirs, ["src", "test"]}]}
]},
{maintainer, [
{plugins, [rebar3_hex]}
]}
]}.

{alias, [
{coverage, [
{proper, "-c"},
{cover, "-v --min_coverage=0"}
]},
%% as test
{ltest, [
{lfe, ltest, "-tall"}
]},
{check, [
compile,
xref,
dialyzer,
ltest,
coverage
]},
{dev, [
{deps, [
{lfe, {git, "https://github.com/lfe/lfe.git", {branch, "bleeding-edge"}}}]},
{plugins, [
{'lfe-version', {git, "https://github.com/lfe-rebar3/version.git", {branch, "master"}}},
{'lfe-clean', {git, "https://github.com/lfe-rebar3/clean.git", {branch, "master"}}}
]}]},
{test, [
{deps, [
{lfe, {git, "https://github.com/lfe/lfe.git", {branch, "bleeding-edge"}}},
{ltest, {git, "https://github.com/lfex/ltest.git", {branch, "master"}}},
{'lfe-version', {git, "https://github.com/lfe-rebar3/version.git", {branch, "master"}}}]},
{plugins, [
{'lfe-test', {git, "https://github.com/lfe-rebar3/test.git", {branch, "master"}}}]},
{eunit_opts, [verbose]},
{erl_opts, [{src_dirs, ["src", "test"]}]},
{eunit_compile_opts, [{src_dirs, ["src", "test"]}]}
%% The following should be run with `rebar3 as maintainer publish`:
{publish, [
compile,
{hex, "publish package"}
]}
]}.
]}.
35 changes: 0 additions & 35 deletions src/ljson-util.lfe

This file was deleted.

Loading

0 comments on commit 57a1cc5

Please sign in to comment.