-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from fraya/master
Create basic library structure Co-authored-by: @cgay
- Loading branch information
Showing
20 changed files
with
382 additions
and
23 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,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" |
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,38 @@ | ||
name: Build and test | ||
|
||
on: | ||
push: | ||
# all branches | ||
pull_request: | ||
# all branches | ||
|
||
# This enables the Run Workflow button on the Actions tab. | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Opendylan | ||
uses: dylan-lang/install-opendylan@v3 | ||
|
||
- name: Add zlib dev dependency | ||
run: sudo apt-get install -y zlib1g-dev | ||
|
||
- name: Download dependencies | ||
run: dylan update | ||
|
||
- name: Build tests | ||
run: dylan build zlib-test-suite | ||
|
||
- name: Run tests | ||
run: _build/bin/zlib-test-suite --progress none --report surefire > _build/TEST-zlib.xml | ||
|
||
- name: Publish Test Report | ||
if: success() || failure() | ||
uses: mikepenz/action-junit-report@v4 | ||
with: | ||
report_paths: '**/_build/TEST-*.xml' |
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,56 @@ | ||
name: Build and deploy documentation | ||
|
||
on: | ||
push: | ||
# all branches | ||
paths: | ||
- 'documentation/**' | ||
|
||
# This enables the Run Workflow button on the Actions tab. | ||
workflow_dispatch: | ||
|
||
# https://github.com/JamesIves/github-pages-deploy-action#readme | ||
permissions: | ||
contents: write | ||
|
||
# Set DYLAN environment variable to GITHUB_WORKSPACE so packages are | ||
# installed in ../../_packages relative to documentation's Makefile | ||
env: | ||
DYLAN: ${{ github.workspace }} | ||
|
||
jobs: | ||
|
||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check links | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/fraya/dylan-docs | ||
options: -v ${{ github.workspace }}/documentation:/docs | ||
run: make linkcheck | ||
|
||
- name: Build docs with Furo theme | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/fraya/dylan-docs | ||
options: -v ${{ github.workspace }}/documentation:/docs | ||
run: make html | ||
|
||
- name: Upload html artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: zlib-doc-html | ||
path: documentation/build/html/ | ||
|
||
- name: Bypassing Jekyll on GH Pages | ||
run: sudo touch documentation/build/html/.nojekyll | ||
|
||
- name: Deploy documents to GH pages | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: documentation/build/html |
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,11 @@ | ||
# Development directories | ||
|
||
/_build/ | ||
/_packages/ | ||
/registry/ | ||
|
||
# Backup files | ||
|
||
*~ | ||
|
||
/documentation/build/ |
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,20 @@ | ||
Copyright 2024 dylan-hackers | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
“Software”), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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,31 @@ | ||
Zlib | ||
==== | ||
|
||
Opendylan binding around Zlib library. | ||
|
||
Building | ||
-------- | ||
|
||
Install development libraries | ||
|
||
.. code-block:: console | ||
$ sudo apt install zlib1g-dev | ||
Download dependencies: | ||
|
||
.. code-block:: console | ||
$ dylan update | ||
Build: | ||
|
||
.. code-block:: console | ||
$ dylan build --all | ||
Run tests: | ||
|
||
.. code-block:: console | ||
$ _build/bin/zlib-test-suite |
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,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
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,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.https://www.sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
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,33 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
import sys, os | ||
sys.path.insert(0, os.path.abspath('../../_packages/sphinx-extensions/current/src/sphinxcontrib')) | ||
|
||
import dylan.themes as dylan_themes | ||
extensions = ['dylan.domain'] | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = [] | ||
|
||
primary_domain = 'dylan' | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'Zlib' | ||
copyright = '2024, Dylan Hackers' | ||
author = 'Dylan Hackers' | ||
release = '0.1.0' | ||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'furo' | ||
html_static_path = ['_static'] |
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 @@ | ||
Welcome to Zlib's documentation! | ||
================================ | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
:hidden: | ||
|
||
reference | ||
|
||
This is the beginning of a binding to the `Zlib | ||
<https://www.zlib.net/>`_ library. | ||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` |
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,33 @@ | ||
Reference | ||
========= | ||
|
||
.. current-library:: zlib | ||
.. current-module:: zlib | ||
|
||
Utility functions | ||
----------------- | ||
|
||
These functions are implemented on top of the basic zlib | ||
stream-oriented functions. To simplify the interface, some default | ||
options are assumed (compression level and memory usage). | ||
|
||
|
||
.. function:: compress | ||
|
||
Compress a string. | ||
|
||
:signature: compress *string* => (compressed-string) | ||
|
||
:parameter string: String to compress. An instance of :drm:`<string>` | ||
:value compressed-string: An instance of :drm:`<string>` | ||
|
||
:description: | ||
|
||
Compress the source string into a new string. If there is a problem | ||
in the compression process it raises an error. | ||
|
||
:example: | ||
|
||
.. code-block:: dylan | ||
let compressed = compress("Hello"); |
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,15 @@ | ||
{ | ||
"dependencies": [ ], | ||
"dev-dependencies": [ | ||
"testworks", | ||
"sphinx-extensions" | ||
], | ||
"description": "Bindings to Zlib library", | ||
"name": "zlib", | ||
"version": "0.1.0", | ||
"url": "https://github.com/dylan-lang/zlib", | ||
"keywords": [ "zlib", "binding" ], | ||
"contact": "[email protected]", | ||
"license": "MIT", | ||
"license-url": "https://opensource.org/license/mit" | ||
} |
This file was deleted.
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,26 @@ | ||
module: dylan-user | ||
define library zlib | ||
use common-dylan; | ||
use c-ffi; | ||
|
||
export | ||
zlib, | ||
zlib-impl; | ||
end library; | ||
|
||
define module zlib | ||
create | ||
compress; | ||
end module; | ||
|
||
define module zlib-impl | ||
use common-dylan; | ||
use c-ffi; | ||
|
||
use zlib; | ||
|
||
export | ||
zlib-compress, | ||
zlib-compress-bound; | ||
end module; |
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
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,5 @@ | ||
Library: zlib | ||
Target-Type: dll | ||
C-Libraries: -lz | ||
Files: library | ||
zlib |
Oops, something went wrong.