NativeScript / NativeScript/nativescript-cli
Set up multiple environment such as dev and prod to hold different set of variables
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 1.1k
- 派生
- 204
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 8
描述
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 --versionto fetch it) 4.1.0 - Cross-platform modules: (check the 'version' attribute in the
node_modules/tns-core-modules/package.jsonfile in your project) 4.1.0 - Runtime(s): (look for the
"tns-android"and"tns-ios"properties in the
package.jsonfile of your project) 4.1.3 - Plugin(s): (look for the version number in the
package.jsonfile of your
project) 4.1.3
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 package.json 和 app.gradle 开始,然后追踪 tns build 和 CLI hooks 如何参与 Android 构建流程。定义开发环境和生产环境的选择应如何提供不同的应用程序 ID 和变量,包括是否需要使用类似 tns build --dev 的命令;未提及测试。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, javascript
- 领域
- build-system, cli, mobile
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100