Skip to content

Commit 661e12a

Browse files
committed
Added a build script and a python folder to store the dlib
1 parent 862fa16 commit 661e12a

6 files changed

Lines changed: 48 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ DerivedData/
66
.swiftpm/configuration/registries.json
77
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
88
.netrc
9+
.idea

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,38 @@ Adjust the paths, function names, and details as per your specific project setup
100100

101101

102102

103+
To do:
104+
- [ ] add a python folder
105+
- [ ] add a test folder
106+
- [ ] add the dlib build script
107+
- build to python folder
108+
- add readme
109+
- [ ] write python functions api
110+
- [ ] write tests with example files
111+
- [ ] create pypi package
112+
- [ ] add a build script
113+
- automatically run tests on push
114+
- automatically build new dlib on push
115+
- [ ] clean up code swift
116+
- [ ] clean up code python
117+
- [ ] update readme with new changes
118+
- explanation, separating between python and swift code
119+
- build, venv, run commands
120+
- pypi
121+
- running tests
122+
- [ ] merge to main
123+
124+
125+
126+
127+
128+
## Build Dynamic Library
129+
130+
The file `python_api/libLoopAlgorithmToPython.dylib` contains the dynamic library that is containing the C-embedded Swift functions.
131+
132+
After making changes in the Swift code, rebuild the dynamic library by running `chmod +x build.sh` followed by `./build.sh`.
133+
134+
135+
136+
103137

build.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
echo "Building dynamic c library from Swift code..."
4+
5+
# Run the Swift package commands to build the dynamic c library
6+
swift package clean
7+
swift build --configuration release
8+
9+
# Copy the dlib that got created and paste it into the python_api folder
10+
# Assuming the .dylib or .so file is located in the .build/release/ directory
11+
cp .build/release/libLoopAlgorithmToPython.dylib ./python_api/
12+
13+
echo "Library successfully copied to the python_api folder!"

python_api/__init__.py

Whitespace-only changes.

python_api/python_api.py

Whitespace-only changes.

python_tests/python_tests.py

Whitespace-only changes.

0 commit comments

Comments
 (0)