-
-
Notifications
You must be signed in to change notification settings - Fork 198
Add support for custom platform templates #1566
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
|
Original PR - #1525 |
lib/services/platform-service.ts
Outdated
| this.$projectDataService.initialize(this.$projectData.projectDir); | ||
| let customTemplateOptions = this.getPathToPlatformTemplate(this.$options.platformTemplate, platformData.frameworkPackageName).wait(); | ||
| let pathToTemplate: string; | ||
| if(customTemplateOptions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rewrite this:
let pathToTemplate = customTemplateOptions && customTemplateOptions.pathToTemplate;|
👍 after addressing comments |
|
Documentation? :D |
aac9dfb to
8c99799
Compare
|
@ikoevska thanks, I've updated the PR, can you check the documentation |
| * `--frameworkPath` - Sets the path to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If `--symlink` is specified, `<File Path>` must point to directory in which the runtime is already extracted. If `--symlink` is not specified, `<File Path>` must point to a valid npm package. | ||
| * `--frameworkPath` - Sets the path to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If `--symlink` is specified, `<File Path>` must point to directory in which the runtime is already extracted. If `--symlink` is not specified, `<File Path>` must point to a valid npm package. | ||
| * `--symlink` - Creates a symlink to a NativeScript runtime for the specified platform that you want to use instead of the default runtime. If `--frameworkPath` is specified, creates a symlink to the specified directory. If `--frameworkPath` is not specified, creates a symlink to platform runtime installed with your current version of NativeScript. | ||
| * `--sdk` - Sets the target Android SDK for the project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add a line for --platformTemplate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Set minimum required Android Build Tools 23.0.0
…ersions Update requirement for Android Build Tools
Our system requirements point that JAVA_HOME must be set, but `tns doctor` is not strict about this. With version 1.7.0 of the runtime, `jarsigner` from $JAVA_HOME/bin/jarsigner will be called explicitly, so we must be sure JAVA_HOME is correct. `jarsigner` does not exist in JRE, so add logic to call it in order to verify that the currently set JAVA_HOME is correct. Validate the information in the following order: 1) Check if JAVA_HOME is set. In case it is not, you cannot build for Android (`tns build android` will fail before starting). 2) Check if JAVA_HOME is correct by executing JAVA_HOME/bin/jarsigner - in case it does not exist - fail 3) Check if the version of the JAVA is correct by calling JAVA_HOME/bin/javac -version and compare it with min required one. In case it's lower - fail. `tns doctor` will print warning in case any of the above check fails. `tns build android` and any other Android related build operations will fail.
Verify JAVA_HOME is set correctly
Add new option when adding platform: `--platform-template`. When it is used, CLI will use the specified template instead of the default template from the runtime. The path to the specified template will be saved in project's package.json, so next time when platform is added, the same template will be used. In case when `--platform-template` is not passed, CLI will check the package.json and if there's value for the template, it will be used. Otherwise the default template from runtime will be used.
8c99799 to
2c52a34
Compare
|
retarget to release for 1.7.0 ... |
Add new option when adding platform:
--platform-template. When it is used, CLI will use the specified template instead of the default template from the runtime. The path to the specified template will be saved in project's package.json, so next time when platform is added, the same template will be used.In case when
--platform-templateis not passed, CLI will check the package.json and if there's value for the template, it will be used. Otherwise the default template from runtime will be used.Sample usage: