Cloud Endpoints Frameworks for App Engine Command Line Tool

This page describes how to generate a client library from your backend server API using the Cloud Endpoints Framework command line tool. Any Java or Android app can use this library to call the API.

You can generate client library bundles that allow applications to access your API using the Cloud Endpoints Frameworks command line tool. When you generate a client library, the Frameworks command line tool automatically generates a Discovery document that describes the surface of your API.

To get the Frameworks command line tool, download endpoints-framework-tools from the Maven Central Repository. After you extract the contents of the .zip file, you'll find the tool in the endpoints-framework-tools-2.0.8/bin/ directory.

Generating a client library bundle from an API

You can use the Frameworks command line tool to generate the following types of client bundles:

  • Maven: This bundle includes a pom.xml file with the Endpoints Frameworks and Google API client dependencies. The readme.html provides detailed information on what you need to add to your pom.xml file for different types of client applications and how to build a client library for your API using Maven.

  • Gradle: This bundle includes a build.gradle file with the Endpoints Frameworks and Google API client dependencies. The readme.html provides detailed information on what you need to add to your build.gradle file for different types of client applications and how to build a client library for your API using Gradle.

  • default client bundle: This bundle contains all the dependency libraries and the generated source.jar file, which is the Java library that you use in your client to call your API. This bundle provides your client with all of the Google API client capabilities, including OAuth. The readme.html file lists the .jar files that are required for different types of client applications and other details for using the client library.

If you are using the client library with an Android app, we recommend that you use a Gradle client bundle.

Command line syntax

Before you use the Frameworks command line tool, you must build your backend project because this tool requires compiled binaries. You can optionally supply the --war= option pointing to the build target output directory containing the WEB-INF directory and compiled java classes if you don't want to use the default (--war="./war").

The basic syntax is as follows:

/path-to/endpoints-framework-tools-2.0.8/bin/endpoints-framework-tools <command> <options> [class-name]

where:

  • <command> is get-client-lib.
  • <options>, if supplied, is one or more items shown in the Options table.
  • [class name] is the full class name of your API.

For example:

    /path-to/endpoints-framework-tools-2.0.8/bin/endpoints-framework-tools \
    get-client-lib --war=target/echo-1.0-SNAPSHOT -bs gradle com.example.echo.Echo

where target/echo-1.0-SNAPSHOT is the relative or absolute path to the target build directory containing WEB-INF and the compiled backend classes.

Options

You can use the following options:

Option Name Description Example
build-system Lets you specify which type of client bundle should be produced. Specify gradle for a Gradle client bundle for Android, maven for a Maven client bundle, or default (or simply omit this option) for a bundle that contains only the dependency libraries and source jar. --build-system=gradle
-bs gradle
war Sets the path to the build target directory WEB-INF that contains appengine-web.xml and other metadata.
Default: ./war.
--war=target/echo-1.0-SNAPSHOT
-w target/echo-1.0-SNAPSHOT
output Sets the directory where the output will be written to.
Default: the directory the tool is invoked from.
--output=/mydir
-o /mydir

Supported Client Platforms

The following platforms are supported in the client bundle produced by the Endpoints command line tool:

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Cloud Endpoints Frameworks for App Engine