Skip to content

Commit 8ca2f55

Browse files
committed
Added initial project files.
1 parent 007eb5e commit 8ca2f55

File tree

10 files changed

+380
-13
lines changed

10 files changed

+380
-13
lines changed

.github/workflows/cicd.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: ci/cd
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main, 'release/*' ]
7+
pull_request:
8+
branches: [ main, 'release/*' ]
9+
# Build once a month, just to be sure things are still working
10+
schedule:
11+
- cron: "19 3 26 * *"
12+
13+
jobs:
14+
15+
core-builds:
16+
name: Erlang ${{ matrix.otp_version }} build
17+
runs-on: ubuntu-latest
18+
19+
strategy:
20+
matrix:
21+
otp_version: ['24', '25', '26']
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: erlef/setup-beam@v1
26+
with:
27+
otp-version: ${{ matrix.otp_version }}
28+
rebar3-version: '3.22'
29+
- name: Compile
30+
run: rebar3 compile
31+
- name: Xref Checks
32+
run: rebar3 xref
33+
- name: Dialyzer
34+
run: rebar3 dialyzer
35+
- name: Proper Tests
36+
run: rebar3 as test do compile, proper --regressions
37+
- name: Run Unit Tests
38+
run: rebar3 as test lfe ltest -tall
39+
40+
older-builds:
41+
name: Erlang ${{ matrix.otp_version }} build (old)
42+
runs-on: ubuntu-20.04
43+
44+
strategy:
45+
matrix:
46+
otp_version: ['21.3', '22.3', '23.3']
47+
48+
steps:
49+
- uses: actions/checkout@v2
50+
- uses: erlef/setup-beam@v1
51+
with:
52+
otp-version: ${{ matrix.otp_version }}
53+
rebar3-version: '3.15'
54+
- name: Compile
55+
run: rebar3 compile
56+
- name: Xref Checks
57+
run: rebar3 xref
58+
- name: Dialyzer
59+
run: rebar3 dialyzer
60+
- name: Compile Tests
61+
run: rebar3 as test compile
62+
- name: Proper Tests
63+
run: rebar3 as test proper --regressions
64+
- name: Run Unit Tests
65+
run: rebar3 as test lfe ltest -tall

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
.DS_Store
2+
*.beam
3+
*.beam
4+
*.elc
5+
*.iml
6+
*.o
7+
*.plt
8+
*.sublime-project
9+
*.sublime-workspace
10+
*.swo
11+
*.swp
12+
*~
13+
.\#*
14+
.erlang.cookie
15+
.eunit
16+
.idea
17+
.rebar/*
18+
.rebar3
19+
/.emacs.desktop
20+
/.emacs.desktop.lock
21+
\#*\#
22+
_*
23+
_build/*
24+
auto-save-list
25+
bin
26+
deps
27+
ebin
28+
erl_crash.dump
29+
log
30+
logs
31+
rebar/*
32+
rebar3.crashdump
33+
tramp
34+
priv/images/drafts

LICENSE

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,7 @@
175175

176176
END OF TERMS AND CONDITIONS
177177

178-
APPENDIX: How to apply the Apache License to your work.
179-
180-
To apply the Apache License to your work, attach the following
181-
boilerplate notice, with the fields enclosed by brackets "[]"
182-
replaced with your own identifying information. (Don't include
183-
the brackets!) The text should be enclosed in the appropriate
184-
comment syntax for the file format. We also recommend that a
185-
file or class name and description of purpose be included on the
186-
same "printed page" as the copyright notice for easier
187-
identification within third-party archives.
188-
189-
Copyright [yyyy] [name of copyright owner]
178+
Copyright 2024, Duncan McGreggor <[email protected]>.
190179

191180
Licensed under the Apache License, Version 2.0 (the "License");
192181
you may not use this file except in compliance with the License.

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,67 @@
11
# xrepl
2-
An experimnental headless LFE REPL
2+
3+
[![Build Status][gh-actions-badge]][gh-actions]
4+
[![LFE Versions][lfe-badge]][lfe]
5+
[![Erlang Versions][erlang-badge]][version]
6+
[![Tags][github-tags-badge]][github-tags]
7+
8+
[![Project Logo][logo]][logo-large]
9+
10+
*An experimental, general purpose LFE REPL*
11+
12+
##### Table of Contents
13+
14+
* [About](#about-)
15+
* [Build](#build-)
16+
* [Start the Project REPL](#start-the-repl-)
17+
* [Tests](#tests-)
18+
* [Usage](#usage-)
19+
* [License](#license-)
20+
21+
## About [&#x219F;](#table-of-contents)
22+
23+
TBD
24+
25+
## Build [&#x219F;](#table-of-contents)
26+
27+
```shell
28+
$ rebar3 lfe compile
29+
```
30+
31+
# Start the Project REPL [&#x219F;](#table-of-contents)
32+
33+
```shell
34+
$ rebar3 lfe repl
35+
```
36+
37+
# Tests [&#x219F;](#table-of-contents)
38+
39+
```shell
40+
$ rebar3 as test lfe ltest
41+
```
42+
43+
## Usage [&#x219F;](#table-of-contents)
44+
45+
TBD
46+
47+
## License [&#x219F;](#table-of-contents)
48+
49+
Apache License, Version 2.0
50+
51+
Copyright © 2024, The LFE Community <http://lfe.io>.
52+
53+
[//]: ---Named-Links---
54+
55+
[logo]: resources/images/project-art-large.jpg
56+
[logo-large]: resources/images/project-art-large.jpg
57+
[github]: https://github.com/lfe/xrepl
58+
[gitlab]: https://gitlab.com/lfe/xrepl
59+
[gh-actions-badge]: https://github.com/lfe/xrepl/actions/workflows/cicd.yml/badge.svg
60+
[gh-actions]: https://github.com/ORG/xrepl/actions/workflows/cicd.yml
61+
[lfe]: https://github.com/lfe/lfe
62+
[lfe-badge]: https://img.shields.io/badge/lfe-2.1-blue.svg
63+
[erlang-badge]: https://img.shields.io/badge/erlang-21%20to%2026-blue.svg
64+
[version]: https://github.com/ORG/xrepl/blob/main/.github/workflows/cicd.yml
65+
[github-tags]: https://github.com/ORG/xrepl/tags
66+
[github-tags-badge]: https://img.shields.io/github/tag/lfe/xrepl.svg
67+
[github-downloads]: https://img.shields.io/github/downloads/lfe/xrepl/total.svg

priv/images/project-art-large.jpg

274 KB
Loading

rebar.config

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{erl_opts, [debug_info]}.
2+
3+
{deps, [
4+
{lfe, "2.1.3"},
5+
{ltest, "0.13.6"}
6+
]}.
7+
8+
{plugins, [
9+
{rebar3_lfe, "0.4.9"}
10+
]}.
11+
12+
{provider_hooks, [
13+
{pre, [{compile, {lfe, compile}}]}
14+
]}.
15+
16+
{xref_checks,[
17+
undefined_function_calls,undefined_functions,locals_not_used,
18+
deprecated_function_calls,deprecated_functions
19+
]}.
20+
21+
{profiles, [
22+
{test, [
23+
{deps, [
24+
{proper, "1.4.0"}
25+
]},
26+
{plugins, [
27+
{rebar3_proper, "0.12.1"}
28+
]},
29+
{eunit_opts, [verbose]},
30+
{erl_opts, [{src_dirs, ["src", "test"]}]}
31+
]}
32+
]}.
33+
34+
{alias, [
35+
{coverage, [
36+
{proper, "-c"},
37+
{cover, "-v --min_coverage=0"}
38+
]},
39+
{check, [
40+
compile,
41+
%%xref,
42+
%%dialyzer,
43+
eunit,
44+
coverage
45+
]}
46+
]}.

src/xrepl-app.lfe

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
(defmodule xrepl-app
2+
(behaviour application)
3+
;; app implementation
4+
(export
5+
(start 2)
6+
(stop 1)))
7+
8+
;;; --------------------------
9+
;;; application implementation
10+
;;; --------------------------
11+
12+
(defun start (_type _args)
13+
(logger:set_application_level 'xrepl 'all)
14+
(logger:info "Starting xrepl application ...")
15+
(xrepl-sup:start_link))
16+
17+
(defun stop (_state)
18+
(xrepl-sup:stop)
19+
'ok)

src/xrepl-sup.lfe

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
(defmodule xrepl-sup
2+
(behaviour supervisor)
3+
;; supervisor implementation
4+
(export
5+
(start_link 0)
6+
(stop 0))
7+
;; callback implementation
8+
(export
9+
(init 1)))
10+
11+
;;; ----------------
12+
;;; config functions
13+
;;; ----------------
14+
15+
(defun SERVER () (MODULE))
16+
(defun supervisor-opts () '())
17+
(defun sup-flags ()
18+
`#M(strategy one_for_one
19+
intensity 3
20+
period 60))
21+
22+
;;; -------------------------
23+
;;; supervisor implementation
24+
;;; -------------------------
25+
26+
(defun start_link ()
27+
(supervisor:start_link `#(local ,(SERVER))
28+
(MODULE)
29+
(supervisor-opts)))
30+
31+
(defun stop ()
32+
(gen_server:call (SERVER) 'stop))
33+
34+
;;; -----------------------
35+
;;; callback implementation
36+
;;; -----------------------
37+
38+
(defun init (_args)
39+
`#(ok #(,(sup-flags) (,(child 'xrepl 'start_link '())))))
40+
41+
;;; -----------------
42+
;;; private functions
43+
;;; -----------------
44+
45+
(defun child (mod fun args)
46+
`#M(id ,mod
47+
start #(,mod ,fun ,args)
48+
restart permanent
49+
shutdown 2000
50+
type worker
51+
modules (,mod)))

src/xrepl.app.src

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{application, 'xrepl', [
2+
{description, "An experimental, general purpose LFE REPL"},
3+
{vsn, git},
4+
{registered, []},
5+
{mod, {'xrepl-app', []}},
6+
{applications, [
7+
kernel,
8+
stdlib
9+
]},
10+
{env,[]},
11+
{modules, []},
12+
13+
{licenses, ["Apache 2.0"]},
14+
{links, []}
15+
]}.

0 commit comments

Comments
 (0)