Skip to content

Instantly share code, notes, and snippets.

@shivam340
Created March 3, 2020 09:19
Show Gist options
  • Save shivam340/4f6b8661d68db682ef0a4518da70213a to your computer and use it in GitHub Desktop.
Save shivam340/4f6b8661d68db682ef0a4518da70213a to your computer and use it in GitHub Desktop.
Gradle Build Life Cycle - Module level build.gradle file
// can create variables
private val TAG = "App module build File: "
//can't set name here, available as read-only
//rootProject.name = "GradleLearning"
//can access gradle object
val gradleVersion = gradle.gradleVersion
println("$TAG gradle version is $gradleVersion")
/* In the app module or any sub module:
- It should only contain things like configuration, dependency and tasks specific to this module.
- Project instance is implicitly available in the file, so we can directly refer properties and methods available on it.
*/
println("$TAG project name is ${rootProject.name}")
println("$TAG project name is ${project.name}")
println("$TAG project name is $name")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment