There's several official ways for WebWorks developers to package their apps: Ripple (which I have personally never actually used) and the command line (my former favorite) being the big two. However, Tim Windsor from the BlackBerry Dev Relations team created what is, in my opinion, the best and easiest way to package and sign your WebWorks apps: the Ant Build Script.
If you want to skip the rest of this post and read Tim's excellent documentation on getting it all set up, just head over to https://github.com/blackberry/BB10-WebWorks-Community-Samples/tree/master/Ant-Build-Script. But if you're not convinced yet, read on.
First, why is the Ant Build Script awesome?
It's awesome because it lets you quickly and easily compile your apps via the command line in a variety of ways. Before I had the Ant Build Script, I'd write my app, add it to a zip, move it to a folder I set up for signing/packaging, open the command line, and type "bbwp c:/apps/AppName.zip -g mypassword -buildId 0"; if I wanted to say add web inspector, I'd have to add -d, and there were a few other operators that I've forgoten. Then I'd drag it to a sideloading bat to sideload it onto my BlackBerry.
With the Ant Build Script, all I have to do is open the command line tool in the app folder (shift+right click) and type "ant build" and my bar is compiled and sideloaded to my BlackBerry. That simple.
If that convinced you that the Ant Build Script is awesome (if it didn't, read it again), then here's how to get it set up:
1Download the Ant Build Script from https://github.com/blackberry/BB10-WebWorks-Community-Samples/tree/master/Ant-Build-Script and extract it to somewhere you don't mind keeping it.
2Open the buildTasks.xml (it's in the tools folder) with a program like Notepad++ and edit the variables you need, such as the location of your SDKs and your signing key password.
3Download Apache Ant from http://ant.apache.org/bindownload.cgi (you want the binary zip)
4Unzip Apache ant anywhere you want (I put it into the root of my C drive)
5Add Ant_Home to your System Variables
The easiest way to do this is to type "System Variables" into the Windows Search bar. You can also get to it by right clicking on the computer icon.Click the "New" Button.
For Variable Name, type ANT_BUILD For Variable Value, enter the directory of the Ant build folder. For me, that was C:/ApacheAnt
6Now, whenever you want to package a new app, copy the build.xml file from the Ant Build Script folder, edit it to suit your needs, and run "ant build"
That should be it! If you have any problems with my instructions, check out Tim's to see if he explained something better than I did, or email us here at OSBB to let us know.
Co-founder and legal nay-sayer of OSBB. Owner of SCrApps Application Development, WebWorks aficionado, Open Source contributor. SCrid2000 on most blogs. I build awesome BlackBerry apps when I'm not doing legal work or spending time with my wife and two boys.
Follow me on Twitter - @GShaneC
Check out my apps in BlackBerry WorldWebsite: SCrApps.org