Framework Cloud Endpoints untuk alat command line App Engine
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini menjelaskan cara membuat library klien dari API server backend Anda
menggunakan alat command line Endpoints Frameworks. Aplikasi Java atau
Android apa pun dapat menggunakan library ini untuk memanggil API.
Anda dapat membuat paket library klien yang memungkinkan aplikasi mengakses API Anda menggunakan alat command line Endpoints Frameworks. Saat Anda
membuat library klien, alat command line Endpoints Frameworks
akan otomatis membuat
Dokumen penemuan
yang menjelaskan platform API Anda.
Untuk mendapatkan alat command line Endpoints Frameworks, download
endpoints-framework-tools
dari Maven Central Repository.
Setelah Anda mengekstrak konten file zip, alat ini akan berada di
direktori endpoints-framework-tools-2.2.1/bin/.
Membuat paket library klien dari API
Anda dapat menggunakan alat command line Endpoints Frameworks untuk membuat
jenis paket klien berikut:
Maven: Paket ini menyertakan file pom.xml dengan
dependensi Framework Endpoint dan Library Klien Google API.
File readme.html memberikan informasi mendetail tentang hal yang perlu Anda tambahkan
ke file pom.xml untuk berbagai jenis aplikasi
klien dan cara mem-build library klien untuk API menggunakan Maven.
Gradle: Paket ini menyertakan file build.gradle dengan
dependensi Framework Endpoint dan Library Klien Google API.
File readme.html memberikan informasi mendetail tentang hal yang perlu Anda tambahkan
ke file build.gradle untuk berbagai jenis aplikasi klien dan
cara mem-build library klien untuk API menggunakan Gradle.
Paket klien default: Paket ini berisi semua library dependensi dan
file source.jar yang dihasilkan, yang merupakan library Java yang Anda gunakan di
klien untuk memanggil API. Paket ini menyediakan semua
kemampuan Library Klien Google API, termasuk OAuth, untuk klien Anda. File
readme.html mencantumkan file .jar yang diperlukan untuk berbagai
jenis aplikasi klien dan detail lainnya untuk menggunakan library klien.
Jika Anda menggunakan library klien dengan aplikasi Android, sebaiknya
gunakan paket klien Gradle.
Sintaksis command line
Sebelum menggunakan alat command line Endpoints Frameworks, Anda harus
mem-build project backend karena alat ini memerlukan biner yang dikompilasi. Anda dapat
secara opsional memberikan opsi --war= yang mengarah ke direktori output target
build yang berisi direktori WEB-INF dan class java yang dikompilasi jika Anda
tidak ingin menggunakan default (--war="./war").
dengan target/echo-1.0-SNAPSHOT adalah jalur relatif atau absolut ke
direktori build target yang berisi WEB-INF dan class backend yang dikompilasi.
Opsi
Anda dapat menggunakan opsi berikut:
Nama opsi
Deskripsi
Contoh
build-system
Memungkinkan Anda menentukan jenis paket klien yang akan dibuat. Tentukan gradle untuk paket klien Gradle untuk Android, maven untuk paket klien Maven, atau default (atau cukup hapus opsi ini) untuk paket yang hanya berisi library dependensi dan jar sumber.
--build-system=gradle -bs gradle
war
Menetapkan jalur ke direktori target build WEB-INF yang berisi appengine-web.xml dan metadata lainnya. Default: ./war.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-18 UTC."],[[["\u003cp\u003eThe Endpoints Frameworks command-line tool generates client library bundles, enabling Java or Android apps to access backend server APIs.\u003c/p\u003e\n"],["\u003cp\u003eThis tool automatically generates a Discovery document that outlines the API's structure, which is crucial for client interactions.\u003c/p\u003e\n"],["\u003cp\u003eClient library bundles can be generated in Maven, Gradle, or default formats, with each format catering to different project setups and providing necessary dependencies and build instructions.\u003c/p\u003e\n"],["\u003cp\u003eThe command-line tool requires compiled backend project binaries and allows options for specifying the build system, war directory, and output location, making customization easy.\u003c/p\u003e\n"],["\u003cp\u003eThe generated client libraries are compatible with Java 7+, Android 1.6+, and App Engine, ensuring wide applicability.\u003c/p\u003e\n"]]],[],null,["# Cloud Endpoints Frameworks for App Engine command-line tool\n\nThis page describes how to generate a client library from your backend server API by using the Endpoints Frameworks command-line tool. Any Java or Android app can use this library to call the API.\n\nYou can generate client library bundles that allow applications to access your\nAPI using the Endpoints Frameworks command-line tool. When you\ngenerate a client library, the Endpoints Frameworks command-line tool\nautomatically generates a\n[Discovery document](https://developers.google.com/discovery/v1/reference/apis)\nthat describes the surface of your API.\n\nTo get the Endpoints Frameworks command-line tool, download\n[`endpoints-framework-tools`](http://search.maven.org/remotecontent?filepath=com/google/endpoints/endpoints-framework-tools/2.2.1/endpoints-framework-tools-2.2.1.zip)\nfrom the [Maven Central Repository](http://search.maven.org/).\nAfter you extract the contents of the zip file, the tool is in the\n`endpoints-framework-tools-2.2.1/bin/` directory.\n\nGenerating a client library bundle from an API\n----------------------------------------------\n\nYou can use the Endpoints Frameworks command-line tool to generate the\nfollowing types of client bundles:\n\n- Maven: This bundle includes a `pom.xml` file with the\n Endpoints Frameworks and Google API Client Library dependencies.\n The `readme.html` file provides detailed information on what you need to add\n to your `pom.xml` file for different types of client\n applications and how to build a client library for your API using Maven.\n\n- Gradle: This bundle includes a `build.gradle` file with the\n Endpoints Frameworks and Google API Client Library dependencies.\n The `readme.html` file provides detailed information on what you need to add\n to your `build.gradle` file for different types of client applications and\n how to build a client library for your API using Gradle.\n\n- Default client bundle: This bundle contains all the dependency libraries and\n the generated `source.jar` file, which is the Java library that you use in\n your client to call your API. This bundle provides your client with all of\n the Google API Client Library capabilities, including OAuth. The\n `readme.html` file lists the `.jar` files that are required for different\n types of client applications and other details for using the client library.\n\nIf you are using the client library with an Android app, we recommend that you\nuse a Gradle client bundle.\n\n### Command-line syntax\n\nBefore you use the Endpoints Frameworks command-line tool, you must\nbuild your backend project because this tool requires compiled binaries. You can\noptionally supply the `--war=` option pointing to the build target output\ndirectory containing the `WEB-INF` directory and compiled java classes if you\ndon't want to use the default (`--war=\"./war\"`).\n\nThe basic syntax is as follows: \n\n```\n/path-to/endpoints-framework-tools-2.2.1/bin/endpoints-framework-tools \\\n get-client-lib OPTIONS CLASS_NAME\n```\n\nwhere:\n\n- \u003cvar translate=\"no\"\u003eOPTIONS\u003c/var\u003e, if supplied, is one or more items shown in the [Options table](#options).\n- \u003cvar translate=\"no\"\u003eCLASS_NAME\u003c/var\u003e is the fully qualified class name of your API.\n\nFor example: \n\n /path-to/endpoints-framework-tools-2.2.1/bin/endpoints-framework-tools \\\n get-client-lib --war=target/echo-1.0-SNAPSHOT -bs gradle com.example.echo.Echo\n\nwhere `target/echo-1.0-SNAPSHOT` is the relative or absolute path to the\ntarget build directory containing `WEB-INF` and the compiled backend classes.\n| **Note:** If your API is implemented from multiple classes, specify each of them separated by a space.\n\n### Options\n\nYou can use the following options:\n\n\n### Supported client platforms\n\nThe following platforms are supported in the client bundle produced by the\nEndpoints Frameworks command-line tool:\n\n- Java 7 and higher:\n- [Android](https://github.com/googleapis/google-api-java-client/wiki/Android) 1.6 and higher.\n- [App Engine](https://github.com/googleapis/google-api-java-client/wiki)."]]