-
-
Notifications
You must be signed in to change notification settings - Fork 197
feat(options): use the 'nsconfig.json' file to set tns options #5296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…out overwriting them
@DimitarTachev @rosen-vladimirov Hello, I am at your disposal for any changes. Have a nice day 😊 |
Hi @elvticc - I have wanted something like this for a long time! With the recent introduction of import { NativeScriptConfig } from '@nativescript/core'
export default {
id: 'org.nativescript.app',
// ...
cli: {
packageManager: 'yarn',
android: {
copyTo: './_build/android'
}
},
} as NativeScriptConfig The syntax/api is subject to change, merely just a quick example of what I imagined. |
Hi @rigor789, I will update this to include the new |
@elvticc the CLI should automatically fall back to I think in const projectConfig = injector.resolve('projectConfigService')
// add guards if it's not set/found etc.
const cliOptions = projectConfig.getValue('cli') // I think this should work, and return the object
// do any processing of the options (can probably be enclosed in a function within `options.ts`)
// just an example, doesn't have to be called this - or even called this way
this.argv = this.processConfigOptions(cliOptions)
// probably better to just have a single line that calls a function that
// does all the config fetching, manipulation and setting argv Other than that, I think we want these to be used by default - and provide a flag to opt-out? If you want to to work on this together, feel free to ping me - I'm usually available |
PR Checklist
What is the current behavior?
Tns options are to be written each time to build, run, deploy, debug and test an Android and iOS application.
What is the new behavior?
In addition to the current behavior, all tns options can be defined in the nsconfig.json file.
In the nsconfig.json file, you need to add the
tnsOptions
key withandroid
andios
subkeys.Option names are unchanged, they are those of the documentation of the CLI.
Example
nsconfig.json
CLI
(see the original idea)
Fixes/Implements/Closes
Fixes
Create up to the last folder in the path with the copyTo option.