Skip to content

Commit

Permalink
Merge pull request #8 from mingaldrichgan/pre
Browse files Browse the repository at this point in the history
Add pre_build_script support
  • Loading branch information
melianmiko authored Jan 20, 2024
2 parents 9ea32d3 + 2984d78 commit ee57603
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ cd zmake

# Create and activate venv
python3.10 -m venv venv
source venv/bin/active
source venv/bin/activate

# Install deps and build
pip install -r requirements.txt
Expand Down
10 changes: 9 additions & 1 deletion zmake/project_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
]


@build_handler("Pre-build command")
def post_build(context: ZMakeContext):
if context.config.get("pre_build_script", "") == "":
return

subprocess.Popen([os.path.expanduser(context.config["pre_build_script"]), str(context.path)]).wait()


@build_handler("Prepare")
def prepare(context: ZMakeContext):
path_build = context.path / "build"
Expand Down Expand Up @@ -385,4 +393,4 @@ def post_build(context: ZMakeContext):
if context.config["post_build_script"] == "":
return

subprocess.Popen([context.config["post_build_script"], str(context.path)]).wait()
subprocess.Popen([os.path.expanduser(context.config["post_build_script"]), str(context.path)]).wait()
1 change: 1 addition & 0 deletions zmake/zmake.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"with_adb": false,
"adb_path": "/storage/emulated/0/Android/data/com.xiaomi.hm.health/files/watch_skin_local",

"pre_build_script": "",
"post_build_script": "",

"common_files": [],
Expand Down

0 comments on commit ee57603

Please sign in to comment.