Skip to content

Latest commit

 

History

History
145 lines (105 loc) · 2.95 KB

build.md

File metadata and controls

145 lines (105 loc) · 2.95 KB

Building from source

Technologies: SUMARiS App is an Angular App (Angular with Ionic).

This article will explain how to install your environment, then build the application.

Installation tools, and get sources

  1. Install NVM

  2. Install Node v18 (e.g. v18.19.0)

    nvm install 18.19.0

    Check version in package.json

  3. Install global dependency:

    npm install -g @ionic/cli@7.2.0 @angular/cli@18.2.8

    Check versions in package.json

  4. Get sources (clone the repo) : git clone ...

Install additional tools (optional)

sudo apt-get install chromium-browser docker.io

Web build

For development and test

  1. Install project's dependencies:

    cd sumaris-app
    npm install --force
  2. Check environment configuration:

    • Edit the file src/environment/environment.ts
  3. Start the app

    cd sumaris-app
    npm start

    By default, the app should be accessible at http://localhost:4200

    To change the default port, use this command instead:

    cd sumaris-app
    ng serve --port [port]

The application should be accessible at localhost:4200

Web build for production

  1. Check environment configuration:

    • Edit the file src/environment/environment-prod.ts
  2. Build:

    npm run build:prod

Android build

Build a debug APK, for development and test

  1. Install the android build environment:

    npm run android:install
  2. Create a debug APK file:

    npm run android:build
    npm run android:package

Build a release APK, for production

  1. Check environment configuration:

    • Edit the file src/environment/environment-prod.ts
  2. Create a release APK file:

    npm run android:build:prod
    npm run android:package:prod

iOS build

  • Install dependencies:

brew install cocoapods

  • Build the app:

cd sumaris-app npm run ios:build

  • Open Xcode :

    npm run ios:open

    or

    ionic cap open ios

Useful links

Troubleshooting

Error on datasource, or angular material table

  • Checkout the project https://github.com/e-is/angular4-material-table
    git clone https://github.com/e-is/angular4-material-table.git
    cd angular4-material-table
  • Build the project:
    npm install
    npm run build
    cp package*.json ./dist
  • Link to your local NPM repo:
    cd dist
    npm link 
  • Use it from Sumaris project:
    cd <sumaris_app_root>
    npm link angular4-material-table