Commit 2f0259ac authored by Mathias Chouet's avatar Mathias Chouet 🍝
Browse files

Update README for #262

parent b3a301c7
...@@ -2,11 +2,7 @@ ...@@ -2,11 +2,7 @@
## All the things to know for developping the library ## All the things to know for developping the library
The library needs nodeJS installed and the following node packages installed globally: _typescript, karma, tslint_. The library needs nodeJS installed.
This can be done from the command line:
`npm install -g typescript karma tslint`
The documentation of Cassiopee needs to install MkDocs and some extensions: The documentation of Cassiopee needs to install MkDocs and some extensions:
...@@ -15,35 +11,110 @@ sudo apt install python3-pip python3-setuptools ...@@ -15,35 +11,110 @@ sudo apt install python3-pip python3-setuptools
python3 -m pip install mkdocs python-markdown-math mkdocs-material python3 -m pip install mkdocs python-markdown-math mkdocs-material
``` ```
### Install the necessary packages of the library: ### Install the necessary packages of the library
Clone or update the JalHyd project and in the JalHyd folder, run : Clone or update the JalHyd project and in the JalHyd folder, run :
`npm package` `npm run package`
Then, back to the ngHyd project folder, run : Then, back to the ngHyd project folder, run :
`npm run jalhyd`
and then :
`npm install` `npm install`
### To compile the typescript code ### To compile the code and get a deployable Web app
`npm run build` `npm run build`
### To run compilation in watch mode as well as application execution in a navigator window ### To run compilation in watch mode as well as application execution in a browser
`npm start` `npm start`
### To run end-to-end unit tests
`npm run e2e`
### To quickly end-to-end unit tests while watch mode is running
`npm run e2equick`
### To quickly try electron wrapping when code is already compiled
`npm run electron`
### To build a complete release for Linux (has to be run on Linux platform)
`npm run release-linux`
Find the .deb package in `/release`.
Running `dpkg -i cassiopee_*.deb` will install Cassiopée in `/opt/Cassiopee`
### To build a complete release for Windows (has to be run on Windows platform)
#### install dependencies
* python for windows https://www.python.org/downloads/windows/
* tick "add to path" option when installing
* 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`
#### build .exe installer
`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`
### To build a complete release for Android
#### install dependencies
* java (system wide) : for ex. `apt install oracle-java8-jdk`
* gradle (system wide) : `apt install gradle`
#### install Android Studio and SDKs
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.
#### build .apk package
`npm run release-android`.
Find the generated package in `/release`.
### To generate compodoc
`npm run compodoc`
### To flag suspicious language usage ### To flag suspicious language usage
`npm run lint` `npm run lint`
### UML visualisation
The tsviz package can be used for drawing class diagram of the current code.
To install tsviz: `npm install -g tsviz`
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
To work around, you can create a link to the good path: `sudo ln -s /usr/bin/dot /usr/local/bin/dot`
To draw the diagram: `npm run viz`
# Caveats # Caveats
## Deployment ## Deployment
...@@ -203,75 +274,6 @@ Custom Material SVG Icons will only show up when the application is deployed on ...@@ -203,75 +274,6 @@ Custom Material SVG Icons will only show up when the application is deployed on
5. **Si une nouvelle classe a été créée à l'étape 2**, dans la méthode _FormulaireService.newFormulaire()_, compléter le _switch_ pour fournir la classe à instancier. 5. **Si une nouvelle classe a été créée à l'étape 2**, dans la méthode _FormulaireService.newFormulaire()_, compléter le _switch_ pour fournir la classe à instancier.
# Build under Windows
Several npm scripts of `package.json` won't work with windows (for ex. "mkdocs"). Building is a little more complicated.
### install dependencies
* Git, for example [https://gitforwindows.org](https://gitforwindows.org)
* Nodejs [https://nodejs.org/en/download](https://nodejs.org/en/download)
* typescript compiler (system wide) : `npm install -g typescript`
* angular cli (system wide) : `npm install -g @angular/cli`
### build jalhyd
Clone `jalhyd` repository.
Install packages with `npm install`.
Run `npm run preprocess`
Compile jalhyd with `tsc --p "src/tsconfig.app.json"`
### build nghyd
Clone `nghyd` repository.
Install packages with `npm install`.
Run `node preprocessors.js`
As `mkdocs` does not work, copy `src/assets/docs-fr` folder **from a linux build**.
Compile nghyd with `ng build --prod --build-optimizer=false`
# Build desktop packages with Electron
## linux .deb package
Execute `npm run release-linux`. Find the .deb package in `/release`.
Running `dpkg -i cassiopee_*.deb` will install Cassiopée in `/opt/Cassiopee`
## windows installer
### install dependencies
* electron-builder (system wide) : `npm install -g electron-builder`
Execute `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`
# Build mobile packages with Cordova
Cordova embeds the whole app in a Web view, allowing it to run on mobile devices
## Android .apk
### install dependencies
* java (system wide) : for ex. `apt install oracle-java8-jdk`
* cordova (system wide) : `npm install -g cordova`
* gradle (system wide) : `apt install gradle`
### install Android Studio and SDKs
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.
Build .apk package with `npm run release-android`. Find the generated package in `/release`.
# Create PDF from documentation # Create PDF from documentation
```sh ```sh
......
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