From 243808ac8240ad8aa702a31c45444ef45d11a183 Mon Sep 17 00:00:00 2001 From: Josh Ashton Date: Fri, 23 Jun 2023 14:52:33 -0600 Subject: [PATCH] run script updated for Gradle support --- newproject | 2 +- run | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/newproject b/newproject index eaf7eb4..2f3ea74 100755 --- a/newproject +++ b/newproject @@ -103,7 +103,7 @@ elif [[ $LANG == "java" ]]; then mkdir $NAME; cd $NAME; mark; # Bookmark new project. - gradle init + gradle7 init # Create a new HTML, CSS, JS project. elif [[ $LANG == "html" ]]; then diff --git a/run b/run index a604f19..8d1a634 100755 --- a/run +++ b/run @@ -8,6 +8,7 @@ if [[ $# -gt 1 ]]; then echo "Proper usage: run {file}" echo " eg. run" echo " eg. run main" + echo " eg. run --gradle" echo " eg. run -h" echo " eg. run --help" @@ -24,6 +25,7 @@ elif [[ $1 == "-h" || $1 == "--help" ]]; then echo " run" echo " run [filename]" echo " eg. run main" + echo " run --gradle" echo " run -h" echo " run --help\n" echo "Supported languages: $TYPES" @@ -104,13 +106,13 @@ elif [[ $TYPE == "cs" ]]; then # Run Java app. elif [[ $TYPE == "java" ]]; then clear - CP=.:../lib/* echo "Compiling..." javac -cp $CP *.java echo "Output..."; java -cp $CP $NAME $ARGS rm *.class + # Run JavaScript app. elif [[ $TYPE == "js" ]]; then clear @@ -126,6 +128,12 @@ elif [[ $TYPE == "go" ]]; then ./discordo #TODO: need to dynamically obtain the newly created object file to run and then delete rm discordo +# Run app through Gradle +elif [[ $1 == "--gradle" ]]; then + clear; + echo "Output..." + ./gradlew run + else read "?Language is not supported. Create a GH issue (y/n, default y): " GH if [[ $GH == "y" || $GH == "" ]]; then