是否有一种简单的方法来使用 gradle 任务 appengineEndpointsGetClientLibs
的输出?
我使用 Android Studio 开发具有多个端点的应用程序。从 gradle 窗口运行“appengineEndpointsGetClientLibs”时,任务成功运行。我可以在构建文件夹中看到输出,但似乎无法找到直接使用输出的方法。现在,我每次都在解压并手动将类复制粘贴到我的项目中 :(。难道没有其他方法吗?
最佳答案
使用 appengine-gradle-plugin-1.9.4 有几种方法可以做到这一点。
1:在您的项目中使用端点 Artifact (这是新的)。这需要通过在 settings.gradle 文件中适本地指定 appengine 项目 ( http://www.gradle.org/docs/current/userguide/multi_project_builds.html ) 使其成为您的 android 项目的一部分。然后,您可以通过向 build.gradle 文件添加编译依赖项(路径是 gradle 项目路径,而不是文件路径)来从您的 android 项目中引用端点 Artifact
dependencies {
compile project(path: '<appengine-module>', configuration: 'android-endpoints')
}
这将包括端点客户端库及其依赖项。
2:appengineEndpointsInstallClientLibs
(安装到本地 Maven 存储库),然后您可以在构建文件中引用它。
3:appengineEndpointsExportClientLibs
虽然我不推荐这样做,但如果您真的想将 jar 文件导出到某个位置,可以这样做。
如果您还没有看过 github 页面,那么值得一看,看看您可以做什么:https://github.com/GoogleCloudPlatform/gradle-appengine-plugin
关于android - 如何在 Android studio 中使用 appengineEndpointsGet ClientLibs 的输出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23641783/