Build Automation Gradle Interview Questions


What does the command ./gradlew do when it is run from within a Gradle project’s directory?
– It runs the Gradle Wrapper.

What does a smoke test do?
– Tests large-scale, basic things like whether or not the application runs.

What can you use to take advantage of pre-built Gradle tasks created by the Gradle community?
– Gradle plugins

Which of the following are the kinds of tasks build automation tools usually handle? (Choose all that apply)

– Compiling code
– Packaging the app for deployment
– Dependency management

What does Gradle do?
– Build Automation

Which type of testing tests the smallest amount of code in a single test?
– Unit test

Which of the following does declaring a dependency between two tasks in Gradle do? (Choose all that apply)

– It ensures that when a task is called, the task that it depends on also runs.
– It ensures that if both tasks are run, the task which is a dependency will always run before the one that depends on it.
What software does Gradle require to be installed on a system before it can run?
– Java JDK 7 or higher

What does build automation do?
– It automates the process of processing source code in preparation for deployment.

How to install and run the Gradle Wrapper


To install and run the Gradle Wrapper

mkdir my-project
cd my-project
gradle wrapper
./gradlew build

Install-Gradel-Wrapper

[root@aryan-34252e5f2 ~]# mkdir my-project
[root@aryan-34252e5f2 ~]# cd my-project
[root@aryan-34252e5f2 my-project]# gradle wrapper
Starting a Gradle Daemon (subsequent builds will be faster)

BUILD SUCCESSFUL in 6s
1 actionable task: 1 executed
[root@aryan-34252e5f2 my-project]# ./gradlew build
Downloading https://services.gradle.org/distributions/gradle-4.7-bin.zip
……………………………………………………………..

> Task :buildEnvironment

————————————————————
Root project
————————————————————

classpath
No dependencies

A web-based, searchable dependency report is available by adding the –scan option.

BUILD SUCCESSFUL in 6s
1 actionable task: 1 executed
[root@aryan-34252e5f2 my-project]#