简体   繁体   English

将特定修订版Github项目中的插件添加到Cordova项目中

[英]Adding plugins from specific revision Github project to the Cordova project

I have setup the android project using cordova command-line-interface with the help of node.js. 我在node.js的帮助下使用cordova命令行界面设置了android项目。 I have added the required plugin from Github to our project by the following command: 我已通过以下命令将Github所需的插件添加到我们的项目中:

C:Users/Admin/>cordova plugin add https://github.com/phonegap-build/PushPlugin.git C:Users / Admin /> cordova插件添加https://github.com/phonegap-build/PushPlugin.git

For now it is working fine, but what if they suddenly changes the plugin.So I want to stick with the specific revision of plugin. 现在它工作正常,但如果他们突然改变插件怎么办。所以我想坚持插件的具体修改。 So how can i get the plugin which is specific to particular revision. 那么我怎样才能获得特定版本的插件。 Shall i add the revision number or commit number to the above url? 我可以将修订号或提交号添加到上面的URL吗?

I got the answer finally, I could get the plugin code upto particular commit: 我终于得到了答案,我可以获得特定提交的插件代码:

The following command is what I used to get the latest plugin code: 以下命令是我用来获取最新插件代码的命令:

D:sampleproject/>

cordova plugin add https://github.com/phonegap-build/PushPlugin#2345fd8fe48572eae3df631cf8fb262ef2804779

I don't know a way to stick to a particular revision (other than cloning it first and after the clone add it with a file path) but I know it is possible to install from a specific git tag which might be sufficient in most cases. 我不知道如何坚持特定的修订版(除了首先克隆它并在克隆之后添加文件路径)但我知道可以从特定的git标签安装,这在大多数情况下可能就足够了。

Command to install from a specific git tag 从特定git标记安装的命令

cordova plugin add https://github.com/phonegap-build/PushPlugin.git#1.3.4

If you want to install from a tag and a specified sub directory (maybe because plugin.xml isn't a top-level file) you can install it with this command: cordova plugin add https://github.com/phonegap-build/PushPlugin.git#1.3.4:/plugin/sub/dir 如果要从标记和指定的子目录安装(可能因为plugin.xml不是顶级文件),可以使用以下命令安装它: cordova plugin add https://github.com/phonegap-build/PushPlugin.git#1.3.4:/plugin/sub/dir

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM