0 votes
in Gradle by
  • Gradle quiz with answers
  • Gradle mcq
  • Gradle vs maven
  • Gradle tutorial
  • Gradle scripts are mcq
  • Gradle - fabricating systems quiz
  • Maven interview questions
  • What is gradle wrapper 
  • Gradle Questions and Answers , Top List of Gradle Questions
  • Gradle – Fabricating Systems Interview Question-Answer

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

Related questions

0 votes
asked May 27, 2019 in Gradle by Ankita1283
0 votes
asked May 27, 2019 in Gradle by Ankita1283
...