Name: endpoints-framework-gradle-plugin
Owner: Google Cloud Platform
Description: null
Created: 2016-09-27 23:13:19.0
Updated: 2018-05-17 04:29:10.0
Pushed: 2018-05-04 15:00:29.0
Homepage: null
Size: 262
Language: Java
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This Gradle plugin provides tasks and configurations to build and connect Endpoints Framework projects.
Android Studio users see transition guide.
Gradle is required to build and run the plugin.
The plugin JAR needs to be defined in the classpath of your build script. Alternatively, you can download it from GitHub and deploy it to your local repository. The following code snippet shows an example on how to retrieve it from maven central :
dscript {
positories {
mavenCentral()
pendencies {
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
In your Gradle App Engine Java app, add the following plugin to your build.gradle:
y plugin: 'com.google.cloud.tools.endpoints-framework-server'
The plugin exposes the following server side goals
endpointsClientLibs
- generate client librariesendpointsDiscoveryDocs
- generate discovery documentsendpointsOpenApiDocs
- generate Open Api documentsThe plugin exposes server side configuration through the endpointsServer
extension
serviceClasses
- List of service classes (optional), this can be inferred from web.xmlclientLibDir
- Output directory for generated client librarieshostname
- To set the root url for discovery docs and client libs (ex: hostname = myapp.appspot.com
will result in a default root url of https://myapp.appspot.com/_ah/api
)Make sure your web.xml is configured to expose your endpoints correctly.
No configuration paramters are required to run with default values
radle endpointsClientLibs
Client libraries will be written to build/endpointsClientLibs
radle endpointsDiscoveryDocs
Discovery documents will be written to build/endpointsDiscoveryDocs
In your client Java app, add the following plugin to your build.gradle:
pply this plugin after you have applied other plugins
ecause it uses the state of other plugins
y plugin: 'com.google.cloud.tools.endpoints-framework-client'
The plugin exposes no tasks. Applying the plugin will generate sources according to your configuration
The plugin exposes client side configuration through the endpointsClient
extension
discoveryDocs
- List of discovery docs to generate source fromThe plugin exposes intermodule endpoints configuration through a custom dependency
endpointsServer
- Configure generation of source from another module in the projectIn your build.gradle define the location of the discovery document in the
endpointsClient
configuration closure.
ointsClient {
scoveryDocs = ['src/endpoints/myApi-v1-rest.discovery']
building your project should inject the correct generated source into your compile path.
In your build.gradle define the correct project dependency, the server project must be
an endpoints-framework-server
module for this to work.
ndencies {
dpointsServer project(path: ":server", configuration: "endpoints")
building your project should inject the correct generated source into your compile path.
You can use a combination of discovery doc files and server dependencies when building a client module, make sure you include all the necessary dependencies for building your endpoints client
ndencies {
mpile 'com.google.api-client:google-api-client:<version>' // for standard java projects
mpile 'com.google.api-client:google-api-client-android:<version>' exclude module: 'httpclient' // for android projects
If you wish to build this plugin from source, please see the contributor instructions.