如何从Eclipse 4.3运行GAS [英] How to run GAS from Eclipse 4.3

查看:65
本文介绍了如何从Eclipse 4.3运行GAS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根据

https://developers.google.com/eclipse/

https://developers.google.com/eclipse/docs/getting_started

https://developers.google.com/eclipse/docs/install-eclipse-4.3

我也从Google云端硬盘导入了GAS文件。它们显示为项目。

I also imported GAS files from my Google Drive. They show up as projects.

但是我找不到实际如何运行和发布应用程序的方法。
有人可以告诉我如何吗?

But I can't find how I can actually RUN and PUBLISH my application. Can anybody tell me how?

推荐答案

似乎可以从这里获得答案:使用Execution API

Seems maybe the answer can be obtained from here: Using the Execution API, on the Google App Scripts guide website.

尽管我不知道在Eclipse中需要执行什么操作才能将其与Google Execution API关联。

Although I don't know what needs to be done in Eclipse to connect this with the Google Execution API.

这是您在Google云端硬盘上需要做的:(我称Google App脚本编辑器:GSuite)

Here's what you need to do on the Google Drive side: (I call the Google App Scripts Editor: GSuite)

要了解以下许多步骤,请参见 Google目标Project for Execution API快速入门页

For understanding many of the following steps see the Google Target Project for Execution API quickstart page.


  1. 在GSuite中打开您要导入的项目。

  1. In GSuite open the project you intend to import.

设置所需的Google安全范围,如下所述:

2.1在GSuite中,选择文件->项目属性:范围选项卡。

2.2在eclipse中,根据2.1 [待完成]设置范围

Set the security scopes you want from google, as explained below:
2.1 In GSuite select File -> Project properties: Scopes tab.
2.2 In eclipse set the scopes according to 2.1 [To be completed]

将google项目设置为API可执行文件:< br>
3.1发布:在项目的GSuite中,选择发布->部署为API可执行文件,
3.1.1创建新版本并选择部署。
3.1.2记下您的脚本ID,或通过重新选择->部署为可执行文件再次查看它。

Set the google project as an API executable:
3.1 Publish: In GSuite in you project, select Publish->Deploy as API executable, 3.1.1 Create a new version and select Deploy. 3.1.2 Mark down your script id, or see it again by reselecting ->Deploy as executable.

3.2设置Google Developer Console项目:
3.2.1 开发者控制台项目在Google云中
3.2.2拥有应用程序(不确定其含义)和脚本共享相同的开发者控制台项目。 (不知道在哪里完成或如何完成)
3.2.3在开发者控制台项目中-启用 Google Apps脚本执行API
3.2.4在开发者控制台项目中-创建有效的客户端ID(不确定如何使用)

3.2 Set up a Google Developer Console Project: 3.2.1 Developer Console Project in the google cloud 3.2.2 Have the "app" (not sure what they mean) and the script share the same Developer console project. (Not sure where this is done or how) 3.2.3 In the Developer Console Project - Enable Google Apps Script Execution API 3.2.4 In the Developer Console Project - create a valid client ID (not sure how)

在开发控制台项目的应用程序代码中调用执行API。
4.1在应用程序代码中,使用您的clientID和范围创建一个OAuth访问令牌。
4.2在应用程序代码中,使用Google Execution REST API生成常规的POST请求,包括ScriptID,函数名称,函数参数(如果有)。
4.3发送POST请求以及标头中的OAuth令牌。
您可以使用客户端库服务或使用基本身份验证POST调用。
4.4最多允许执行6分钟。
4.5在应用程序代码中,如果需要返回脚本的返回值。

Call the Execution API, in the application code of the Dev Console Project. 4.1 In the application code, create an OAuth access token, with your clientID and scopes. 4.2 In the application code, build a regular POST request with the Google Execution REST API, including: ScriptID, function name, function parameters if any. 4.3 Send the POST request along with the OAuth token in the header. You can use the client library service or use a Basic Authentication POST call. 4.4 Allow up to 6 minutes for execution 4.5 In the application code, retrieve the script's return-value if any is expected.

设置蚀以通过执行API运行脚本...

Set up the eclipse to run your script via the execution API...

如果有人可以编辑我的答案并完成月食方面的说明,我将不胜感激。

If anybody can edit my answer and complete the instructions on the eclipse side I will be grateful.

这篇关于如何从Eclipse 4.3运行GAS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆