https://github.com/nosix/kotlin-gas-example
An example of a project that uses Kotlin/JS to edit Google Apps Script.
https://github.com/nosix/kotlin-gas-example
Last synced: 2 months ago
JSON representation
An example of a project that uses Kotlin/JS to edit Google Apps Script.
- Host: GitHub
- URL: https://github.com/nosix/kotlin-gas-example
- Owner: nosix
- License: apache-2.0
- Created: 2020-10-20T09:31:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2020-10-20T09:57:21.000Z (over 4 years ago)
- Last Synced: 2025-01-02T11:09:15.047Z (4 months ago)
- Language: Kotlin
- Homepage:
- Size: 62.5 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Usage
## Setup
1. Set Google Apps Script URL to `scriptUrl` in `build.gradle.kts`.
1. Install node modules and generate external APIs.
```shell script
./gradlew generateExternalsMinimal
```It generates `build/js/node_modules` and `src/main/kotlin/externals`.
1. Clone Google Apps Script project.
```shell script
./gradlew claspLogin
./gradlew claspClone
```It needs `build/js/node_modules/.bin/clasp`.
# Edit
1. Edit source code in `src/main/kotlin`.
1. Build `dist`.
```shell script
./gradlew compileKotlinJs
```1. Push `dist` to Google Apps Script project.
```shell script
./gradlew claspPush
```## Test
1. Add a script into Google Apps Script project.
```javascript
function myFunction() {
example.printHello();
example.printActiveSheetName();
}
```1. Run `myFunction`.
1. Check log.
Note: `printActiveSheetName` function needs Spreadsheet.