Gradle is an open source build automation system that builds upon the concepts of Apache And and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration. Gradle uses a directed acyclic graph (“DAG”) to determine the order in which tasks can be run.
Gradle was designed for multi-project builds which can grow to be quite large, and supports incremental builds by intelligently determining which parts of the build tree are up-to-date, so that any task dependent upon those parts will not need to be re-executed.
The initial plugins are primarily focused around Java, Groovy and Scala development and deployment, but more languages and project workflows are on the roadmap.
You can explore the configuration file of Gradle in Android Studio with Android tab view. Here the following image show the path of Gradle file.
And you can also view the contents of file by double-clicking on it and the contents looks pretty much like this.
And here my gradle code…
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.3.2' } } apply plugin: 'com.android.application' repositories { jcenter() } dependencies { compile "com.android.support:support-v4:25.3.1" compile "com.android.support:gridlayout-v7:25.3.1" compile "com.android.support:cardview-v7:25.3.1" compile "com.android.support:appcompat-v7:25.3.1" compile 'com.android.support:recyclerview-v7:25.3.1' } // The sample build uses multiple directories to // keep boilerplate and common code separate from // the main sample code. List<String> dirs = [ 'main', // main sample code; look here for the interesting stuff. 'common', // components that are reused by multiple samples 'template'] // boilerplate code that is generated by the sample template process android { compileSdkVersion 25 buildToolsVersion "25.0.3" defaultConfig { minSdkVersion 15 targetSdkVersion 25 } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } sourceSets { main { dirs.each { dir -> java.srcDirs "src/${dir}/java" res.srcDirs "src/${dir}/res" } } androidTest.setRoot('tests') androidTest.java.srcDirs = ['tests/src'] } } |
NOTE : Your gradle code may be different from mine. It’s depending upon your project requirements and imported libraries.