From 56a1db59c67fc14ea493428afc6788b05acb23d0 Mon Sep 17 00:00:00 2001 From: yyc12345 Date: Sun, 21 Jul 2024 16:22:03 +0800 Subject: [PATCH] chore: update build script --- script/build.bat | 16 ++++++++++++++++ script/build_build_script.py | 26 ++++++++++++++++++++++++++ script/setup_env.py | 2 +- src/vtobjplugin.props | 2 +- 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 script/build.bat create mode 100644 script/build_build_script.py diff --git a/script/build.bat b/script/build.bat new file mode 100644 index 0000000..401fc98 --- /dev/null +++ b/script/build.bat @@ -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. diff --git a/script/build_build_script.py b/script/build_build_script.py new file mode 100644 index 0000000..21f7778 --- /dev/null +++ b/script/build_build_script.py @@ -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() diff --git a/script/setup_env.py b/script/setup_env.py index 704ebea..f00a4fd 100644 --- a/script/setup_env.py +++ b/script/setup_env.py @@ -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( diff --git a/src/vtobjplugin.props b/src/vtobjplugin.props index 4c316ab..832ce8a 100644 --- a/src/vtobjplugin.props +++ b/src/vtobjplugin.props @@ -2,7 +2,7 @@ - E:\Virtools\Virtools Dev 3.0 + E:\Virtools\Virtools Dev 5.0 J:\YYCCommonplace\bin\install