development_guide.md 2.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
# Development Guide

## Prerequisite  

To build Cesium, you will have to: 
 
  - Installing build tools:
```
 sudo apt-get install build-essential
```

  - Installing [nvm](https://github.com/creationix/nvm)
```
Benoit Lavenier's avatar
Benoit Lavenier committed
14
  wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
```

> Then reload your terminal, for instance by executing the commande `bash`

  - Configure NodeJS to use a version 5: (**WARNING**: upper version will NOT work !) 
```
  nvm install 5
```
      
  - Installing node.js build tools:
```
   npm install -g gulp bower@1.8.0 cordova@6.5.0 ionic@1.7.16
```
   
## Get the source code and dependencies
   
  - Getting source and installing project dependencies:    
```
  git clone git@git.duniter.org:clients/cesium-grp/cesium.git
  cd cesium
  npm install
```

  - Installing Cordova plugins (need for platforms specific builds)   
```
  ionic state restore
  ionic browser add crosswalk@12.41.296.5
```

- This should create a new directory `platforms/android`

> To remind: check that your command line is configured:
> - You must place yourself in the directory of the application: `cd cesium`
> - and be configured for NodeJs v5: `nvm use 5` (please check using the command `node --version`)


## Prepare environment, then compile and launch

 - To configure your build environment :
 
    * Add your environment config into `app/config.json`
   
    * Update default configuration, using the command:
    
```
  gulp config --env <your_env_name> 
```

> This will update the configuration file used by cesium, at `www/js/config.json`.
 
  - Compiling and running Cesium:
```
  npm start
```
 
> or alternative: `ionic serve` 

  - Open a web browser at address: [localhost:8100](http://localhost:8100). The application should be running.
  
## Best practices for development

 Cesium could be run on phone devices. Please read [performance tips on AgularJS + Ionic ](http://julienrenaux.fr/2015/08/24/ultimate-angularjs-and-ionic-performance-cheat-sheet/)
 before starting to contribute.
 Read also [Angular performance for large applicatoins](https://www.airpair.com/angularjs/posts/angularjs-performance-large-applications).