Advertisement
Guest User

WebWorks on Windows Build Script

a guest
Aug 31st, 2011
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. @ECHO OFF
  2. :Strip quotes
  3. SET APP=%APP:"=%
  4.  
  5. :Argument #2: the IP address of the simulator
  6. SET IP=%2
  7.  
  8. :Check if arguments set properly, if not, skip to error message at end of batch
  9. IF "%APP%"=="" GOTO VARSNOTSET
  10. IF "%IP%"=="" GOTO VARSNOTSET
  11.  
  12.  
  13. :Set various directory paths and build the path to SDK by finding it (so versions don't affect operation)
  14. :Set path to folder of execution
  15. cd /d %~dp0
  16.  
  17. SET RIM_FOLDER=C:\Program Files\Research In Motion
  18. SET DEV_DIR=%CD%
  19.  
  20. :Get the SDK folder by searching for WebWorks SDK
  21. DIR "%RIM_FOLDER%" /b | FIND "WebWorks SDK" > tmpFile
  22. SET /P BBWORKS_FOLDER=<tmpFile
  23. del tmpFile
  24.  
  25. SET SDK_PATH=%RIM_FOLDER%\%BBWORKS_FOLDER%
  26.  
  27. :Zip the folder
  28. cd %APP%
  29. ..\7zip\7za.EXE a -tzip -r "..\%APP%.zip" *.*
  30.  
  31. :Run the compiler and package to <app name>.bar
  32. cd %SDK_PATH%\bbwp
  33. bbwp "%DEV_DIR%\%APP%.zip" -o "%DEV_DIR%" -d
  34.  
  35. :Delete the zip file since all you need is bar
  36. del "%DEV_DIR%\%APP%.zip"
  37.  
  38. :Change to deploy utility directory and execute
  39. cd %SDK_PATH%\bbwp\blackberry-tablet-sdk\bin
  40. blackberry-deploy -installApp -password %PASSWORD% -device %IP% -package "%DEV_DIR%\%APP%".bar
  41. GOTO END
  42. :vARSNOTSET
  43. ECHO Error!
  44. ECHO You must enter an application folder to compile and run and the IP of the simulator
  45. ECHO e.g. At the DOS prompt, type: Test.bat "Sketchpad" 192.168.0.101
  46. pause
  47. :END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement