---Advertisement---
Gradle - Fabricating Systems

Gradle – Fabricating Systems Interview Question-Answer

By smart_answer13

Updated on:

---Advertisement---

Q.1 To execute the hello task in the build file, type ___ on the command line.

       A. gradle hello or gradle -q hello

       B. gradle hello

       C. gradle -q hello

       D. gradle task hello

Ans : gradle hello or gradle -q hello


Q.2 Consider the following gradle build script:

task a{
 ext.myProperty = “Hello”
}
task b{
 doLast {
  println a.myProperty
   println c.myProperty
}}
task c(dependsOn: b){
ext.myProperty = “Hey”
println “Hi”}

If the task gradle -q c is run, what is the output?

       A. Hey Hello Hi

       B. Hi Hello Hey

       C. Hello Hey

       D. Hello Hey Hi

Ans : Hi Hello Hey


Q.3 Gradle build scripts are written in _________.

       A. Groovy

       B. Groovy or Kotlin

       C. Scala

       D. Kotlin

Ans : Groovy or Kotlin


Q.4 Gradle tasks can also be created and extended dynamically at runtime.

       A. True

       B. False

Ans : True


Q.5 Gradle build scripts use a combination of declarative and imperative statements.

       A. True

       B. False

Ans : True


Q.6 Jobs are the unit of execution in Jenkins.

       A. True

       B. False

Ans : True


Q.7 In Gradle, a disabled task is labelled as _________.

       A. ABORTED

       B. STOPPED

       C. DISABLED

       D. SKIPPED

Ans : DISABLED


Q.8 Consider the following gradle build script:

task a { doLast { println ‘A’ }
}
task b(dependsOn: a)
{ doLast { println ‘B’ }
}
task c(dependsOn: a)
{ doLast { println ‘C’ }
}

If the task gradle -q c is run, what is the output?

       A. A C C

       B. A C

       C. A C B

       D. A

Ans : A C


Q.9 Multiline comments in Gradle build files are included using _____ .

       A. /* Multi line/*

       B. //Multi line

       C. /* Multi line */

       D. All the options

Ans : /* Multi line */


Q.10 Which plugins are configured while integrating gradle with Jenkins?

       A. Only Gradle plugin

       B. Gradle Plugin and Java plugin

       C. Gradle Plugin And plugin of repository used

       D. None of the options

Ans : Gradle Plugin And plugin of repository used


Q.11 The plugins provided by jenkins supports ____.

       A. deployment of projects

       B. Build of projects

       C. automation of projects

       D. All the options

Ans : All the options


Q.12 Which of the following statement is true about Jenkins?

       A. Open source tool

       B. Continuous integration tool

       C. Supports plugins

       D. All the options

Ans : All the options


Q.13 Which of the following statement is true about Jenkins?

       A. Jenkins supports plugins to showcase both metrics and trends.

       B. Jenkins supports plugins to depict trends only.

       C. Jenkins supports plugins to report metrics only.

       D. None of the options

Ans : Jenkins supports plugins to showcase both metrics and trends.


Q.14 Which are the two types of plugins in Gradle?

       A. binary and resolve

       B. script and resolve

       C. resolve and apply

       D. script and binary

Ans : script and binary


Q.15 The two build files generated by Android Studio are in ________________.

       A. build directory

       B. root folder of project and build directory

       C. root folder of project and app directory

       D. root folder of project

Ans : root folder of project and app directory


Q.16 The external dependencies for the build script are defined using ___________.

       A. version number

       B. name of the organization that created the dependency

       C. name of the dependency

       D. All the options mentioned

Ans : All the options mentioned


Q.17 Which of the following is a quality plugin of Gradle?

       A. Sonar Runner

       B. PMD

       C. Checkstyle

       D. All the options

Ans : All the options


Q.18 Applying the Application plugin also implicitly applies the Java plugin.

       A. True

       B. False

Ans : True


Q.19 Gradle wrapper makes the execution of the build independent of the installed Gradle version.

       A. True

       B. False

Ans : True


Q.20 Finalizer tasks are automatically added to the task graph when the finalized task is scheduled to run.

       A. True

       B. False

Ans : True


Q.21 The war plugin enables the default JAR archive generation of the Java plugin.

       A. True

       B. False

Ans : False


Q.22 Which of the following statements are true?

       A. Only Ant script can be migrated to Gradle build script.

       B. Only Maven script can be migrated to Gradle build script.

       C. Ant or Maven script can be migrated to Gradle build script.

       D. Ant or Maven script cannot be migrated to Gradle build script.

Ans : Ant or Maven script can be migrated to Gradle build script.


Q.23 In Gradle, JAR files are published to _________.

       A. multiple locations

       B. remote location

       C. local directory

       D. All the options mentioned

Ans : All the options mentioned


Q.24 The scala plugin applied in the Gradle can deal with ____________.

       A. pure Java code

       B. Scala code

       C. mixed Scala and Java code

       D. All the options

Ans : All the options


Q.25 Gradle supports multiple project templates called archetypes ________.

       A. True

       B. False

Ans : False


Q.26 Gradle requires a Java JDK or JRE and Groovy to be installed.

       A. True

       B. False

Ans : False


Q.27 Lifecycle tasks typically have task actions.

       A. True

       B. False

Ans : False


Q.28 Java plugin is a binary plugin.

       A. True

       B. False

Ans : True


Q.29 The build task added by the Java plugin ___________.

       A. Performs assembling of JAR files

       B. Performs build of archives in the project

       C. Performs a full build of the project.

       D. Assembles production class library

Ans : Performs a full build of the project.


Q.30 While building a Java project with gradle, the JAR files are created in _______ after the execution of gradle build command.

       A. build/classes

       B. build/tmp/jar

       C. build/libs

       D. build/tmp

Ans : build/libs


Q.31 Which of the following is Gradle’s in-built task?

       A. Rename task

       B. Copy task

       C. Zip task

       D. All the options

Ans : All the options


Q.32 The first line added in the build script to make the Android plug-in available for a Gradle build is ____________.

       A. apply plugin: ‘com.android’

       B. apply plugin: ‘android’

       C. apply plugin: ‘com.application.android’

       D. apply plugin: ‘com.android.application’

Ans : apply plugin: ‘com.android.application’


Q.33 Gradle Build Init plugin is an automatically applied plugin.

       A. True

       B. False

Ans : True


Q.34 Gradle dependencies are stored in builds.

       A. True

       B. False

Ans : False


Q.35 Gradle is a _______ based build tool.

       A. JVM

       B. .NET

       C. Javascript

       D. C#

Ans : JVM


Q.36 When Gradle plugins are applied to a project, it is possible to _____________.

       A. Create new tasks

       B. Extend build language

       C. Support additional languages

       D. All the options mentioned

Ans : All the options mentioned


Q.37 Which task is added by wrapper plugin to the project?

       A. wrapperDependencies

       B. assemble

       C. wrapperDependencies or wrapper

       D. wrapper

Ans : wrapper


Q.38 Gradle is an imperative build tool.

       A. True

       B. False

Ans : False


Q.39 The wrapper plugin can be auto-applied to the root project of the current build without modifying the build.gradle file.

       A. True

       B. False

Ans : True


Q.40 In Gradle, the Java plugin searches for Java production source code in the directory ___________.

       A. src/main/resources

       B. src/test/java

       C. src/java/resources

       D. src/main/java

Ans : src/main/java


Q.41 Which of the following is Gradle’s in-built task?

       A. Copy task

       B. Zip task

       C. Rename task

       D. All the options

Ans : All the options


Q.42 Which task is executed to use Gradle Build Init plugin?

       A. skipping

       B. init

       C. standard or init

       D. standard

Ans : init


Q.43 To build Android project, which version of gradle is required?

       A. Gradle 1.12 and above

       B. Gradle 2.2.1 and above

       C. Gradle 1.7 and above

       D. Gradle 2.1 and above

Ans : Gradle 2.2.1 and above


Q.44 In Gradle, the Java plug-in provides tasks to __________.

       A. run unit tests

       B. create Javadoc and JAR file

       C. compile Java source code

       D. All the options

Ans : All the options


smart_answer13

---Advertisement---

Related Post

Leave a Comment