Skip to content
Snippets Groups Projects
README.md 5.08 KiB
Newer Older
mathias.chouet's avatar
mathias.chouet committed
# ngHyd - Angular application for Hydraulics using JaLHyd library
francois.grand's avatar
francois.grand committed

mathias.chouet's avatar
mathias.chouet committed
See also [developers documentation](DEVELOPERS.md) (in french)
francois.grand's avatar
francois.grand committed

mathias.chouet's avatar
mathias.chouet committed
## Build and deploy
francois.grand's avatar
francois.grand committed

mathias.chouet's avatar
mathias.chouet committed
### Requirements

 * [jalhyd](https://gitlab.irstea.fr/cassiopee/jalhyd)
 * nodejs
 
Building the documentation requires MkDocs and some extensions:
sudo apt install python3-pip python3-setuptools
python3 -m pip install mkdocs python-markdown-math mkdocs-material
mathias.chouet's avatar
mathias.chouet committed
### Install dependencies
mathias.chouet's avatar
mathias.chouet committed
#### JaLHyd
Clone JalHyd next to ngHyd, for ex. respectively in `/home/foo/jalhyd` and `/home/foo/nghyd`.
mathias.chouet's avatar
mathias.chouet committed
In `jalhyd` folder, run :
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run package
```
mathias.chouet's avatar
mathias.chouet committed
#### other dependencies
Then in `nghyd` folder, run :
francois.grand's avatar
francois.grand committed

mathias.chouet's avatar
mathias.chouet committed
```sh
npm install
```
francois.grand's avatar
francois.grand committed

mathias.chouet's avatar
mathias.chouet committed
### Compile and get a deployable Web app

```sh
npm run build
```
francois.grand's avatar
francois.grand committed


mathias.chouet's avatar
mathias.chouet committed
### Compile in dev (watch) mode
francois.grand's avatar
francois.grand committed

mathias.chouet's avatar
mathias.chouet committed
```sh
npm start
```
francois.grand's avatar
francois.grand committed


mathias.chouet's avatar
mathias.chouet committed
### Run end-to-end unit tests
francois.grand's avatar
francois.grand committed

mathias.chouet's avatar
mathias.chouet committed
```sh
npm run e2e
```
mathias.chouet's avatar
mathias.chouet committed
### Quickly run end-to-end unit tests while watch mode is running
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run e2equick
```
mathias.chouet's avatar
mathias.chouet committed
### Quickly try electron wrapping when code is already compiled
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run electron
```
mathias.chouet's avatar
mathias.chouet committed
### Build a desktop release for Linux (from Linux platform)
mathias.chouet's avatar
mathias.chouet committed
#### build Debian package
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run release-linux
```
mathias.chouet's avatar
mathias.chouet committed

Find the .deb package in `/release`.

Running `dpkg -i cassiopee_*.deb` will install Cassiopée in `/opt/Cassiopee`

mathias.chouet's avatar
mathias.chouet committed
### Build a desktop release for Windows (from Linux platform)

#### install dependencies
 * wine >= 2.0 - see https://wiki.winehq.org/Download#binary

#### build .exe installer

mathias.chouet's avatar
mathias.chouet committed
```sh
npm run release-windows
```

Find the generated installer in `/release`.

Running the generated installer will install Cassiopée in `C:\Users\YourUser\AppData\local\Programs\cassiopee`


mathias.chouet's avatar
mathias.chouet committed
### Build a desktop release for Windows (from Windows platform)
mathias.chouet's avatar
mathias.chouet committed

#### install dependencies
 * python for windows https://www.python.org/downloads/windows/
mathias.chouet's avatar
mathias.chouet committed
    * tick "add to path" option when installing
mathias.chouet's avatar
mathias.chouet committed
 * mkdocs: `pip install mkdocs`
 * mkdocs-material: `pip install mkdocs-material`
 * python-markdown-math: `pip install https://github.com/mitya57/python-markdown-math/archive/master.zip`
mathias.chouet's avatar
mathias.chouet committed
 * pygments: `pip install pygments`
mathias.chouet's avatar
mathias.chouet committed

#### build .exe installer

mathias.chouet's avatar
mathias.chouet committed
```sh
npm run release-windows
```
mathias.chouet's avatar
mathias.chouet committed

Find the generated installer in `/release`.

Running the generated installer will install Cassiopée in `C:\Users\YourUser\AppData\local\Programs\cassiopee`


mathias.chouet's avatar
mathias.chouet committed
### Build a desktop release for MacOS (from Linux platform)
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run release-mac
```

Find the generated package in `/release`.

Note: the generated package will not be signed.


mathias.chouet's avatar
mathias.chouet committed
### Build a mobile release for Android (from Linux platform)
mathias.chouet's avatar
mathias.chouet committed

#### install dependencies
mathias.chouet's avatar
mathias.chouet committed
 * java - `apt install openjdk-8-jdk` or `apt install oracle-java8-jdk`
 * gradle - `apt install gradle`
mathias.chouet's avatar
mathias.chouet committed

#### install Android Studio and SDKs

mathias.chouet's avatar
mathias.chouet committed
Download Android Studio here and install it : https://developer.android.com/studio

Run Android Studio, click "configure > SDK manager". Install at least one SDK, for ex. 7.0 Nougat.

#### using CLI

mathias.chouet's avatar
mathias.chouet committed
Download Android SDK Tools from https://developer.android.com/studio : click "DOWNLOAD OPTIONS" then scroll down to "Command line tools only" and choose `sdk-tools-linux-*.zip`.

Download and unzip to, for example, `/opt/android/`.

Add `/opt/android/tools/bin` to your PATH.

Install an SDK, for example android 28 (Android 9 "Pie") :
mathias.chouet's avatar
mathias.chouet committed

```sh
sdkmanager "platform-tools" "platforms;android-28" "build-tools;28.0.3"
```
mathias.chouet's avatar
mathias.chouet committed

#### build .apk package

mathias.chouet's avatar
mathias.chouet committed
```sh
npm run release-android
```
mathias.chouet's avatar
mathias.chouet committed

Find the generated package in `/release`.

Note: the generated package will not be signed.

mathias.chouet's avatar
mathias.chouet committed
### Generate HTML documentation
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run mkdocs
```
mathias.chouet's avatar
mathias.chouet committed
### Create PDF documentation from HTML documentation
mathias.chouet's avatar
mathias.chouet committed
```sh
 sudo apt-get install texlive texlive-lang-french texlive-latex-extra pandoc
```
mathias.chouet's avatar
mathias.chouet committed
```sh
python3 mkdocs2pdf.py
```
mathias.chouet's avatar
mathias.chouet committed
### Generate compodoc
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run compodoc
```
mathias.chouet's avatar
mathias.chouet committed
### Flag suspicious language usage
mathias.chouet's avatar
mathias.chouet committed
```sh
npm run lint
```
mathias.chouet's avatar
mathias.chouet committed
### Generate UML diagram
mathias.chouet's avatar
mathias.chouet committed
The tsviz package can be used for drawing class diagram of the current code.
mathias.chouet's avatar
mathias.chouet committed
To install tsviz:
```sh
npm install -g tsviz
```
mathias.chouet's avatar
mathias.chouet committed
There's currently a bug on debian like distribution due to a wrong declaration of graphviz path in the code: https://github.com/joaompneves/tsviz/issues/5
As a workaround, you can create a link to the right path: `sudo ln -s /usr/bin/dot /usr/local/bin/dot` 
mathias.chouet's avatar
mathias.chouet committed
To draw the diagram:
```sh
npm run viz
```
mathias.chouet's avatar
mathias.chouet committed
## Caveats
mathias.chouet's avatar
mathias.chouet committed
### Deployment
mathias.chouet's avatar
mathias.chouet committed
Custom Material SVG Icons will only show up when the application is deployed on the domain root (no subfolders), see [this feature request](https://github.com/angular/material2/issues/4263)
mathias.chouet's avatar
mathias.chouet committed
## Release policy
mathias.chouet's avatar
mathias.chouet committed

Use [semantic versioning](https://semver.org/).

Before releasing a new stable version, one should complete the following files
mathias.chouet's avatar
mathias.chouet committed
 - `CHANGELOG.md`
 - `package.json` (update "version")
 - `jalhyd_branch` (be sure that it contains "master" or is empty)
mathias.chouet's avatar
mathias.chouet committed

Every stable version should be tagged with both
 - the `stable` tag
 - a version tag of the form `X.Y.Z` (semver)

The `stable` tag should be set **before** the version tag, so that `git describe` returns `X.Y.Z` (latest tag).

Here are the steps to follow for an example **4.5.0** version
mathias.chouet's avatar
mathias.chouet committed
```sh
git tag -fa stable
git tag -fa 4.5.0
git push --tags --force
```