|
1 | | -# Building from source |
| 1 | +# Building from Source |
2 | 2 |
|
3 | | -Cesium² is an Angular App (Angular with Ionic). |
| 3 | +Cesium² is an Angular app built with Ionic. This article will guide you through setting up your environment and building the application. |
4 | 4 |
|
5 | | -This article will explain how to install your environment, then build the application. |
6 | | - |
7 | | -## Installation tools, and get sources |
| 5 | +## Installation Tools and Getting the Sources |
8 | 6 |
|
9 | 7 | 1. Install [NVM](https://github.com/nvm-sh/nvm) |
10 | 8 |
|
11 | | -2. Install Node v18 (e.g. v18.19.0) |
12 | | -```bash |
13 | | -nvm install 18.19.0 |
14 | | -``` |
| 9 | +2. Install Node v18 (e.g., v18.19.0): |
15 | 10 |
|
16 | | -3. Install global dependency: |
17 | | -```bash |
18 | | -npm install -g @ionic/cli @angular/cli |
19 | | -``` |
| 11 | + ```bash |
| 12 | + nvm install 18.19.0 |
| 13 | + ``` |
| 14 | + |
| 15 | +3. Install global dependencies: |
| 16 | + |
| 17 | + ```bash |
| 18 | + npm install -g @ionic/cli @angular/cli |
| 19 | + ``` |
| 20 | + |
| 21 | +4. Get the sources by cloning the repository: |
| 22 | + |
| 23 | + ```bash |
| 24 | + git clone ... |
| 25 | + ``` |
20 | 26 |
|
21 | | -4. Get sources (clone the repo) : `git clone ...` |
| 27 | +### Optional: Install Additional Tools |
22 | 28 |
|
23 | | -### Install additional tools (optional) |
24 | 29 | ```bash |
25 | 30 | sudo apt-get install chromium-browser docker.io |
26 | 31 | ``` |
27 | 32 |
|
28 | | -## Web build |
| 33 | +## Web Build |
29 | 34 |
|
30 | | -### For development and test |
| 35 | +### Development and Testing |
31 | 36 |
|
32 | | -1. Install project's dependencies: |
33 | | -```bash |
34 | | -cd cesium |
35 | | -npm install |
36 | | -``` |
| 37 | +1. Install the project's dependencies: |
37 | 38 |
|
38 | | -2. Check environment configuration: |
| 39 | + ```bash |
| 40 | + cd cesium |
| 41 | + npm install |
| 42 | + ``` |
39 | 43 |
|
| 44 | +2. Check the environment configuration: |
40 | 45 | - Edit the file `src/environment/environment.ts` |
41 | | - |
42 | | -3. Start the app |
43 | | - ```bash |
44 | | - cd cesium |
45 | | - npm start |
46 | | - ``` |
| 46 | + |
| 47 | +3. Start the app: |
| 48 | + |
| 49 | + ```bash |
| 50 | + cd cesium |
| 51 | + npm start |
| 52 | + ``` |
| 53 | + |
47 | 54 | By default, the app should be accessible at [http://localhost:4200](http://localhost:4200) |
48 | | - |
| 55 | + |
49 | 56 | To change the default port, use this command instead: |
50 | | - |
51 | | - ```bash |
52 | | - cd cesium |
53 | | - ng serve --port [port] |
54 | | - ``` |
55 | 57 |
|
56 | | -### Web build for production |
| 58 | + ```bash |
| 59 | + cd cesium |
| 60 | + ng serve --port [port] |
| 61 | + ``` |
57 | 62 |
|
58 | | -1. Check environment configuration: |
| 63 | +### Production Web Build |
59 | 64 |
|
| 65 | +1. Check the environment configuration: |
60 | 66 | - Edit the file `src/environment/environment-prod.ts` |
61 | 67 |
|
62 | 68 | 2. Create the release: |
63 | | - ```bash |
64 | | - npm run build:prod |
65 | | - ``` |
66 | 69 |
|
67 | | -## Android build |
| 70 | + ```bash |
| 71 | + npm run build:prod |
| 72 | + ``` |
| 73 | + |
| 74 | +## Android Build |
| 75 | + |
| 76 | +### Debug APK for Development and Testing |
68 | 77 |
|
69 | | -### Build a debug APK, for development and test |
| 78 | +1. Install the Android build environment: |
70 | 79 |
|
71 | | -1. Install the android build environment: |
72 | | - ```bash |
73 | | - cd sumaris-app/scripts |
74 | | - ./env-android.sh |
75 | | - ``` |
| 80 | + ```bash |
| 81 | + cd sumaris-app/scripts |
| 82 | + ./env-android.sh |
| 83 | + ``` |
76 | 84 |
|
77 | 85 | 2. Create a debug APK file: |
78 | | - ```bash |
79 | | - cd sumaris-app/scripts |
80 | | - ./build-android.sh |
81 | | - ``` |
82 | 86 |
|
83 | | -### Build a release APK, for production |
| 87 | + ```bash |
| 88 | + cd sumaris-app/scripts |
| 89 | + ./build-android.sh |
| 90 | + ``` |
84 | 91 |
|
85 | | -1. Check environment configuration: |
| 92 | +### Release APK for Production |
86 | 93 |
|
| 94 | +1. Check the environment configuration: |
87 | 95 | - Edit the file `src/environment/environment-prod.ts` |
88 | 96 |
|
89 | 97 | 2. Create a release APK file: |
90 | | - ```bash |
91 | | - cd sumaris-app/scripts |
92 | | - ./release-android.sh |
93 | | - ``` |
94 | 98 |
|
95 | | -## Useful links |
| 99 | + ```bash |
| 100 | + cd sumaris-app/scripts |
| 101 | + ./release-android.sh |
| 102 | + ``` |
96 | 103 |
|
97 | | -- Ionic 4 colors: https://www.joshmorony.com/a-primer-on-css-4-variables-for-ionic-4/ |
98 | | -- Migration to Ionic 4 tips: https://www.joshmorony.com/my-method-for-upgrading-from-ionic-3-to-ionic-4/ |
99 | | -- Signing Android APK: See doc at |
100 | | - https://www.c-sharpcorner.com/article/create-ionic-4-release-build-for-android/ |
| 104 | +## Useful Links |
| 105 | + |
| 106 | +- [Ionic 4 Colors](https://www.joshmorony.com/a-primer-on-css-4-variables-for-ionic-4/) |
| 107 | +- [Migration to Ionic 4 Tips](https://www.joshmorony.com/my-method-for-upgrading-from-ionic-3-to-ionic-4/) |
| 108 | +- [Signing Android APK](https://www.c-sharpcorner.com/article/create-ionic-4-release-build-for-android/) |
101 | 109 |
|
102 | 110 | ## Troubleshooting |
103 | 111 |
|
104 | | -### Error on datasource, or angular material table |
| 112 | +### Error on Datasource or Angular Material Table |
105 | 113 |
|
106 | | -- Checkout the project https://github.com/e-is/angular4-material-table |
107 | | -```bash |
108 | | -git clone https://github.com/e-is/angular4-material-table.git |
109 | | -cd angular4-material-table |
110 | | -``` |
111 | | -- Build the project: |
112 | | -```bash |
113 | | -npm install |
114 | | -npm run build |
115 | | -cp package*.json ./dist |
116 | | -``` |
117 | | -- Link to your local NPM repo: |
118 | | -```bash |
119 | | -cd dist |
120 | | -npm link |
121 | | -``` |
122 | | -- Use it from Sumaris project: |
123 | | -```bash |
124 | | -cd <sumaris_app_root> |
125 | | -npm link angular4-material-table |
126 | | -``` |
| 114 | +1. Check out the project: |
| 115 | + |
| 116 | + ```bash |
| 117 | + git clone https://github.com/e-is/angular4-material-table.git |
| 118 | + cd angular4-material-table |
| 119 | + ``` |
| 120 | + |
| 121 | +2. Build the project: |
| 122 | + |
| 123 | + ```bash |
| 124 | + npm install |
| 125 | + npm run build |
| 126 | + cp package*.json ./dist |
| 127 | + ``` |
| 128 | + |
| 129 | +3. Link to your local NPM repo: |
| 130 | + |
| 131 | + ```bash |
| 132 | + cd dist |
| 133 | + npm link |
| 134 | + ``` |
| 135 | + |
| 136 | +4. Use it from the Sumaris project: |
| 137 | + |
| 138 | + ```bash |
| 139 | + cd <sumaris_app_root> |
| 140 | + npm link angular4-material-table |
| 141 | + ``` |
0 commit comments