├── .editorconfig ├── .github ├── FUNDING.yml └── workflows │ ├── ci.yml │ └── docs.yml ├── .gitignore ├── .vscode ├── launch.json └── settings.json ├── LICENSE ├── Makefile ├── README.md ├── docs └── images │ └── dub-logo.png ├── dscanner.ini ├── dub.json ├── source └── wasmer │ ├── bindings │ ├── funcs.d │ ├── package.d │ └── wasmer.dpp │ └── package.d ├── thirdparty └── README.md └── views ├── footer.html ├── index.html └── nav.html /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | charset = utf-8 9 | indent_style = space 10 | indent_size = 2 11 | end_of_line = lf 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | 15 | # Tab indentation (no size specified) 16 | [{Makefile,*.Makefile}] 17 | indent_style = tab 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: [chances] # Up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: chances 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: wasmer-d CI 2 | 3 | on: push 4 | # schedule: 5 | # - cron: '0 0 * * SUN' 6 | 7 | jobs: 8 | test: 9 | name: Tests 10 | 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v1 15 | - name: Install D compiler 16 | uses: dlang-community/setup-dlang@v1 17 | with: 18 | compiler: ldc-latest 19 | - name: Cache DUB Artifacts (Posix) 20 | if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') 21 | uses: actions/cache@v2 22 | with: 23 | path: ~/.dub 24 | key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }} 25 | restore-keys: | 26 | ${{ runner.os }}-dub- 27 | - name: Cache DUB Artifacts (Windows) 28 | if: startsWith(runner.os, 'Windows') 29 | uses: actions/cache@v2 30 | with: 31 | path: ~\AppData\Local\dub 32 | key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }} 33 | restore-keys: | 34 | ${{ runner.os }}-dub- 35 | # - name: Install *nix Dependencies 36 | # if: startsWith(runner.os, 'Linux') 37 | # run: sudo apt-get install --quiet -y libglfw3 libglfw3-dev 38 | - name: Install Wasmer 39 | run: | 40 | curl https://get.wasmer.io -sSfL | WASMER_DIR=${HOME}/.wasmer sh 41 | echo 'WASMER_DIR=${HOME}/.wasmer' >> $GITHUB_ENV 42 | - name: Lint 43 | run: dub lint 44 | - name: Test 45 | run: make cover 46 | - name: Upload Coverage to Codecov 47 | if: success() 48 | run: bash <(curl -s https://codecov.io/bash) 49 | # - name: Integration Test 50 | # run: make hello-world 51 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | name: Documentation 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - uses: actions/checkout@v2 15 | - uses: FantasticFiasco/action-update-license-year@v2 16 | with: 17 | token: ${{ secrets.GITHUB_TOKEN }} 18 | path: | 19 | source/**/*.d 20 | dub.json 21 | LICENSE 22 | README.md 23 | # https://regex101.com/r/P3LblY/3 24 | # https://github.com/marketplace/actions/update-license-copyright-year-s#i-want-to-update-my-license-but-it-isnt-supported-by-this-action 25 | transform: (?<=[Copyright © |Copyright (c) |Copyright © ])(?\d{4})(-\d{4})?(?=[ \w.,"]*$) 26 | branchName: license/{{currentYear}} 27 | commitTitle: Update licensing dates for {{currentYear}} 28 | prTitle: Happy New Year! 🎉️ 29 | prBody: Update licensing copyright dates for {{currentYear}}. 30 | labels: documentation 31 | - name: Install D compiler 32 | uses: dlang-community/setup-dlang@v1 33 | with: 34 | compiler: dmd-latest 35 | - name: Cache DUB Artifacts 36 | uses: actions/cache@v2 37 | with: 38 | path: ~/.dub 39 | key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }} 40 | restore-keys: | 41 | ${{ runner.os }}-dub- 42 | - name: Install Wasmer 43 | run: | 44 | curl https://get.wasmer.io -sSfL | WASMER_DIR=${HOME}/.wasmer sh 45 | echo 'WASMER_DIR=${HOME}/.wasmer' >> $GITHUB_ENV 46 | 47 | - name: Build Documentation 48 | run: make docs 49 | 50 | - name: GitHub Pages 51 | if: success() && github.ref == 'refs/heads/master' 52 | uses: crazy-max/ghaction-github-pages@v2.1.2 53 | with: 54 | target_branch: gh-pages 55 | build_dir: docs 56 | keep_history: true 57 | env: 58 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 59 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Local Configuration 2 | .envrc 3 | 4 | # Compiled Object files 5 | *.o 6 | *.obj 7 | 8 | # Compiled Dynamic libraries 9 | *.so 10 | *.dylib 11 | *.dll 12 | 13 | # Compiled Static libraries 14 | *.a 15 | *.lib 16 | 17 | # Executables 18 | wasmer-test-library 19 | *.exe 20 | 21 | # DUB 22 | .dub 23 | dub.selections.json 24 | docs.json 25 | __dummy.html 26 | docs/ 27 | 28 | # Code coverage 29 | *.lst 30 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "lldb", 9 | "request": "launch", 10 | "name": "Debug Unit Tests", 11 | "program": "${workspaceFolder}/wasmer-test-library", 12 | "args": [], 13 | "cwd": "${workspaceFolder}", 14 | "env": { 15 | "LD_LIBRARY_PATH": "$WASMER_DIR/lib" 16 | } 17 | } 18 | ] 19 | } 20 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": [ 3 | "wasmer" 4 | ] 5 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020-2021 Chance Snow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | CWD := $(shell pwd) 2 | SOURCES := $(shell find source -name '*.d') 3 | TARGET_OS := $(shell uname -s) 4 | LIBS_PATH := lib 5 | 6 | .DEFAULT_GOAL := docs 7 | all: docs 8 | 9 | wasmer: $(WASMER_DIR)/lib/libwasmer.a 10 | @mkdir -p lib 11 | @cp $(WASMER_DIR)/lib/libwasmer.a lib/. 12 | .PHONY : wasmer 13 | 14 | source/wasmer/bindings/package.d: 15 | dub run dpp -- --preprocess-only --no-sys-headers --ignore-macros --include-path "/usr/lib/llvm-6.0/lib/clang/6.0.0/include" --include-path "$(WASMER_DIR)/include" source/wasmer/bindings/wasmer.dpp 16 | @mv source/wasmer/bindings/wasmer.d source/wasmer/bindings/package.d 17 | 18 | test: 19 | env LD_LIBRARY_PATH=$(WASMER_DIR)/lib dub test --parallel 20 | .PHONY: test 21 | 22 | cover: $(SOURCES) 23 | env LD_LIBRARY_PATH=$(WASMER_DIR)/lib dub test --parallel --coverage 24 | 25 | PACKAGE_VERSION := 0.2.0 26 | docs/sitemap.xml: $(SOURCES) 27 | dub build -b ddox 28 | @echo "Performing cosmetic changes..." 29 | # Page Titles & Favicon 30 | @sed -i "s/<\/title>/ - wasmer-d<\/title>/" `find docs -name '*.html'` 31 | # Navigation Sidebar 32 | @sed -i -e "/