在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):GoogleCloudPlatform/endpoints-framework-gradle-plugin开源软件地址(OpenSource Url):https://github.com/GoogleCloudPlatform/endpoints-framework-gradle-plugin开源编程语言(OpenSource Language):Java 93.8%开源软件介绍(OpenSource Introduction):Endpoints Framework Gradle PluginThis Gradle plugin provides tasks and configurations to build and connect Endpoints Framework projects. Android Studio users see transition guide. RequirementsGradle is required to build and run the plugin. The table below shows the compatibility with Gradle version.
How to useThe 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 : buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.cloud.tools:endpoints-framework-gradle-plugin:1.0.2'
}
} ServerIn your Gradle App Engine Java app, add the following plugin to your build.gradle: apply plugin: 'com.google.cloud.tools.endpoints-framework-server' The plugin exposes the following server side goals
The plugin exposes server side configuration through the
UsageMake sure your web.xml is configured to expose your endpoints correctly. No configuration paramters are required to run with default values
Client libraries will be written to
Discovery documents will be written to ClientIn your client Java app, add the following plugin to your build.gradle: // apply this plugin after you have applied other plugins
// because it uses the state of other plugins
apply 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
The plugin exposes intermodule endpoints configuration through a custom dependency
Usage (from discovery docs)In your build.gradle define the location of the discovery document in the
endpointsClient {
discoveryDocs = ['src/endpoints/myApi-v1-rest.discovery']
} building your project should inject the correct generated source into your compile path. Usage (from server module in project)In your build.gradle define the correct project dependency, the server project must be
an dependencies {
endpointsServer 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 dependencies {
compile 'com.google.api-client:google-api-client:<version>' // for standard java projects
compile 'com.google.api-client:google-api-client-android:<version>' exclude module: 'httpclient' // for android projects
} ContributingIf you wish to build this plugin from source, please see the contributor instructions. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论