NativeScript / NativeScript/nativescript-cli

Set up multiple environment such as dev and prod to hold different set of variables

Open
#3,691 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
JavaScript
Stars
1.1k
Forks
204
Avg merge
1d 9h
Merged PRs (30d)
8

Description

Please, provide the details below:

Did you verify this is a real problem by searching the [NativeScript Forum]

Yes.

Tell us about the problem

How does one achieve the following: https://stackoverflow.com/questions/22995057/how-do-you-manage-multiple-environments-while-developing-android-apps

I hope to have 2 application IDs such as (org.nativescript.scvsmobileappdev & org.nativescript.scvsmobileapp), which eventually will be build to create 2 playstore apps (one for development testing, another one for production). The package.json, app.gradle must be able to generate its value based on environment variables.

I saw from here https://blog.davincisoftware.sk/building-a-mobile-nativescript-app that we can use the CLI hooks to achieve environment variables, but I want the files that is being involved in the app build process such as tns build to be able to read from those environment, maybe something like tns build --dev

Which platform(s) does your issue occur on?

Android

Please provide the following version numbers that your issue occurs with:
  • CLI: (run tns --version to fetch it) 4.1.0
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project) 4.1.0
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the
    package.json file of your project) 4.1.3
  • Plugin(s): (look for the version number in the package.json file of your
    project) 4.1.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with package.json and app.gradle, then trace how tns build and CLI hooks participate in the Android build process. Define how development and production environment selection should provide distinct application IDs and variables, including whether a command such as tns build --dev is required; no tests are mentioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
build-system, cli, mobile
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.