The Google Plugin for Eclipse allows developers to import existing standalone Apps Script projects from Google Drive into a new Eclipse project. Scripts and HTML files in the project can be edited in Eclipse. When they are saved in the local Eclipse file system, the corresponding files are also updated on Google Drive.
The Google Plugin for Eclipse uses the publicly released Apps Script Import/Export API to integrate with Apps Script projects.
You will first need to sign in by clicking Sign in to Google in the bottom-left corner of Eclipse. After you've signed in, you can import an existing Apps Script project from Google Drive into your local workspace.
Importing a Project
To get started with a project, select File > Import, then select Apps Script Project under the Google group.
The Apps Script Project Import Wizard will then load and display all the projects that appear in your My Drive view. You can import projects for which you only have View access, but you will not be able to save those projects back to Google Drive.
Working with Projects
To create a new file in your project, use the File > New File menu option to
bring up the New File dialog. In this dialog, select the project where you want
the file created and give it a name to create the file. When you name the file,
ensure you use the correct file extension; as in the script editor, only
.html files are supported.
The Google Plugin for Eclipse includes the same autocomplete data as the script editor. When editing a file, press Ctrl+Space to see completion suggestions.
Suggestions for method calls are offered automatically as soon as you type a period in the appropriate context.
Since the Apps Script support for the Google Plugin for Eclipse is built with the public Google Drive API, the same limitations documented for the Import/Export API apply.
A few other limitations to be aware of while using the Google Plugin for Eclipse with Apps Script projects:
- Creating a new project in Eclipse is not supported. You can only import existing projects.
- Renaming the project in your workspace does not rename it in the script editor or Google Drive.
.htmlfiles that are to be saved back to Google Drive must be in the project's root folder. Other types of files, and files in subfolders of the Eclipse project, are not considered to be part of the Apps Script project on Google Drive.
- Autocomplete suggestions are not provided for libraries or advanced Google services.
- Autocomplete may not always reflect the methods most recently added to Apps Script. Any code valid in the script editor will still run correctly.