Skip to content

Instantly share code, notes, and snippets.

@btforsythe
Last active January 12, 2019 19:02
Show Gist options
  • Save btforsythe/3aa58c17c7b43c1440d4286e39474bfb to your computer and use it in GitHub Desktop.
Save btforsythe/3aa58c17c7b43c1440d4286e39474bfb to your computer and use it in GitHub Desktop.
Downloading a repo then running a Java app class with a main method.

First, you must have gradle installed. (Use brew.)

git clone <repository_url>
cd <repository_name>
curl https://raw.githubusercontent.com/WeCanCodeIT/gradle-scripts/master/application-plugin/simple.gradle --output build.gradle
gradle run -Papp=<main_class_name>

<main_class_name> must include the package, if any.

If they've followed the instructions regarding what to name their app class, have the proper folder structure, etc this should be the same apart from the repository url for every student. At some point, I can pull this into a shell script.

Here's an example from the repository we put our in-class work into today (https://github.com/btforsythe/cooker-polymorphism-example). The class name with the main method is cooker.CookerApp:

git clone https://github.com/btforsythe/cooker-polymorphism-example
cd cooker-polymorphism-example
curl https://raw.githubusercontent.com/WeCanCodeIT/gradle-scripts/master/application-plugin/simple.gradle --output build.gradle
gradle run -Papp=cooker.CookerApp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment