From e5b06832b760cf6842db04c371f551603a8ae197 Mon Sep 17 00:00:00 2001 From: aramis_acg Date: Thu, 12 Feb 2009 13:40:32 +0000 Subject: [PATCH] Committing batch scrips to build final release packages easily and error-free. git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@342 67173fc5-114c-0410-ac8e-9d2fd5bffc1f --- mkutil/bin_readme.txt | 1 + mkutil/clean.bat | 6 ++ mkutil/make_mingw.bat | 4 ++ mkutil/mkfinal.bat | 130 ++++++++++++++++++++++++++++++++++++++++++ mkutil/mkrev.bat | 28 +++++++++ mkutil/revision.h | 1 + 6 files changed, 170 insertions(+) create mode 100644 mkutil/bin_readme.txt create mode 100644 mkutil/clean.bat create mode 100644 mkutil/make_mingw.bat create mode 100644 mkutil/mkfinal.bat create mode 100644 mkutil/mkrev.bat create mode 100644 mkutil/revision.h diff --git a/mkutil/bin_readme.txt b/mkutil/bin_readme.txt new file mode 100644 index 000000000..8a13568cf --- /dev/null +++ b/mkutil/bin_readme.txt @@ -0,0 +1 @@ +to be filled \ No newline at end of file diff --git a/mkutil/clean.bat b/mkutil/clean.bat new file mode 100644 index 000000000..052a71e8d --- /dev/null +++ b/mkutil/clean.bat @@ -0,0 +1,6 @@ +cd ..\code +mingw32-make -f makefile.mingw clean + +cd .. +del /Q /S obj bin lib + diff --git a/mkutil/make_mingw.bat b/mkutil/make_mingw.bat new file mode 100644 index 000000000..a693a957f --- /dev/null +++ b/mkutil/make_mingw.bat @@ -0,0 +1,4 @@ +cd ..\code +mingw32-make -f makefile.mingw + +pause \ No newline at end of file diff --git a/mkutil/mkfinal.bat b/mkutil/mkfinal.bat new file mode 100644 index 000000000..5eadc2e48 --- /dev/null +++ b/mkutil/mkfinal.bat @@ -0,0 +1,130 @@ + +rem ----------------------------------------------------- +rem Batch file to build zipped redist packages +rem Two different packages are built: +rem +rem assimp---bin.zip +rem Binaries for x86 and x64 +rem Command line reference +rem +rem assimp---sdk.zip +rem Binaries for x86 and x64, Debug & Release +rem Libs for DLL build, x86 & 64, Debug & Release +rem Full SVN checkout exluding mkutil & port +rem +rem +rem PREREQUISITES: +rem -7za.exe (7zip standalone) +rem Download from http://www.7-zip.org/download.html +rem +rem -svnversion.exe (Subversion revision getter) +rem Download any command line SVN package +rem +rem -doxygen.exe (Doxygen client) +rem Download from www.doxygen.com +rem +rem NOTES: +rem ./bin must not have any local modifications +rem +rem ----------------------------------------------------- + +@echo off +color 4e +cls + +rem ----------------------------------------------------- +rem Setup file revision for build +rem ----------------------------------------------------- +call mkrev.bat + +rem ----------------------------------------------------- +rem Build output file names +rem ----------------------------------------------------- + +cd ..\bin +svnversion > tmpfile.txt +SET /p REVISIONBASE= < tmpfile.txt +DEL /q tmpfile.txt +cd ..\mkutil + +SET VERSIONBASE=1.0.%REVISIONBASE% + +SET OUT_SDK=assimp--%VERSIONBASE%-sdk +SET OUT_BIN=assimp--%VERSIONBASE%-bin + + +rem ----------------------------------------------------- +rem Delete previous output directories +rem ----------------------------------------------------- +RD /S /q final\ + +rem ----------------------------------------------------- +rem Create output directories +rem ----------------------------------------------------- + +mkdir final\%OUT_BIN%\x86 +mkdir final\%OUT_BIN%\x64 + +rem ----------------------------------------------------- +rem Copy all executables to 'final-bin' +rem ----------------------------------------------------- + +SET BINCFG_x86=release-dll_win32 +SET BINCFG_x64=release-dll_x64 + +copy /Y ..\bin\assimpview_%BINCFG_x86%\assimp_view.exe "final\%OUT_BIN%\x86\assimp_view.exe" +copy /Y ..\bin\assimpview_%BINCFG_x64%\assimp_view.exe "final\%OUT_BIN%\x64\assimp_view.exe" + +copy /Y ..\bin\assimpcmd_%BINCFG_x86%\assimp.exe "final\%OUT_BIN%\x86\assimp.exe" +copy /Y ..\bin\assimpcmd_%BINCFG_x64%\assimp.exe "final\%OUT_BIN%\x64\assimp.exe" + +copy /Y ..\bin\assimp_%BINCFG_x86%\Assimp32.dll "final\%OUT_BIN%\x86\Assimp32.dll" +copy /Y ..\bin\assimp_%BINCFG_x64%\Assimp64.dll "final\%OUT_BIN%\x64\Assimp64.dll" + +copy ..\LICENSE final\%OUT_BIN%\LICENSE +copy ..\CREDITS final\%OUT_BIN%\CREDITS +copy bin_readme.txt final\%OUT_BIN%\README +copy bin_readme.txt final\%OUT_BIN%\README + +copy ..\doc\AssimpCmdDOc_Html\AssimpCmdDoc.chm final\%OUT_BIN%\CommandLine.chm + +rem ----------------------------------------------------- +rem Do a clean export of the repository and build SDK +rem +rem We take the current revision and remove ./mkutil +rem and ./port. +rem ----------------------------------------------------- + +svn export .\..\ final\%OUT_SDK% +RD /s /q final\%OUT_SDK%\mkutil +RD /s /q final\%OUT_SDK%\port + +rem Copy doc to a suitable place +move final\%OUT_SDK%\doc\AssimpDoc_Html\AssimpDoc.chm final\%OUT_SDK%\Documentation.chm +move final\%OUT_SDK%\doc\AssimpCmdDoc_Html\AssimpCmdDoc.chm final\%OUT_SDK%\CommandLine.chm + +rem Cleanup ./doc folder +del /q final\%OUT_SDK%\doc\Preamble.txt +RD /s /q final\%OUT_SDK%\doc\AssimpDoc_Html +RD /s /q final\%OUT_SDK%\doc\AssimpCmdDoc_Html + +rem Insert 'dummy' files into empty folders +echo. > final\%OUT_SDK%\lib\dummy +echo. > final\%OUT_SDK%\obj\dummy + +rem ----------------------------------------------------- +rem Make final-bin.zip and final-sdk.zip +rem ----------------------------------------------------- + +IF NOT EXIST 7za.exe ( + cls + echo You need to have 7zip standalone installed to + echo build ZIP archives. Download: http://www.7-zip.org/download.html + pause +) else ( +7za.exe a -tzip "final\%OUT_BIN%.zip" ".\final\%OUT_BIN%\*" +7za.exe a -tzip "final\%OUT_SDK%.zip" ".\final\%OUT_SDK%\*" +) + +rem OK. We should have the release packages now. + diff --git a/mkutil/mkrev.bat b/mkutil/mkrev.bat new file mode 100644 index 000000000..f65b1cfdd --- /dev/null +++ b/mkutil/mkrev.bat @@ -0,0 +1,28 @@ +@echo off + +rem ----------------------------------------------------- +rem Tiny batch script to build the input file revision.h +rem revision.h contains the revision number of the wc. +rem It is included by assimp.rc. +rem ----------------------------------------------------- + +rem This is not very elegant, but it works. +rem ./bin shouldn't have any alocal modifications + +cd ..\bin +svnversion > tmpfile.txt +set /p addtext= < tmpfile.txt +del /q tmpfile.txt +cd ..\mkutil + +echo #define SVNRevision > revision.h + +if exist tmpfile.txt del /q tmpfile.txt +for /f "delims=" %%l in (revision.h) Do ( + echo %%l %addtext% >> tmpfile.txt +) +del /q revision.h +ren tmpfile.txt revision.h + + + diff --git a/mkutil/revision.h b/mkutil/revision.h new file mode 100644 index 000000000..73a951490 --- /dev/null +++ b/mkutil/revision.h @@ -0,0 +1 @@ +#define SVNRevision 335