Skip to main content

Gradle





build.gradle


Gradle builds a script file for handling two things; one is projects and another one is tasks.

task hello {
   doLast {
      println 'tutorialspoint'
   }
}     C:\> gradle –q hello

The Gradle script mainly uses two real Objects; 

  • Project Object 
  • Script Object.

Project Object − Each script describes about one or multiple projects. While in the execution, this script configures the Project Object. You can call some methods and use property in your build script which are delegated to the Project Object.
Script Object − Gradle takes script code into classes, which implements Script Interface and then executes. This means that of all the properties and methods declared by the script interface are available in your script.


Sr. No.NameTypeDefault Value
1projectProjectThe Project instance
2nameStringThe name of the project directory.
3pathStringThe absolute path of the project.
4descriptionStringA description for the project.
5projectDirFileThe directory containing the build script.
6buildDirFileprojectDir/build
7groupObjectUnspecified
8versionObjectUnspecified
9antAntBuilderAn AntBuilder instance


If you think task works similar to ANT’s target, then that’s right - Gradle task is equivalent to ANT target.

task hello << {
   println 'tutorialspoint'
}

task upper << {
   String expString = 'TUTORIALS point'
   println "Original: " + expString
   println "Upper case: " + expString.toUpperCase()}
C:\> gradle –q upper

Gradle build script describes one or more Projects. 


Each project is made up of different tasks. 

A task is a piece of work which a build performs.

 The task might be compiling 
  • some classes,
  • storing class files into separate target folder, 
  • creating JAR, 
  • generating Javadoc, 
  • or publishing some archives to repositories.


















Comments

Popular posts from this blog

The BattleGround

Last Sunday while zapping the channels of my idiot box I chanced upon to watch one of the greatest epic of our times –MAHABHARAT. It did’nt take me much time to recall the waves that it created across the nation- when it was telecasted for the first time.I was too young to comprehend it,yet I used to watch it with paramount interest,sitting next to dad & imitating his stimuli to what character speaks Later in my teens ,unlike most of my friends who used to enjoy watching top tens & horror shows , I was inundated to discover that zee was going to re telecast Mahabharat .This time, I was grown up enough to understand it,so I religiously watched all the episodes with same interest. Watching such an epic in formative years has great influence on one’s approach towards life .Today to me ,Mahabharat isn’t just another epic but it is a thinking process, where the mind is the battleground, THE KURUSHETRA ,where all kind of thoughts hover, the state of mind that we...

WHERE THE MIND IS WITHOUT FEAR !

(Painting By Takshila Vidushi) "Where the mind is without fear & the head is held high Where knowledge is free Where the world hasn't been broken up into fragments By narrow domestic walls Where words come out from the depth of truth Where tireless striving stretches its arms towards perfection ! Where the clear stream of reason has not lost its way Into the dreary desert sand of dead habit Where the mind is led forward by thee Into ever-widening thought and action Into that heaven of freedom, my Father, let my country awake." By Guru RabindraNath Tagore (Ever since childhood this poem of RabindraNath Tagore has been synonmous to supreme level of perfection for me.Its incredibl...

GraphQL

What is GraphQL  API Standard invented & open-sourced by Facebook Alternative to  REST API  enables declarative data fetching  exposes single endpoint & responds to queries How it works?  Why Graphql? Improvises performance by reducing the data that is to be transferred over the internet Variety of different frontend frameworks and platforms on client-side Fast development speed & expectation for rapid feature development Why Graphql is better than REST? Flexibility & efficient  No more over /under fetching of data Over fetching : Under fetching: Insightful analytics  Schema serves as contract between client and server CORE CONCEPTS : SDL :SCHEMA DEFINITION LANGUAGE Writing Data with mutations 3 kinds of mutations creating new data updating existing data deleting existing data