Skip to content

Commit

Permalink
chore: update build script
Browse files Browse the repository at this point in the history
  • Loading branch information
yyc12345 committed Jul 21, 2024
1 parent a7a5aec commit 56a1db5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 2 deletions.
16 changes: 16 additions & 0 deletions script/build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@ECHO OFF
ECHO This script must be executed at the root of project. Press any key to continue...
PAUSE
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 3.0" -y "J:\YYCCommonplace\bin\install"
MSBuild src\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86
python -m zipfile -c "E:\Virtools\Virtools Dev 3.0\InterfacePlugins\vtobjplugin_vt3.0.zip" "E:\Virtools\Virtools Dev 3.0\InterfacePlugins\vtobjplugin.dll" "E:\Virtools\Virtools Dev 3.0\InterfacePlugins\vtobjplugin.pdb"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 3.5" -y "J:\YYCCommonplace\bin\install"
MSBuild src\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86
python -m zipfile -c "E:\Virtools\Virtools Dev 3.5\InterfacePlugins\vtobjplugin_vt3.5.zip" "E:\Virtools\Virtools Dev 3.5\InterfacePlugins\vtobjplugin.dll" "E:\Virtools\Virtools Dev 3.5\InterfacePlugins\vtobjplugin.pdb"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 4.0" -y "J:\YYCCommonplace\bin\install"
MSBuild src\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86
python -m zipfile -c "E:\Virtools\Virtools Dev 4.0\InterfacePlugins\vtobjplugin_vt4.0.zip" "E:\Virtools\Virtools Dev 4.0\InterfacePlugins\vtobjplugin.dll" "E:\Virtools\Virtools Dev 4.0\InterfacePlugins\vtobjplugin.pdb"
python "script\setup_env.py" -p "E:\Virtools\Virtools Dev 5.0" -y "J:\YYCCommonplace\bin\install"
MSBuild src\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86
python -m zipfile -c "E:\Virtools\Virtools Dev 5.0\InterfacePlugins\vtobjplugin_vt5.0.zip" "E:\Virtools\Virtools Dev 5.0\InterfacePlugins\vtobjplugin.dll" "E:\Virtools\Virtools Dev 5.0\InterfacePlugins\vtobjplugin.pdb"
ECHO Build Done.
26 changes: 26 additions & 0 deletions script/build_build_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import os

def writeline(f, val: str) -> None:
f.write(val)
f.write('\n')

def main() -> None:
filename: str = os.path.join(os.path.dirname(__file__), 'build.bat')
with open(filename, 'w') as f: # not utf8 by design because it is BAT
# build script header
writeline(f, '@ECHO OFF')
writeline(f, 'ECHO This script must be executed at the root of project. Press any key to continue...')
writeline(f, 'PAUSE')

for ver in ('3.0', '3.5', '4.0', '5.0'):
vt_path: str = f'E:\Virtools\\Virtools Dev {ver}'
vt_interface_path: str = f'{vt_path}\InterfacePlugins'
writeline(f, f'python "script\\setup_env.py" -p "{vt_path}" -y "J:\\YYCCommonplace\\bin\\install"')
writeline(f, f'MSBuild src\\vtobjplugin.sln -p:Configuration=Release -p:Platform=x86')
writeline(f, f'python -m zipfile -c "{vt_interface_path}\\vtobjplugin_vt{ver}.zip" "{vt_interface_path}\\vtobjplugin.dll" "{vt_interface_path}\\vtobjplugin.pdb"')

# build script tail
writeline(f, 'ECHO Build Done.')

if __name__ == '__main__':
main()
2 changes: 1 addition & 1 deletion script/setup_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import argparse
import os

def main():
def main() -> None:
# define argument parser
parser = argparse.ArgumentParser(description='Virtools OBJ Exporter Build Environment Maker')
parser.add_argument(
Expand Down
2 changes: 1 addition & 1 deletion src/vtobjplugin.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets"/>
<PropertyGroup Label="UserMacros">
<VIRTOOLS_PATH>E:\Virtools\Virtools Dev 3.0</VIRTOOLS_PATH>
<VIRTOOLS_PATH>E:\Virtools\Virtools Dev 5.0</VIRTOOLS_PATH>
<YYCC_PATH>J:\YYCCommonplace\bin\install</YYCC_PATH>
</PropertyGroup>
<PropertyGroup/>
Expand Down

0 comments on commit 56a1db5

Please sign in to comment.