Skip to content

Commit e70fa2e

Browse files
author
Shubham
committed
Allow building different package for OBX Sync
Include Sync libraries when building Sync package
1 parent 66f708b commit e70fa2e

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ build: ${VENV} clean ## Clean and build
2929
${PYTHON} setup.py bdist_wheel ; \
3030
ls -lh dist
3131

32+
build-sync: ${VENV} clean ## Clean and build
33+
set -e ; \
34+
OBX_BUILD_SYNC=1 ${PYTHON} setup.py bdist_wheel ; \
35+
ls -lh dist
36+
3237
${VENV}: ${VENVBIN}/activate
3338

3439
venv-init:
@@ -49,6 +54,10 @@ depend: ${VENV} ## Prepare dependencies
4954
set -e ; \
5055
${PYTHON} download-c-lib.py
5156

57+
depend-sync: ${VENV} ## Prepare dependencies
58+
set -e ; \
59+
${PYTHON} download-c-lib.py --sync
60+
5261
test: ${VENV} ## Test all targets
5362
set -e ; \
5463
${PYTHON} -m pytest --capture=no --verbose

download-c-lib.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
import tarfile
33
import zipfile
44
import os
5+
import sys
56

67
# Script used to download objectbox-c shared libraries for all supported platforms. Execute by running `make get-lib`
78
# on first checkout of this repo and any time after changing the objectbox-c lib version.
89

910
version = "v5.0.0" # see objectbox/c.py required_version
10-
variant = 'objectbox-sync' # or 'objectbox-sync'
11+
variant = 'objectbox' # or 'objectbox-sync'
12+
if len(sys.argv) > 1 and sys.argv[1] == '--sync':
13+
variant = 'objectbox-sync'
1114

1215
base_url = "https://github.com/objectbox/objectbox-c/releases/download/"
1316

setup.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1+
import os
2+
13
import setuptools
24
import objectbox
35

46
with open("README.md", "r") as fh:
57
long_description = fh.read()
68

9+
package_name = "objectbox"
10+
if "OBX_BUILD_SYNC" in os.environ:
11+
package_name = "objectbox-sync"
12+
713
setuptools.setup(
8-
name="objectbox",
14+
name=package_name,
915
version=str(objectbox.version),
1016
author="ObjectBox",
1117
description="ObjectBox is a superfast lightweight database for objects",

0 commit comments

Comments
 (0)