-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59a6232
commit 481285d
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 '?'` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.