Permalink
Browse files

Source repo clean up

Change-Id: I13dcb1c53c3297c54eb7a72e640dd7c6922d86ca
  • Loading branch information...
0 parents commit 866c5f74a10a0133a097eccfea8c295a2c266684 @qingbiao qingbiao committed Oct 19, 2011
Showing 466 changed files with 60,023 additions and 0 deletions.
132 README.md
@@ -0,0 +1,132 @@
+# About BlackBerry® WebWorks™
+
+The BlackBerry® WebWorks™ for the BlackBerry Smartphone OS allows web and mobile web developers to use the SDK in combination with their development
+tooling of choice to develop, test and package up their web applications as BlackBerry WebWorks applications for smartphones.
+BlackBerry WebWorks applications can be distributed through the BlackBerry App World™ storefront and they run on the BlackBerry® Smartphones
+with access to the hardware.
+
+The project is open source under the [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) license.
+
+* Advanced Standards
+* Powerful Integration
+* Open
+
+[Read more](http://blackberry.github.com) about the BlackBerry WebWorks open source project
+
+## Downloads
+Full installers for Windows and Mac OS X can be found on the [product download page](http://developer.blackberry.com/html5/download/sdk)
+
+## Reference Material & Community
+You can also find associated reference material for the BlackBerry WebWorks platform as well as community forums for building and contributing to the BlackBerry WebWorks project
+
+* [API Reference](http://developer.blackberry.com/html5/api)
+* [Installation and Developer Guides](http://developer.blackberry.com/html5/documentation)
+* [Community Forums](http://supportforums.blackberry.com/t5/Web-Development/bd-p/browser_dev)
+* [Project Contributor Forums](http://supportforums.blackberry.com/t5/BlackBerry-WebWorks/bd-p/ww_con)
+* [Open Source Project Contributor Forums](http://supportforums.blackberry.com/t5/BlackBerry-WebWorks/bd-p/ww_con)
+
+## Building the Source Code
+
+### Download and install Maven on Windows®
+Note: In order to build the source code you must have the [Java SE Development Kit v1.6](http://java.sun.com/javase/downloads/index.jsp#jdk) or higher installed
+
+1. The first step is to [Download Maven v3.0](http://maven.apache.org/download.html) and create an installation directory.
+2. On the Maven download page, select the _(Binary zip)_ format of the latest Maven v3.0 from the mirror of your choice.
+3. When the download is finished, take the file and unzip it to the "C:\Program Files\Apache Software Foundation" directory. If the directory does not exist create it.
+4. The second step is to add environment variables. From the start menu right click on "My Computer" and click on properties. If you are on Windows XP click the advanced tab then click on environment variables. If you arer using Windows 7 click on advanced systems settings then click on environment variables.
+5. To add the first environment variable, look under system variables, click on the new button and enter "M2_HOME" (without the quotes) for the variable name and enter the path to your maven installation directory for the variable value e.g. C:\Program Files\Apache Software Foundation\apache-maven-(your version number). Click ok when you're done.
+6. Add a second environment variable with "M2" for the name and "%M2_HOME%\bin" (without the quotes) as the value.
+7. If JAVA_HOME is not listed as one of the variables under System Variables then add a new environment variable with "JAVA_HOME" as the name and the path to you JDK installation directory (not the bin folder) as the value.
+8. Click on the Path variable and click edit. Then add the following string to the end of value for path:
+
+ "%JAVA_HOME%\bin;%M2%"
+
+9. Open up a command prompt and type "mvn --version". _NOTE: If you already had a command prompt open, close it and open a new one so that your changes are reflected._ You should see some information about your maven installation. If you get a prompt stating that the command was not found then you probably made a mistake in one of the previous steps.
+
+### Download and install maven on Mac OSX
+
+Note: In order to build the source code you must have the Java Development Kit version 1.6 installed.
+
+
+#### Using MacPorts
+It is recommended to install Maven on OSX using MacPorts. If you do not currently have MacPorts you can install it from http://www.macports.org/install.php.
+
+1. Run the following command:
+
+ sudo port install maven3
+
+2. Run mvn --version to vertify that it is correctly installed.
+
+If you do not wish to use MacPorts simply use the following instructions.
+
+#### Without using MacPorts
+1. Extract the distribution archive, i.e. apache-maven-3.0.3-bin.tar.gz to the directory you wish to install Maven 3.0.3. These instructions assume you chose /usr/local/apache-maven. The subdirectory apache-maven-3.0.3 will be created from the archive.
+2. In a command terminal, add the M2_HOME environment variable, e.g. export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.3.
+3. Add the M2 environment variable, e.g. export M2=$M2_HOME/bin.
+4. Optional: Add the MAVEN_OPTS environment variable to specify JVM properties, e.g. export MAVEN_OPTS="-Xms256m -Xmx512m". This environment variable can be used to supply extra options to Maven.
+5. Add M2 environment variable to your path, e.g. export PATH=$M2:$PATH.
+6. Make sure that JAVA_HOME is set to the location of your JDK, e.g. export JAVA_HOME=/usr/java/jdk1.5.0_02 and that $JAVA_HOME/bin is in your PATH environment variable.
+7. Run mvn --version to verify that it is correctly installed.
+
+### Download and install gcc compiler on Windows®
+1. The first step is to download the automated installer for MinGW from
+[here.](http://sourceforge.net/projects/mingw/files/).
+2. After the installer has been downloaded run the installer. Follow the
+installation instructions in the installer and make sure you note the
+installation directory for MingGW which is C:\MinGW by default.
+3. When you have installed MinGW on your machine navigate to the
+environment variable settings as stated above when installing Maven on Windows.
+4. Find the Path environment variable and click the "Edit" button.
+5. Append ";(Path to MinGW)\bin" to the value of the environment varible e.g.
+if MinGW is installed at C:\MinGW then you should append ";C:\MinGW\bin" to the
+Path environment variable.
+
+### Download and install gcc compiler on Mac OS X
+
+#### Register for an Apple Developer Connection Account
+1. Navigate to [http://connect.apple.com](http://connect.apple.com). You will
+be taken to a page with a prompt for your Apple ID. Click the "Join Now" link.
+2. On the next page scroll down to the bottom of the page and click on the
+"Learn More" link. On the following page click on the "Get Started" link and
+follow the instructions for the Apple Developer Registration process.
+
+#### Download and Install XCode
+Once you're registered. Navigate to
+[http://connect.apple.com](http://connect.apple.com) and download the
+XCode Tools (Version) disk image file. Double click the file and
+follow the installations steps to complete the installation.
+
+### Build the project
+
+From command line, change to the root directory of the WebWorks repository and run the following commands:
+
+ mvn clean install -DPRODUCT_VERSION=[version]
+
+The version is the WebWorks version that you want to build (e.g. 2.3.0.1).
+The first time the build is run it will take up to 5 minutes to complete and will require an internet connection. Subsequent builds take around 2 minutes.
+
+If the build is successful two zip files will be generated in a "target" directory located in the root of the WebWorks repository.
+The Two zip files are "WebWorksForSmartphoneWin.zip" for Windows and "WebWorksForSmartphoneMac.zip" for Mac.
+
+
+## Patching an Existing WebWorks Installation
+
+1. Locate your existing WebWorks SDK installation. The default path is
+"C:\Program Files\Research In Motion\BlackBerry WebWorks SDK (Version)"
+for Windows and
+"/Developer/SDKs/Research In Motion/BlackBerry WebWorks SDK (Version)"
+for Mac.
+2. In your WebWorks installation directory backup and delete the following files/folders:
+ - "bbwp" executable file in root folder
+ - "bbwp.jar", "bbwp.properties", "tld.txt" in bin folder
+ - "device_templates" and "ext" folder
+3. The output of the build is stored in the target folder in the root
+directory. It contains two zip files, "WebWorksForSmartphoneWin.zip"
+for windows and "WebWorksForSmartphoneMac.zip" for Mac. Unzip the zip
+file for your platform into your installation directory.
+4. If you are using Windows, open up the backup "bin\bbwp.properties" file
+and copy the path located in the java element to the java element in the
+new "bin\bbwp.properties" file.
+5. You can now start building WebWorks applications with the patched SDK.
+
+
@@ -0,0 +1,8 @@
+*/build/
+*/bin/
+*/target/
+*/deliverables/
+*/.settings/
+/output/
+/target/
+/lib/
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>CommonAPI</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
@@ -0,0 +1,61 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <!-- The Basics -->
+ <parent>
+ <groupId>net.rim.webworks</groupId>
+ <artifactId>api</artifactId>
+ <version>2.3.0.0</version>
+ </parent>
+
+ <artifactId>CommonAPI</artifactId>
+ <packaging>pom</packaging>
+
+ <properties>
+ <api.source>${basedir}/sharedglobal</api.source>
+ <api.docs>${basedir}/../../api-docs/blackberry/app</api.docs>
+ <api.output.folder>${basedir}/../output/common/sharedglobal</api.output.folder>
+ </properties>
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.6</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <configuration>
+ <target>
+ <echo>Copying sharedglobal file to api output folder</echo>
+ <copy todir="${api.output.folder}">
+ <fileset dir="${api.source}" includes="*/**" />
+ </copy>
+ </target>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>findbugs-maven-plugin</artifactId>
+ <version>2.3.2-SNAPSHOT</version>
+ <configuration>
+ <threshold>Normal</threshold>
+ <xmlOutput>true</xmlOutput>
+ <findbugsXmlOutput>true</findbugsXmlOutput>
+ <findbugsXmlWithMessages>true</findbugsXmlWithMessages>
+ </configuration>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
@@ -0,0 +1,16 @@
+/*
+* Copyright 2010-2011 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+var SERVER_URL = "http://localhost:8472/";
@@ -0,0 +1,83 @@
+/*
+* Copyright 2010-2011 Research In Motion Limited.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+(function () {
+ this.blackberry = {};
+
+ var WebWorksLoader = function() {
+ this.loadedJs = {}; //hash of literal namespace - javascript constructor (can be either API or dispatcher, whichever is loaded first)
+ }
+
+ var isDispatcher = function(func) {
+ return (typeof(func) == 'function' && func.name.search(/dispatcher/i) > -1);
+ }
+
+ /*
+ Called by each API/dispatcher when it has finished loading. If its pair has already been loaded, it instantiates the API. Otherwise
+ stores the current half of the API and waits for the other one to load before instantiating.
+ */
+ WebWorksLoader.prototype.javascriptLoaded = function(ns, js) {
+ //Check if the other half of the API has loaded
+ if(typeof this.loadedJs[ns] == 'function') {
+ var api, dispatcher;
+ //If the function just loaded is the dispatcher, the one we have is the API, and vice-versa
+ if(isDispatcher(js)) {
+ api = this.loadedJs[ns];
+ dispatcher = js;
+ } else {
+ api = js;
+ dispatcher = this.loadedJs[ns];
+ }
+
+ this.loadApi(ns, api, dispatcher);
+ delete this.loadedJs[ns]; //remove namespace entry to prevent double loading
+ } else {
+ //Otherwise queue up and wait for API to load
+ this.loadedJs[ns] = js;
+ }
+ }
+
+ /*
+ Instantiates the provided API constructor with the provided dispatcher and attaches
+ the result to the requested namespace.
+ */
+ WebWorksLoader.prototype.loadApi = function(namespace, apiConstructor, dispatcher) {
+ //Instantiate the API
+ var d = (typeof dispatcher != 'undefined') ? new dispatcher() : {};
+ var api = new apiConstructor(d);
+
+ //Break namespace into array of parts around the '.'
+ var nsParts = namespace.split('.');
+ //Must start with 'blackberry'
+ if(nsParts[0] != 'blackberry') {
+ throw new Error('Namespace does not start with blackberry:' + namespace);
+ }
+
+ //Iterate over remaining namespace parts and create the empty namespace if it does not exist.
+ //If it exists, just ignore it.
+ var ns = blackberry;
+ for(var i = 1; i < nsParts.length - 1; i++) {
+ if(typeof ns[nsParts[i]] == 'undefined') {
+ ns[nsParts[i]] = {};
+ }
+ ns = ns[nsParts[i]];
+ }
+
+ //Once namespace is built, attach the object to it
+ ns[nsParts[nsParts.length - 1]] = api;
+ }
+
+ this.blackberry.Loader = new WebWorksLoader();
+})();
Oops, something went wrong.

0 comments on commit 866c5f7

Please sign in to comment.