From e1ed983e1939558bda271fdccd2e3964adbb4f22 Mon Sep 17 00:00:00 2001 From: Mohideen Imran Khan Date: Wed, 21 Aug 2019 23:08:21 +0800 Subject: [PATCH] Add stdio information to gradle tutorial Inform the readers of the ways they can resolve the exception that pops up when they try to run a program that takes in input from stdio through gradle. --- tutorials/gradleTutorial.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tutorials/gradleTutorial.md b/tutorials/gradleTutorial.md index 08292b11..3bd9da1a 100644 --- a/tutorials/gradleTutorial.md +++ b/tutorials/gradleTutorial.md @@ -59,6 +59,16 @@ You can click on the Gradle icon in the Gradle toolbar and create a new run conf ![Gradle icon](assets/GradleIcon.png) +Note that when you attempt to run a program that takes in data from the standard input, the program will fail with an exception. To resolve this, you can implement [Text UI Testing](textUiTestingTutorial.md). Alternatively, add the following lines to your `build.gradle`: + +```groovy +run { + standardInput = System.in +} +``` + +This will ensure that the program takes in input from the standard input. + ## Adding Plugins Gradle plugins are reusable units of build logic. Most common build tasks are provided as core plugins by Gradle. Given below are instructions on how to use some useful plugins: