development_guide.md 2.28 KB
Newer Older
1 2 3 4 5 6 7 8
# Development Guide

## Prerequisite  

To build Cesium, you will have to: 
 
  - Installing build tools:
```
9
 sudo apt-get install git wget curl unzip build-essential software-properties-common ruby ruby-dev ruby-ffi gcc make
10 11
```

Martin Delille's avatar
Martin Delille committed
12
  - Installing [nvm](https://github.com/nvm-sh/nvm)
13
```
Martin Delille's avatar
Martin Delille committed
14
  wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
15 16
```

Martin Delille's avatar
Martin Delille committed
17 18
If you are using fish shell, there is a [dedicated plugin](https://github.com/jorgebucaran/fish-nvm).

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

21
  - Configure NodeJS to use a version 10: (**WARNING**: upper version will NOT work !) 
22
```
23
  nvm install 10
24 25
```
      
26
  - Installing node.js build tools, as global dependencies:
27
```
28
   npm install -g yarn gulp cordova ionic
29 30 31 32 33 34 35 36
```
   
## 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
37
  yarn
38 39 40 41 42 43 44 45 46 47 48
```

  - Installing Cordova plugins (need for platforms specific builds)   
```
  ionic state restore
```

- 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`
49
> - and be configured for NodeJs v6: `nvm use 6` (please check using the command `node --version`)
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67


## 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:
```
68
  npm start
69 70
```
 
71
> or alternative: `yarn run start` or `ionic serve` 
72 73 74 75 76 77 78 79

  - 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).