How to run GAS from Eclipse 4.3

不打扰是莪最后的温柔 提交于 2019-12-08 13:35:22

问题


I installed Eclipse and the Google Plugin according to

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

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

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

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?


回答1:


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

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

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

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

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

  2. 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]

  3. 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 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)

  4. 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.

  5. 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.



来源:https://stackoverflow.com/questions/23978419/how-to-run-gas-from-eclipse-4-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!