-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Use custom native project templates #1514
Comments
I wholeheartedly approve - so much so that I want to very strongly advocate for permanently splitting the current Xcode and Gradle templates away from the runtime packages. Right now a minor fix in the templates requires releasing a whole new version of the runtimes and it is extremely cumbersome to support new build configurations such as iOS App Extensions or new platforms such as tvOS. |
@fealebenpae |
@rosen-vladimirov Hi! Is there some documentation for this or an example? And where default template is stored? |
Hi @FriOne If you need help for some tns command you can run For general help about {N} CLI commands you can run We also have a list with popular templates at Tempaltes section of https://market.nativescript.org/ You can create app from custom templates like this:
Notes:
|
Currently the native project templates (iOS and android) are taken from runtimes.
We should allow using custom templates, as there are some cases when the current template should be changed/extended, so you have to modify the
platforms
dir and commit it to source control.The idea is to have new option for
platform add
command, for example--platform-template
that will specify from where to take the native project template. The path to template should be saved in package.json under nativescript key, for example:CLI commands should work in the following way:
tns platform add android --platform-template ./myAndroidTemplateDir
- adds latest android runtime and copies the native project template frommyAndroidTemplateDir
. The value of the template should be written inpackage.json
.tns platform add android
:tns-android
entry inpackage.json
- work as usual - latest runtime and get native template from it.tns-android
entry inpackage.json
and there'stemplate
define in it - use the specified runtime version and the native template from the value oftemplate
property.tns prepare <platform>
,tns build <platform>
,tns deploy <platform>
,tns emulate <platform>
,tns run <platform>
,tns test <platform>
should add the platform. In case--platform-template
is passed to any of these commands, we should respect it and do the same astns platform add
.Same is valid for
iOS
related commands.The value for template could be anything that can be
npm installed
- local directory, npm package, github url,.tgz
.The text was updated successfully, but these errors were encountered: