Why does the created Cloud Endpoints library change its version now and then?

The Android Studio App Engine project (by default) is configured to create a client library that can be used by an Android and / or iOS application.

Gradle is configured to auto build the library:

apply plugin: 'appengine'

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

      

Please note: there is no version listed here.

As stated in https://cloud.google.com/appengine/docs/java/endpoints/gen_clients the library name is generated as

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

      

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

com.mydomain:api:v2-1.20.0-SNAPSHOT

      

I am using this library in a separate project:

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

      

This works great as long as Android Studio or gradle or Google or whoever changes the version number is here 1.20.0

. Then my app compilation crashes until I change the version in gradle.

  • Why? Can anyone tell me why the version remains stable for several months and then suddenly changes from one day to the next without any updates or changes made on my part. What is this version, who generates it, and can I control it when I build it from my App Engine project?

Note. Considering that the App Engine module and the Android application module are in the same project, Android Studio changes both versions and you are fine. But when projects are split, automatic builds are aborted.

0


source to share


1 answer


The version 1.20.0

corresponds to the version of the Maven appengine endpoint client library generation package used to generate the client libraries. Behind the scenes, it runs a Maven target appengine:endpoints_get_client_lib

to build a JAR / AAR for your Android application. Check your compile dependencies to see which version is listed for appengine. If version c is used at the end +

, then Gradle and Maven can download newer versions of the plugins / SDKs that are used to build your endpoints, as well as the libraries required for the client applications.



There is no documented way to override this version information using Maven or Gradle targets. However, you can manually build the library using a endpoints.sh

script in the AppEngine SDK that should let you install the version the way you want.

+2


source







All Articles