Skip to content

Commit

Permalink
Version 1.0.0-alpha01
Browse files Browse the repository at this point in the history
  • Loading branch information
handstandsam committed Dec 3, 2021
1 parent 59a6232 commit 481285d
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Saydle - "Say Gradle"
Saydle is a Wrapper for the Gradle Wrapper that notifies you via the OSX "say" command whether a task failed or succeded.

# Why?
Knowing when a Gradle build is done is super helpful when there are long running tasks. This allows you to be notified instead of checking the terminal.

[![Tweet about Using the Say Command with Gradle](static/saydle-tweet.png)](https://twitter.com/HandstandSam/status/1463207029007339520)

# Installation Instructions
* Download the [`saydlew`](https://github.com/handstandsam/saydle/blob/main/saydle) file and put it next to your `gradlew` file in the root of your Gradle project.

# Usage
* Instead of using `./gradlew`, use `./saydlew` instead. That's it!
* Example: `./saydlew app:assembleDebug`

# Configuration

* success_phrase="Success"
* failed_phrase="Failed"
* voice="Alex"

## Aternate Voices for the "say" Command
[OSX Say Command Documentation](https://ss64.com/osx/say.html)

**Available English Speaking Voices**
```
Alex en_US # Most people recognize me by my voice.
Fred en_US # I sure like being inside this fancy computer
Samantha en_US # Hello, my name is Samantha. I am an American-English voice.
Victoria en_US # Isn't it nice to have a computer that will talk to you?
```

**Other Languages**
Find other voices by running: `say -v '?'`
29 changes: 29 additions & 0 deletions saydlew
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env sh
# License: Apache 2.0
# Source: https://github.com/handstandsam/saydle/
# Version: 1.0.0-alpha01

# Customizations
success_phrase="Success"
failed_phrase="Failed"
voice="Alex"

# Script
orig_gradew_args="" # Will store all the arguments sent to ./saydlew

# Loop through all the arguments sent to ./saydlew to keep them
for var in "$@"; do
if [[ $var > 1 ]]; then
orig_gradew_args+="$var "
fi
done
gradlew_cmd="./gradlew $orig_gradew_args" # Gradlew Command
success_cmd="say -v $voice \"$success_phrase\"" # On Success
failed_cmd="say -v $voice \"$failed_phrase\"" # On Failure
full_cmd="$gradlew_cmd && $success_cmd || $failed_cmd" # Command to Execute

echo "Executing: $gradlew_cmd"
echo "Saydle will say \"$success_phrase\" ✅ or \"$failed_phrase\" ❌ on completion."

# Execute
eval $full_cmd
Binary file added static/saydle-tweet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 481285d

Please sign in to comment.