Cordova插件可替代

Cordova插件可替代

本文介绍了Cordova插件可替代< source-file>标签以复制整个目录内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以在plugin.xml中指定使用一个dir copy语句或自动复制src目录中的每个文件将plugin source文件夹中的每个文件复制到目标平台目录.

Is there any way to specify in plugin.xml to copy every file in plugin source folder to the target platform directory either with one dir copy statement or automatically copy every file in src directory.

使用复制作为大插件的一部分是噩梦,因为我们看到在大规模重构期间需要进行手动更改.

Using to be copied as part of big plugin is the nightmare, as we are seeing manual changes needed during the massive refactoring.

推荐答案

我还不能投票:(但是拉菲塔(Rafita)是正确的.为了扩展这个答案,我做同样的事情,因为我有很多文件包含一个Android活动,该活动包含许多Java源文件,资产,布局和资源,所有这些源文件,资产,布局和资源都需要安装到平台中(并与核心android插件生成的任何现有源文件合并).

I can't vote yet :( but Rafita is correct. To expand on that answer, I do the same thing because I have a large set of files that comprise an Android Activity that include many java source files, assets, layouts, and resources that all need to be installed into the platforms (and merged with any existing ones generated by the core android plugin).

  • 对于Android,我将整个活动的源代码复制到android插件目录中,然后安排将它们全部复制,如下所示:

<源文件src ="src/android/java/com/acme" target-dir ="src/com"/> 将整个包树复制到 platforms/android/src/com/acme 目录.

<source-file src="src/android/java/com/acme" target-dir="src/com" /> will copy your entire package tree into the platforms/android/src/com/acme directory.

对于资源和资产,您可以执行以下操作:

And for the resources and assets, you can do this:

<资源文件src ="src/android/res" target ="res"/>< resource-file src ="src/android/assets" target ="assets"/>

  • 对于iOS,

<源文件src ="src/ios" target-dir ="src"/> 将所有源文件从您的 plugin/src/ios 目录复制到 platforms/ios/Project-Name/Plugins/plugin-name 目录

<source-file src="src/ios" target-dir="src"/>Will copy all source files from your plugin/src/ios directory to platforms/ios/Project-Name/Plugins/plugin-name directory

这篇关于Cordova插件可替代&lt; source-file&gt;标签以复制整个目录内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 12:03