Commit 478070fd authored by Benoit Lavenier's avatar Benoit Lavenier

[enh] Add documentation for build web-ext and web artifacts

parent 3e78133c
# Android Builds
# Build Cesium for Android
Cesium can be build as Android App.
Cesium can be build as an Android App.
Cesium use [Ionic Framework v1.7.16](http://ionicframework.com/docs/v1/) with some Apache Cordova plugins.
......
# Build Cesium as a Desktop application
Cesium can be build as a standalone desktop application, for Linux (`.deb`), Windows (`.exe`) or MacOSx;
- Clone the [cesium-desktop](https://git.duniter.org/clients/cesium-grp/cesium-desktop) project locally;
- Follow this project documentation.
# Cesium docker image
> WARNING: This documentation need a review! (not up to date)
## Build
```bash
......
# iOS Builds
# Build Cesium for iOS
Cesium can be build as desktop application for iOS. .
......
# Build Cesium as an unhosted web application
Cesium can be build as a simple web application, portable and runnable anywhere.
## Prerequisites
### Install the development environment
Follow all the steps defined in the [Development guide](./development_guide.md).
After that you should be able to start the application using `npm start`or `yarn run start`, and to test it.
## Build the unhosted web application
- To create a compressed ZIP artifact, run:
```bash
cd cesium
gulp webBuild --release
```
A ZIP archive will be visible `dist/web/build/cesium-vx.y.z.zip`
## Publishing to a web site
Uncompress the web archive, then open the `ìndex.html` file in your web browser.
\ No newline at end of file
# Build Cesium as a Web extension
Cesium can be build as Web extension, for Mozilla Firefox extension (`.xpi`) and Chrome/Chromium (`.crx`).
## Prerequisites
### Install the development environment
Follow all the steps defined in the [Development guide](./development_guide.md).
After that you should be able to start the application using `npm start`or `yarn run start`, and to test it.
## Build the web extension
- To create a uncompressed extension, use :
```bash
cd cesium
gulp webExtensionCopyFiles --release
```
The uncompressed web extension will be visible `dist/web/ext`
- To create a portable and compressed ZIP extension :
```bash
cd cesium
gulp webExtBuild --release
```
The web extension is visible at `dist/web/build/cesium-vx.y.z-extension.zip`
> Remove the option `--release` to skip creation of minified CSS and JS files (and source maps)
## Publishing to Mozilla Addons
- Make sure you have `web-ext` installed. If not, run:
```bash
npm install -g web-ext
```
- Sign your extension :
```bash
# Define your credentials on addons.mozilla.org (your developer account)
export AMO_JWT_ISSUER = // username
export AMO_JWT_SECRET = // password
# Will archive and upload your extension
cd cesium
web-ext sign "--api-key=${AMO_JWT_ISSUER}" "--api-secret=${AMO_JWT_SECRET}" "--source-dir=dist/web/ext" "--artifacts-dir=${PROJECT_DIR}/dist/web/build" --id=${WEB_EXT_ID} --channel=listed
```
\ No newline at end of file
......@@ -4,76 +4,103 @@
To build Cesium, you will have to:
- Installing build tools:
```
sudo apt-get install git wget curl unzip build-essential software-properties-common ruby ruby-dev ruby-ffi gcc make
```
1. Installing build tools:
```bash
sudo apt-get install git wget curl unzip build-essential software-properties-common ruby ruby-dev ruby-ffi gcc make
```
- Installing [nvm](https://github.com/nvm-sh/nvm)
```
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
```
2. Installing node.js v10 :
If you are using fish shell, there is a [dedicated plugin](https://github.com/jorgebucaran/fish-nvm).
* First, install [nvm](https://github.com/nvm-sh/nvm) (Node Version Manager) :
```bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
```
> Then reload your terminal, for instance by executing the commande `bash`
> Alternatively, if you are using `fish shell`, there is a [dedicated plugin](https://github.com/jorgebucaran/fish-nvm).
- Configure NodeJS to use a version 10: (**WARNING**: upper version will NOT work !)
```
nvm install 10
```
* Then, reload your terminal (for instance by executing the command `bash`);
* Configure nvm to use the expected version: (**WARNING**: upper version will NOT work !)
```bash
nvm install 10
```
- Installing node.js build tools, as global dependencies:
```
npm install -g yarn gulp cordova ionic
```
3. Installing node build tools, as global dependencies:
```bash
npm install -g yarn gulp cordova ionic
```
## 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
yarn
```
- Installing Cordova plugins (need for platforms specific builds)
```
ionic cordova preapre
```
1. Getting the source code:
```bash
git clone git@git.duniter.org:clients/cesium-grp/cesium.git
```
2. Install project dependencies:
```bash
cd cesium
yarn install
```
- This should create a new directory `platforms/android`
3. Installing Cordova plugins (required to build Android and iOS artifacts):
```bash
ionic cordova preapre
```
> 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 v6: `nvm use 6` (please check using the command `node --version`)
This should create new directories `platforms/android` and `platforms/ios`.
> 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 v10: `nvm use 10` (please check using the command `node --version`)
## Prepare environment, then compile and launch
## Prepare Cesium default config
- To configure your build environment :
Configure Cesium default settings :
* Add your environment config into `app/config.json`
1. Add your environment config into `app/config.json`
* Update default configuration, using the command:
```
gulp config --env <your_env_name>
```
2. Update default configuration, using the command:
```bash
gulp config --env <your_env_name>
```
> This will update the configuration file used by cesium, at `www/js/config.json`.
This will update a configuration file `www/js/config.json`.
- Compiling and running Cesium:
```
npm start
## Compile and launch
To compile and launch Cesium, run :
```bash
yarn run start
```
> or alternative: `yarn run start` or `ionic serve`
- Open a web browser at address: [localhost:8100](http://localhost:8100). The application should be running.
## Best practices for development
or alternative: `npm start` or `ionic serve`
The application should be running at [localhost:8100](http://localhost:8100)!
## Build artifacts
Cesium can be build:
- [as an unhosted web applicationa](build_web.md);
- [for Android](build_android.md);
- [for iOS](build_ios.md);
- [as a Web extension](build_web_extension.md) for Mozilla Firefox or Chrome/Chomium;
- [as a Desktop application](build_desktop.md) for Linux (`.deb`), Windows and MacOSx;
You may also [use Docker image](./build_docker.md) to simplify this task;
## Time to code !
### Pull request
For each pull request, please create a issue first.
### 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.
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).
Read also [Angular performance for large applicatoins](https://www.airpair.com/angularjs/posts/angularjs-performance-large-applications).
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment