Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,23 @@ jobs:
if: ${{ matrix.unreal }}
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --install . --config $BUILD_TYPE --prefix comp_unreal --component unreal
- name: Upload UE
run: |
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.5"
cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_5 --component unreal
cmake $GITHUB_WORKSPACE -DINKCPP_UNREAL_TARGET_VERSION="5.4"
cmake --install . --config $BUILD_TYPE --prefix comp_unreal_5_4 --component unreal
- name: Upload UE 5.5
if: ${{ matrix.unreal }}
uses: actions/upload-artifact@v4
with:
name: unreal_5_5
path: build/comp_unreal_5_5/
- name: Upload UE 5.4
if: ${{ matrix.unreal }}
uses: actions/upload-artifact@v4
with:
name: unreal
path: build/comp_unreal/
name: unreal_5_4
path: build/comp_unreal_5_4/

# Make sure Inkproof has everything it needs to run our executable
- name: Setup Ink Proof
Expand Down Expand Up @@ -181,6 +191,13 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: install pyton libs
run: >-
python3 -m
pip install
pybind11-stubgen
pdoc
--user
- name: Install Doxygen
run: |
sudo apt-get install graphviz -y
Expand All @@ -198,11 +215,11 @@ jobs:
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: cmake $GITHUB_WORKSPACE -DINKCPP_PY=ON -DINKCPP_DOC_BlueprintUE=ON
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DINKCPP_PY=ON -DINKCPP_DOC_BlueprintUE=ON
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --target doc
run: cmake --build . --target doc --config Release
- name: Upload
uses: actions/upload-artifact@v4
with:
Expand All @@ -226,6 +243,8 @@ jobs:
python3 -m
pip install
build
pybind11-stubgen
pdoc
pytest
--user
- name: Build python release
Expand All @@ -247,7 +266,7 @@ jobs:
- name: Test python release
run: |
python3 -m pip install dist/*.whl --user
python3 -m pytest
python3 -m pytest inkcpp_python/tests
- name: Remove wheel
run: |
rm dist/*.whl
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
run: |
mkdir artifacts
ID=$(gh run list -b master --limit 1 --json databaseId | jq '.[0].databaseId')
gh run download $ID -D artifacts -n linux-cl -n linux-lib -n linux-clib -n unreal -n macos-cl -n macos-lib -n macos-clib -n macos-arm-cl -n macos-arm-lib -n macos-arm-clib -n win64-cl -n win64-lib -n win64-clib -n python-package-distribution
gh run download $ID -D artifacts -n linux-cl -n linux-lib -n linux-clib -n unreal_5_5 -n unreal_5_4 -n macos-cl -n macos-lib -n macos-clib -n macos-arm-cl -n macos-arm-lib -n macos-arm-clib -n win64-cl -n win64-lib -n win64-clib -n python-package-distribution
mv artifacts/python-package-distribution dist
- name: Zip
working-directory: ${{github.workspace}}/artifacts
run: |
for f in linux-cl linux-lib linux-clib unreal macos-cl macos-lib macos-clib macos-arm-cl macos-arm-lib macos-arm-clib win64-cl win64-lib win64-clib; do zip -r ../$f.zip $f; done
for f in linux-cl linux-lib linux-clib unreal_5_5 unreal_5_4 macos-cl macos-lib macos-clib macos-arm-cl macos-arm-lib macos-arm-clib win64-cl win64-lib win64-clib; do zip -r ../$f.zip $f; done
- name: List
run: tree
- name: Publish to PyPI
Expand All @@ -45,5 +45,5 @@ jobs:
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes \
"$tag" "linux-cl.zip" "linux-lib.zip" "linux-clib.zip" "unreal.zip" "macos-cl.zip" "macos-lib.zip" "macos-clib.zip" "win64-cl.zip" "macos-arm-cl.zip" "macos-arm-lib.zip" "macos-arm-clib.zip" "win64-lib.zip" "win64-clib.zip"
"$tag" "linux-cl.zip" "linux-lib.zip" "linux-clib.zip" "unreal_5_5.zip" "unreal_5_4.zip" "macos-cl.zip" "macos-lib.zip" "macos-clib.zip" "win64-cl.zip" "macos-arm-cl.zip" "macos-arm-lib.zip" "macos-arm-clib.zip" "win64-lib.zip" "win64-clib.zip"

4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
path = proofing/ink-proof
url = https://github.com/chromy/ink-proof.git
shallow = true
[submodule "inkcpp_py/pybind11"]
path = inkcpp_py/pybind11
[submodule "inkcpp_python/pybind11"]
path = inkcpp_python/pybind11
url = https://github.com/pybind/pybind11.git
branch = stable
shallow = true
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ set(CMAKE_TLS_VERIFY true)
enable_testing()

# Project setup
project(inkcpp VERSION 0.1.6)
project(inkcpp VERSION 0.1.7)
SET(CMAKE_CXX_STANDARD 20)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_INSTALL_LIBRARY_DIR lib)
Expand Down Expand Up @@ -57,7 +57,7 @@ endif()

if (INKCPP_PY)
add_compile_options(-fPIC)
add_subdirectory(inkcpp_py)
add_subdirectory(inkcpp_python)
endif(INKCPP_PY)
add_subdirectory(shared)
add_subdirectory(inkcpp)
Expand Down Expand Up @@ -154,10 +154,11 @@ if (DOXYGEN_FOUND)
COMPONENTS Interpreter
)
add_custom_target(inkcpp_py_doc
python -m pydoc -w inkcpp_py
COMMAND mv "./inkcpp_py.html" ${PY_HTML}
python -m pybind11_stubgen -o . inkcpp_py
COMMAND python -m pdoc -d google -o . inkcpp_py.pyi
COMMAND ${CMAKE_COMMAND} -E copy "./inkcpp_py.html" ${PY_HTML}
DEPENDS inkcpp_py
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inkcpp_py"
WORKING_DIRECTORY $<TARGET_FILE_DIR:inkcpp_py>
COMMENT "Generates simple python documentation")
add_dependencies(doc inkcpp_py_doc)
else()
Expand Down
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ Ink Proofing Test Results: https://jbenda.github.io/inkcpp/proof

Doxygen Documentation: https://jbenda.github.io/inkcpp/html

CLib Documentation: https://jbenda.github.io/inkcpp/html/group__clib.html

UE Documentation: https://jbenda.github.io/inkcpp/html/group__unreal.html

Python Documentation: https://jbenda.github.io/inkcpp/html/inkcpp_py.html

## Project Goals
* Fast, simple, clean syntax
* No heap allocations during execution (unless in emergencies)
Expand All @@ -17,6 +23,12 @@ Doxygen Documentation: https://jbenda.github.io/inkcpp/html

## Current Status

supported languages ([latest release](https://github.com/JBenda/inkcpp/releases/latest)):
+ C++ [doc](https://jbenda.github.io/inkcpp/html/index.html)[example](https://jbenda.github.io/inkcpp/html/index.html)
+ C [doc](https://jbenda.github.io/inkcpp/html/group__clib.html)[example](https://jbenda.github.io/inkcpp/html/group__clib.html#example_c)
+ UE Blueprints [doc](https://jbenda.github.io/inkcpp/html/group__unreal.html)[distribution](https://www.unrealengine.com/marketplace/product/inkcpp)[example](https://jbenda.github.io/inkcpp/html/group__unreal.html#ue_example)
+ Python [doc](https://jbenda.github.io/inkcpp/html/inkcpp_py.html)[distribution](https://pypi.org/project/inkcpp-py/)[example](https://jbenda.github.io/inkcpp/html/index.html#py)

Run `inkcpp_cl.exe -p myfile.json` to execute a compiled Ink JSON file in play mode. It can also operate on `.ink` files but `inklecate.exe` must be in the same folder or in the PATH.
`inklecate` can be downloaded from the [official release page](https://github.com/inkle/ink/releases) and will be downloaded from CMake at configure time (located at `build/unreal/inkcpp/Resources/inklecate`).
Or do it automatically with the `INKCPP_INKLECATE=OS` CMake flag. (It will be downloaded to `<build-dir>/inklecate/<os>/` and will be installed with `cmake --install . --component cl`)
Expand All @@ -39,9 +51,18 @@ Place the content of this file at your plugin folder of your UE project and at t

A example project can be found [here](https://jbenda.github.io/inkcpp/unreal/InkCPP_DEMO.zip). And here the [Documentation](https://jbenda.github.io/inkcpp/html/group__unreal.html).

Code for the Unreal plugin is located in the `unreal` directory. In order to install it, run `cmake --install . --component unreal --prefix Path/To/Unreal/Plugins/` which will add an `inkcpp` folder there with the `.uplugin`, the code for the UClasses, and all the inkcpp source files required. `config.h` will automatically detect it is being built in an Unreal plugin environment and disable STL and enable Unreal extensions (FString support, Unreal asserts, CityHash, etc.).

If you compile the UE Plugin by your self feel free to visit the [wiki page](https://github.com/JBenda/inkcpp/wiki/Unreal) for a more debug oriented build process.
Code for the Unreal plugin is located in the `unreal` directory. In order to install it, run
```sh
mkdir build
cd build
mkdir plugin
mkdir plugin-build
cmake -DINKCPP_UNREAL_TARGET_VERSION="5.5" .
cmake --install . --component unreal --prefix .\plugin # create source files for plugin
\PATH\TO\UNREAL_ENGINE\Build\BatchFiles\RunUAT.bat BuildPlugin -plugin=GIT_REPO\build\plugin\inkcpp\inkcpp.uplugin -package=GIT_REPO\build\plugin-build\inkcpp -TargetPlatforms=Win64 # compile plugin
move plugin-build\inkcpp UE_ENGINE\Engine\Plugins\inkcpp
```
Adapt `TargetPlatforms` as nessesarry. You might also want to install the Plugin directly into a project or the in UE5.5 introduced external plugin directory. Just adapt the pathets accordendly.

## Use standalone

Expand Down Expand Up @@ -165,7 +186,7 @@ python -m pip install dist/*.whl --user
# if inklecate is not in the same directory / inside Path set INKLECATE enviroment variable
export INKLECATE=<PATH-TO-inklecate> # unix
set INKLECTATE=<PATH-TO-inklecate> # windows
python -m pytest
python -m pytest inkcpp_python/tests
```

Right now this only executes the internal unit tests which test the functions of particular classes. Soon it'll run more complex tests on .ink files using ink-proof.
Expand All @@ -174,15 +195,15 @@ Right now this only executes the internal unit tests which test the functions of
## Python Bindings

The easy way to start is installing it with pip: `pip install inkcpp_py`.
An example can be found at [example.py](./inkcpp_py/example.py).
An example can be found at [example.py](./inkcpp_python/example.py).
To build it from source use:

```sh
git clone --recurse-submodules https://github.com/JBenda/inkcpp.git
pip install .
```

The python bindnigs are defined in `inkcpp_py` subfolder.
The python bindnigs are defined in `inkcpp_python` subfolder.

## Dependencies
The compiler depends on Nlohmann's JSON library and the C++ STL.
Expand Down
7 changes: 4 additions & 3 deletions inkcpp/include/story.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ class story
* + INKCPP_TEST: (ON|OFF) weather or not execute tests
* requires `inklecate` to be in the PATH or `INKCPP_INKLECATE=OS` or `=ALL`
* + INKCPP_INKLECATE: (NONE|OS|ALL) download the current supported inklecate version from the
* official [release page](https://github.com/inkle/ink/releases/latest)</br> They are stored at
* official [release page](https://github.com/inkle/ink/releases/latest)<br/> They are stored at
* `<build-dir>/inklecate/<os>/` and will be automatcilly used for the tests
* + NONE: disable this function
* + OS: only the version supported for the OS
Expand Down Expand Up @@ -212,8 +212,9 @@ class story
* `pip install .`
*
* Here can you find an
* [example](https://raw.githubusercontent.com/JBenda/inkcpp/master/inkcpp_py/example.py) inclusive
* [story](https://raw.githubusercontent.com/JBenda/inkcpp/master/inkcpp_py/unreal_example.ink).
* [example](https://raw.githubusercontent.com/JBenda/inkcpp/master/inkcpp_python/example.py)
* inclusive
* [story](https://raw.githubusercontent.com/JBenda/inkcpp/master/inkcpp_python/unreal_example.ink).
*
* [Python module documentation](./inkcpp_py.html)
*/
1 change: 0 additions & 1 deletion inkcpp_py/pybind11
Submodule pybind11 deleted from 8b03ff
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions inkcpp_python/pybind11
Submodule pybind11 added at 0c69e1
Loading
Loading