generated from calcit-lang/dylib-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b71f818
Showing
10 changed files
with
391 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
calcit.cirru -diff linguist-generated | ||
Cargo.lock -diff linguist-generated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
pull_request: {} | ||
|
||
name: Test | ||
|
||
jobs: | ||
build_and_test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: ACTIONS_ALLOW_UNSECURE_COMMANDS | ||
id: ACTIONS_ALLOW_UNSECURE_COMMANDS | ||
run: echo 'ACTIONS_ALLOW_UNSECURE_COMMANDS=true' >> $GITHUB_ENV | ||
|
||
- name: add cr | ||
run: | | ||
mkdir -p $GITHUB_WORKSPACE/bin | ||
wget -O $GITHUB_WORKSPACE/bin/cr http://repo.calcit-lang.org/binaries/linux/cr | ||
chmod +x $GITHUB_WORKSPACE/bin/cr | ||
echo "::add-path::$GITHUB_WORKSPACE/bin" | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- run: cargo build --release | ||
|
||
- run: mkdir dylibs/ && ls target/release/ && cp -v target/release/*.* dylibs/ | ||
|
||
- run: cr -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
|
||
/target | ||
|
||
|
||
# Added by cargo | ||
# | ||
# already existing elements were commented out | ||
|
||
#/target | ||
|
||
.calcit-error.cirru | ||
.compact-inc.cirru | ||
|
||
/dylibs/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "calcit_std" | ||
version = "0.0.1" | ||
authors = ["jiyinyiyong <[email protected]>"] | ||
edition = "2018" | ||
|
||
[lib] | ||
name = "calcit_std" | ||
path = "src/lib.rs" | ||
crate-type = ["dylib"] # Creates dynamic lib | ||
|
||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
cirru_edn = "0.2.8" | ||
cirru_parser = "0.1.12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Workflow | ||
|
||
> Rust library for Calcit runtime. | ||
API 设计: https://github.com/calcit-lang/calcit_runner.rs/discussions/116 . | ||
|
||
### Usages | ||
|
||
APIs: | ||
|
||
```cirru | ||
lib.core/path-exists? a | ||
``` | ||
|
||
Install to `~/.config/calcit/modules/`, compile and provide `*.{dylib,so}` file with `./build.sh`. | ||
|
||
### Workflow | ||
|
||
https://github.com/calcit-lang/dylib-workflow | ||
|
||
### License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
cargo build --release | ||
mkdir -p dylibs/ && ls target/release/ && cp -v target/release/*.* dylibs/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
{} (:package |lib) | ||
:configs $ {} (:init-fn |lib.test/main!) (:reload-fn |lib.test/reload!) | ||
:modules $ [] | ||
:version |0.0.1 | ||
:files $ {} | ||
|lib.core $ {} | ||
:ns $ quote | ||
ns lib.core $ :require | ||
lib.$meta :refer $ calcit-dirname | ||
lib.util :refer $ get-dylib-path | ||
:defs $ {} | ||
|path-exists? $ quote | ||
defn path-exists? (name) | ||
&call-dylib-edn (get-dylib-path "\"/dylibs/libcalcit_std") "\"path_exists" name | ||
|lib.test $ {} | ||
:ns $ quote | ||
ns lib.test $ :require | ||
lib.core :refer $ path-exists? | ||
lib.$meta :refer $ calcit-dirname calcit-filename | ||
:defs $ {} | ||
|run-tests $ quote | ||
defn run-tests () (println "\"%%%% test for lib") (println calcit-filename calcit-dirname) | ||
println (path-exists? "\"README.md") (path-exists? "\"build.js") | ||
|main! $ quote | ||
defn main! () $ run-tests | ||
|reload! $ quote | ||
defn reload! $ | ||
|lib.util $ {} | ||
:ns $ quote | ||
ns lib.util $ :require | ||
lib.$meta :refer $ calcit-dirname calcit-filename | ||
:defs $ {} | ||
|get-dylib-ext $ quote | ||
defmacro get-dylib-ext () $ case-default (&get-os) "\".so" (:macos "\".dylib") (:windows "\".dll") | ||
|get-dylib-path $ quote | ||
defn get-dylib-path (p) | ||
str (or-current-path calcit-dirname) p $ get-dylib-ext | ||
|or-current-path $ quote | ||
defn or-current-path (p) | ||
if (blank? p) "\"." p |
Oops, something went wrong.