- Advanced development process with apps [link]
- Gapps [link]
- Google Credentials [link]
- Start with a generic Gradle/Angular project
npm install
install all required dependancies- Create a new Dev Console Project
- Use this link to create the project. It will auto-activate the Google Drive API.
- Make sure Create a New Project is selected and hit Continue.
- Once the project has been created, click Go to Credentials.
- Acquire Google Drive Client Secret Credentials
- Select Add credentials, choose the OAuth 2.0 client ID type
- Click Configure Consent Screen.
- Select your email address from the dropdown and assign your add-on a Project Name.
- Save your Consent Screen
- In the menu that appears, choose Other for the Application type.
- Give it any name you like and click Create.
- Finally, download your credentials using the Download as JSON button to the right.
- Authenticate gapps
- Run
./bin/gapps.sh auth path/to/client_secret_abcd.json
- Follow the directions by clicking on the link generated by the script. You can pass the option --no-launch-browser to generate a url that will give you a code to paste back into the console. This is useful if you're using ssh to develop.
- Initialise project
- Head to https://script.google.com and create a new blank project.
- Save the mostly empty project and give it a name.
- Saving is important; the project is not in your Google Drive until it is saved.
- Get your project ID from the address bar, located after /d/ and before /edit. For example, '//script.google.com/a/google.com/d/abc123-xyz098/edit?usp=drive_web'
- Navigate to a directory where your Apps Script project will live
- Run
./bin/gapps init <fileId>
within your project directory. - Develop GApps scripts
- Run Gradle's
other/gappsPush
task to push changes onto Google Apps
- The instructions suggest installing the gapps globally (i.e. using -g flag). This is totally fine for development purposes on one machine but having clearly controlled development environment may prove difficult with global approach. A better choice is to call the gapps using a symlink within the project’s scope.
- Upload command takes all *.html & *.gs files and then uploads onto the cloud at the projects level where
gapps init
was run.