-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathmake.ps1
35 lines (26 loc) · 1.68 KB
/
make.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Tip: add argument `run` to directly run after build for fast testing
# Write a message to the console indicating that we are creating a Python Wheel package using Poetry
Write-Output 'Creating Python Wheel package via Poetry'
# Call the Poetry executable with the `build` and `-f wheel` arguments to create a wheel package
# The `&` symbol is used to call an external program or script
& 'poetry' build -f wheel
# Write a message to the console indicating that we are building a self-contained folder/app using PyInstaller
Write-Output 'Building to self-contained folder/app via PyInstaller'
# Call the Poetry executable with the `run` argument and the `python pyinstaller.py` command to build the app
# The `pyinstaller.py` script should contain the necessary PyInstaller commands to build the app
& 'poetry' run python pyinstaller.py
# Check if the first argument passed to the script is `run`
if ($args[0] -eq 'run') {
# If the `run` argument is present, call the built executable with the remaining arguments
# The `Select-Object -Skip 1` command is used to skip the `run` argument and pass only the remaining arguments
& 'dist/vinetrimmer/vinetrimmer.exe' ($args | Select-Object -Skip 1)
# Exit the script to prevent further execution
exit
}
# Write a message to the console indicating that we are creating a Windows installer using Inno Setup
Write-Output 'Creating Windows installer via Inno Setup'
# Call the Inno Setup compiler with the `setup.iss` script to create the installer
& 'iscc' setup.iss
# Write a message to the console indicating that the build process is complete
# The output files can be found in the `/dist` folder
Write-Output 'Done! See /dist for output files.'