添加依赖到Android科尔多瓦插件 [英] Add a dependency to an Android Cordova plugin

查看:135
本文介绍了添加依赖到Android科尔多瓦插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立一个科尔多瓦Android插件即可。我想使用第三方查看内的意图按插件创建 (具体剪刀)。
一般情况下(非科尔多瓦项目)我会去我的项目的的build.gradle 文件并添加这样的:

I'm building a Cordova Android plugin. I want to use a 3rd party View inside an Intent that is created by the plugin (specifically scissors). Normally (in non Cordova projects) I would go to my project's build.gradle file and add it like this:

dependencies {
compile 'com.lyft:scissors:1.0.1' }

但好像在我插件的项目的build.gradle 文件是不是意味着被感动?
什么是一个依赖添加到插件项目,以支持通过科尔多瓦两个构建,并通过Android Studio中建立正确的方法是什么?
同样的问题,但对于一个本地项目(在GitHub上未托管)。

But it seems like the build.gradle file in my plugin's project wasn't meant to be touched? What is the proper way to add a dependency to a plugin project, to support both builds via Cordova and builds via Android Studio? Same question, but for a local project (not hosted on GitHub).

推荐答案

您必须使用自己的文件的gradle并将其链接在这样plugin.xml的

You have to use your own gradle file and link it on the plugin.xml like this

<framework src="relative/path/your.gradle" custom="true" type="gradleReference" />

您必须把该标签上的plugin.xml,所以插件安装的读取和科尔多瓦处理它(不知道它的内部工作原理,但我想这将复制您的自定义值.gradle到主构建.gradle)。所以你不能测试它在你当前的项目,你必须创建一个新的项目并添加插件,看看它是否工作

You have to put that tag on the plugin.xml, so on plugin install it's read and cordova handles it (not sure how it works internally, but I suppose that it copies the values from your custom .gradle to the main build.gradle). So you can't test it on your current project, you have to create a new project and add the plugin and see if it works

这篇关于添加依赖到Android科尔多瓦插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆