Skip to content

Conversation

@rosen-vladimirov
Copy link
Contributor

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.

Sample usage:

$ tns create app1
$ cd app1
$ tns run android --platform-template https://github.com/rosen-vladimirov/android-platform-template/tarball/master

IceBuildUser and others added 20 commits February 10, 2016 21:43
Fixes issues with Genymotion being first in the PATH
# Conflicts:
#	lib/common
#	package.json
@rosen-vladimirov rosen-vladimirov self-assigned this Feb 22, 2016
@rosen-vladimirov rosen-vladimirov added this to the 1.6.2 milestone Feb 22, 2016
@rosen-vladimirov
Copy link
Contributor Author

run ci

1 similar comment
@rosen-vladimirov
Copy link
Contributor Author

run ci

pathToTemplate: installedTemplatePath
};
} catch(err) {
this.$logger.warn(`Unable to install platform template ${specifiedTemplate}. Default template will be used.`);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should throw correct error here instead of just printing warning

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I second this.

let tempDir = temp.mkdirSync("platform-template");
try {
let installedTemplatePath = this.$npm.install(specifiedTemplate, tempDir, {"ignore-scripts": true, "production": true}).wait()[0][1];
return {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you rename installedTemplatePath, you can use the short syntax here. Not a stopper, though.

@rosen-vladimirov rosen-vladimirov modified the milestones: 1.7.0, 1.6.2 Mar 2, 2016
nadyaA and others added 3 commits March 2, 2016 13:13
Livesync does not work when /data/local/tmp/<app-identifier> file exists on Android device.
This happens when a file with name app-identifier exists in /data/local/tmp directory on device. In this case CLI is not able to create directory.
…c-isit-folder

Delete /data/local/tmp/<app-identifier> file if exists on Android device
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.
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/custom-native-templates branch from 1df7d02 to d5bd3ad Compare March 4, 2016 10:52
@rosen-vladimirov
Copy link
Contributor Author

Close and retarget to master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants