Skip to content

Latest commit

 

History

History
137 lines (94 loc) · 4.37 KB

HACKING.md

File metadata and controls

137 lines (94 loc) · 4.37 KB

INITIAL SET UP

To run the build, you'll need to install some node modules. Run the following in the top-level directory of the project:

npm install

grunt requires that you install grunt-cli globally to be able to use grunt from the command line. To install grunt-cli do:

npm install -g grunt-cli

You should then install the client-side dependencies into app/lib/:

npm install -g bower bower install

Note that if you want to install the application to a Tizen device as a wgt file, you will also need to install the sdb tool first. This is available for various platforms from http://download.tizen.org/tools/latest-release/.

Configure your package manager to use the appropriate repo from the ones available and install sdb, e.g. for Fedora 17:

$ REPO=http://download.tizen.org/tools/latest-release/Fedora_17/tools.repo
$ sudo yum-config-manager --add-repo $REPO
$ sudo yum install sdb

WHERE'S THE APP?

There are a few options for running the application:

  • Open app/index.html in a browser (there's no requirement to run a build before you can run the app).

  • Serve the app from a standard web server. First, run:

    grunt dist
    

    Then copy the content of the build/app/ directory to a web folder for your server (e.g. an Apache htdocs directory).

  • Run the app using the built-in local server:

    grunt server
    

    This builds the dist version of the app and runs it on a server accessible at http://localhost:30303/. This is useful for testing the app in a mobile device: just navigate to the server hosting the app, using the phone's browser.

  • Install/reinstall to an attached Tizen device via sdb by running:

    grunt wgt-install
    

    This installs an optimised version of the app (minified HTML, minified and concatenated CSS and JS).

  • Install an SDK-specific version of the app (no minification or concatenation) with:

    grunt sdk-install
    
  • Build the files for the Chrome extension with:

    grunt crx
    

    then load the build/crx directory as an unpacked extension in Chrome developer mode. (The build can't currently make full .crx packages.)

PACKAGING

The application can be packaged into a wgt (zip) file using the grunt command:

grunt wgt

This will generate a package in the build/ directory.

It can also be packaged into an SDK wgt file (with uncompressed JS, CSS, and HTML) using:

grunt sdk

Note that in both cases, the files comprising the packages are first copied into the build/wgt and build/sdk directories respectively.

To create packages for Android use the 'apk' target:

grunt apk

This will first build an 'xpk' target and then package two apks in build/ named AppName_{x86,arm}.apk. You can then install the appropriate one to your device as usual - for example, adb install -r build/AppName_x86.apk. There are also targets to create packages just for a single architecture. They require the 'xpk' target to be build previously :

grunt xpk
grunt crosswalk:x86

or :

grunt xpk
grunt crosswalk:arm

Packaging for Android requires some set up - please see crosswalk-apk-generator README.md.

GUIDE FOR MS WINDOWS USERS AND TIZEN IDE

Here are some steps to help people wishing to generate code for use in the Tizen IDE on Microsoft Windows.

  1. install git
  2. get admin shell
  3. click start
  4. in ‘search’ type ‘command’ - don’t hit return/enter
  5. ‘command prompt’ appears under ‘programs’ - right click on it and select ‘run as administrator’ - click ‘yes’ if it asks for confirmation
  6. install grunt - type ‘npm install -g grunt’
  7. install bower - type ‘npm install -g bower’
  8. close admin shell
  9. right click on desktop and select ‘git bash’
  10. change directory to where you want your projects to go (or don’t, if Desktop is ok)
  11. clone the repository, eg ‘git clone https://github.com/01org/webapps-annex.git’
  12. cd webapps-annex
  13. npm install
  14. bower install
  15. grunt sdk
  16. the project is now built in build/sdk and can be imported into the IDE
  17. launch Tizen IDE
  18. File->New->Tizen Web Project
  19. select all the files in the project and delete them
  20. File->Import…->General->File System Next
  21. “From directory” <- the build/sdk directory
  22. “Into folder” <- the project you created in the IDE
  23. Finish