StoreRevNum.bat 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. @ECHO OFF
  2. REM *************************************************************
  3. REM * Batch-File to store the revision number in source files. *
  4. REM * *
  5. REM * SubWCRev (located in tortoisesvn\bin) does the work: *
  6. REM * Param1 is the Path to the working copy *
  7. REM * Param2 is the Template file *
  8. REM * Param3 is the name of the Output file *
  9. REM *************************************************************
  10. REM *** Enable Command Extensions in order to use "FOR /R" syntax.
  11. REM *** Send invalid command to initialize ERRORLEVEL to non-zero.
  12. REM *** Send output to nul to avoid screen echo.
  13. VERIFY OTHER 2 > nul
  14. SETLOCAL ENABLEEXTENSIONS
  15. IF ERRORLEVEL 0 GOTO DoIt
  16. ECHO Command Extensions are not available!
  17. EXIT /B 1
  18. GOTO End
  19. :DoIt
  20. REM *** Set the Indy Lib path
  21. SET IndyLib="C:\Development\Projects\Indy\Indy 10\Source\Lib"
  22. REM *** Generate the files. Using "%%~dpnsI.tmpl" for the second
  23. REM *** parameter of SubWCRev.exe because "%%~fsI" erroneously
  24. REM *** produces "filename.tmplpl" instead of "filename.tmpl"
  25. REM *** as expected!
  26. IF (%2)==() GOTO UseIndyLib
  27. ECHO Scanning for Update Templates in %2
  28. FOR /R %2 %%I IN (*.tmpl) DO SubWCRev %IndyLib% "%%~dpnI.tmpl" "%%~dpnI"
  29. GOTO Done
  30. :UseIndyLib
  31. ECHO Scanning for Update Templates in %IndyLib%
  32. FOR /R %IndyLib% %%I IN (*.tmpl) DO SubWCRev %IndyLib% "%%~dpnI.tmpl" "%%~dpnI"
  33. :Done
  34. REM *** This Line re-compiles .res files from updated .rc files
  35. ECHO Rebuilding .RES files
  36. CALL %IndyLib%\buildres.bat
  37. :End