This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// can create variables | |
private val TAG = "Root Project 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") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// can create variables | |
private val TAG = "Settings File: " | |
//can access rootProject object | |
rootProject.name = "GradleLearning" | |
//can access gradle object | |
val gradleVersion = gradle.gradleVersion | |
println("$TAG gradle version is $gradleVersion") | |
println("$TAG project name is ${rootProject.name}") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// can create variables | |
private val TAG = "Init Script: " | |
//can access gradle object | |
val gradleVersion = gradle.gradleVersion | |
println("$TAG gradle version is $gradleVersion") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
greetMessage="Hello World!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gradle(JVM) arguments | |
org.gradle.daemon=true | |
org.gradle.jvmargs=-Xmx2048m | |
# system properties | |
systemProp.gradle.wrapperUser=myuser | |
systemProp.gradle.wrapperPassword=mypassword | |
systemProp.greetMessageSystem="hello : System property" | |
# project properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// declare properties using set(key,value) of ext. | |
project.ext.set("greetMessage", " Good Morning") | |
// declare properties inside ext closure | |
project.ext { | |
set("greetMessage", "Good Morning") | |
set("greetMessage2", "Good Afternoon") | |
} | |
// access a property using its key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.repositories { | |
// repository links to locate project dependencies. | |
google() | |
jcenter() | |
} | |
project.dependencies { | |
// project dependencies | |
implementation("org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}") | |
testImplementation("junit:junit:4.12") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.buildscript { | |
// repository links to locate build script dependencies. | |
repositories { | |
google() | |
jcenter() | |
} | |
// build script dependencies | |
dependencies { | |
val kotlin_version = "1.3.61" | |
classpath("com.android.tools.build:gradle:4.0.0-alpha09") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rootProject.name = "GradleExperiment" | |
include(":app") | |
//include(":app", ":mylibrary1", ":mylibrary2", ":mylibrary3", ":mylibrary4") |
NewerOlder