如何在第Android的工作室appengineEndpointsGetClientLibs的输出中使用? [英] How to use th ouput of appengineEndpointsGetClientLibs in Android studio?

查看:679
本文介绍了如何在第Android的工作室appengineEndpointsGetClientLibs的输出中使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有使用来自gradle这个任务输出一个简单的方法 appengineEndpointsGetClientLibs

Is there an easy way to use the output from the gradle task appengineEndpointsGetClientLibs?

我使用Android Studio开发与多个端点的应用程序。当来自的gradle窗口运行appengineEndpointsGetClientLibs,任务successfuly运行。我可以看到在build文件夹中的输出,但似乎无法找到一种方法,实际上是直接使用的输出。现在我解压,然后手动复制粘贴到班每次:(我的项目。Issn't有另一种方式?

I use Android Studio to develop an application with multiple endpoints. When running "appengineEndpointsGetClientLibs" from the gradle window, the task runs successfuly. I can see the output in the build folder, but can't seem to find a way to actually use the output directly. Right now I'm unzipping and manually copy-pasting the classes into my project every time :(. Issn't there another way?

推荐答案

随着AppEngine上-gradle这个-插件-1.9.4有几个方法可以做到这一点。

With the appengine-gradle-plugin-1.9.4 there are a few ways to do it.

1:在项目中使用端点神器(这是新的)。这就要求项目的AppEngine是你的Andr​​oid项目的一部分,通过在settings.gradle文件中指定它适当地(的 http://www.gradle.org/docs/current/userguide/multi_project_builds.html )。然后,您可以从您的Andr​​oid项目中加入编译依赖到的build.gradle文件(路径为项目的gradle路径,而不是文件路径)

1: Using the endpoints artifact (this is new) in your project. This requires the appengine project to be part of your android project by specifying it in your settings.gradle file appropriately (http://www.gradle.org/docs/current/userguide/multi_project_builds.html). You can then reference the endpoints artifact from your android project by adding a compile dependency to the build.gradle file (path is a gradle project path, not a file path)

dependencies {
    compile project(path: '<appengine-module>', configuration: 'android-endpoints')  
}

这将包括端点客户端库和他们的依赖关系。

This will include the endpoints client libraries and their dependencies.

2: appengineEndpointsInstallClientLibs (安装到本地Maven回购),然后你就可以在你的构建文件中引用

2: appengineEndpointsInstallClientLibs (installs to local maven repo) which you can then reference in your build file.

3。 appengineEndpointsExportClientLibs 虽然我不建议这一点,如果你真的想要jar文件导出到一个位置,这将做到这一点。

3: appengineEndpointsExportClientLibs while I wouldn't recommend this, if you really wanted to export jar files to a location this would do it.

如果您还没有看到GitHub的页面,这是值得考虑看看,看看你会是怎样能够做到:的 https://github.com/GoogleCloudPlatform/gradle-appengine-plugin

If you haven't seen the github page, it's worth taking a look to see what you might be able to do : https://github.com/GoogleCloudPlatform/gradle-appengine-plugin

这篇关于如何在第Android的工作室appengineEndpointsGetClientLibs的输出中使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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