为什么产生云端点库现在,然后改变它的版本? [英] Why does the generated Cloud Endpoints library change its version now and then?

查看:120
本文介绍了为什么产生云端点库现在,然后改变它的版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio中的一个App Engine的项目是(默认),配置为生成客户端库,它可以通过Android和/或iOS应用被消耗掉。

An App Engine project in Android Studio is (by default) configured to generate a client library, which can be consumed by an Android and/or iOS app.

摇篮配置为自动生成库:

Gradle is configured to auto-generate the library:

apply plugin: 'appengine'

appengine {
    downloadSdk = true
    appcfg {
        oauth2 = true
    }
    endpoints {
        getClientLibsOnBuild = true
        getDiscoveryDocsOnBuild = true
    }
}

请注意,没有任何地方这里指定的版本。

Note there is no version specified anywhere here.

https://cloud.google.com/appengine/docs规定/ JAVA /端点/ gen_clients 中,库名作为

/target/<yourProjectVersion>.<versionString>-rc-SNAPSHOT.jar

本文档很可能还是从Android Studio中的RC候选版,作为我的图书馆是这样的:

This documentation is probably still from the rc candidate of Android Studio, as my library looks like this:

com.mydomain:api:v2-1.20.0-SNAPSHOT

我使用该库在一个单独的项目:

I am using that library in a separate project:

compile 'com.mydomain:api:v2-1.20.0-SNAPSHOT'

这工作得很好,直到Android的Studio或gradle这个或谷歌或谁改变了版本号,这里 1.20.0 。然后,我的应用程序编译休息,直到我在调整的Gradle版本。

This works fine, until Android Studio or gradle or Google or whoever changes the version number, here 1.20.0. Then my app compile breaks until I adjust the version in gradle.


  • 这是为什么?谁能告诉我,为什么版本保持数月稳定,然后突然没有从我的身边进行任何更新或改变从一天到另一个变化。那是什么版本,谁产生它,我可以控制它,当我从我的App Engine的项目产生的呢?

注:鉴于在App Engine模块和Android应用程序模块在同一个项目中,Android的工作室改变了两个版本,一切都很好。但是,当项目是分开的,自动化生成休息。

NB: Given that the App Engine module and the Android app module are in the same project, Android Studio changes both versions and everything is fine. But when projects are separate, automated builds break.

推荐答案

1.20.0 版本的AppEngine端点客户端库生成包的Maven的版本一致,使用创建客户端库。幕后正在运行Maven的目标 AppEngine上:endpoints_get_client_lib 为了打造JAR / AAR Android应用的需求。检查你的编译依赖看到的是正在为AppEngine上指定的版本。如果使用带版本 + 末再摇篮和Maven可以下载这是用来建立自己的终端以及该插件/软件开发工具包的较新版本需要的客户端应用程序库。

The 1.20.0 version matches the version of the appengine endpoint client libs generation package for Maven, used to create your client libraries. Behind the scenes it is running the Maven goal appengine:endpoints_get_client_lib in order to build the JAR/AAR your Android app needs. Check your compile dependencies to see what version is being specified for appengine. If it is using a version with a + at the end then Gradle and Maven could be downloading newer versions of the plugins/SDKs which are used to build your endpoints as well as the libraries needed for client apps.

有覆盖使用Maven的目标或摇篮此版本信息没有任何记载的方法。但是,你可以使用 endpoints.sh 脚本中的的AppEngine SDK 这应该允许您设置的版本你想要的方式。

There's no documented way to override this version information using the Maven targets or Gradle. However, you could manually build the library using the endpoints.sh script in the AppEngine SDK which should allow you to set the version the way you want.

这篇关于为什么产生云端点库现在,然后改变它的版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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