Skip to content
This repository was archived by the owner on Jan 11, 2024. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c1b51d4

Browse files
authoredAug 17, 2020
Enable Data Binding using build feature block (#27)
* Library updates and minsdk Updated deprecated ViewModelProviders minsdk to 21 enabled databinding using buildFeatures * Update build.gradle * update jdk version. * Use Proerty syntax * New options to enable DataBinding using buildFeatures Android Gradle plugin 4.0.0, to optimize the build performance, introduces a new way to enable build features, such as Data Binding. This uses the buildFeatures block to enable the features. Minor Gradle updates Library updates Updated minSDK
1 parent f08ece8 commit c1b51d4

File tree

26 files changed

+136
-178
lines changed

26 files changed

+136
-178
lines changed
 

‎AndroidTrivia-Starter/app/build.gradle

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,11 @@ apply plugin: 'kotlin-android'
2121
apply plugin: 'kotlin-kapt'
2222

2323
android {
24-
compileSdkVersion 28
25-
dataBinding {
26-
enabled = true
27-
}
24+
compileSdkVersion 30
2825
defaultConfig {
2926
applicationId 'com.example.android.navigation'
3027
minSdkVersion 19
31-
targetSdkVersion 28
28+
targetSdkVersion 30
3229
vectorDrawables.useSupportLibrary = true
3330
versionCode 1
3431
versionName "1.0"
@@ -42,17 +39,17 @@ android {
4239
}
4340
productFlavors {
4441
}
42+
buildFeatures {
43+
dataBinding true
44+
}
4545
}
4646

4747
dependencies {
4848
implementation fileTree(include: ['*.jar'], dir: 'libs')
4949
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
5050
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
5151
implementation "androidx.appcompat:appcompat:$supportlibVersion"
52-
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha1'
53-
implementation 'androidx.legacy:legacy-support-v4:1.0.0-beta01'
54-
testImplementation 'junit:junit:4.12'
55-
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
56-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
57-
implementation "com.google.android.material:material:1.0.0-rc01"
52+
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-rc1'
53+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
54+
implementation "com.google.android.material:material:1.3.0-alpha02"
5855
}

‎AndroidTrivia-Starter/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ buildscript {
1919
ext {
2020
kotlin_version = '1.3.72'
2121
archLifecycleVersion = '1.1.1'
22-
gradleVersion = '4.0.0'
23-
supportlibVersion = '1.0.0-rc03'
22+
gradleVersion = '4.0.1'
23+
supportlibVersion = '1.2.0'
2424
dataBindingCompilerVersion = gradleVersion // Always need to be the same.
2525
}
2626
repositories {

‎DessertClicker-Starter/app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ apply plugin: 'com.android.application'
1818
apply plugin: 'kotlin-android'
1919

2020
android {
21-
compileSdkVersion 28
21+
compileSdkVersion 30
2222
defaultConfig {
2323
applicationId "com.example.android.dessertclicker"
2424
minSdkVersion 19
25-
targetSdkVersion 28
25+
targetSdkVersion 30
2626
versionCode 1
2727
versionName "1.0"
2828
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -34,14 +34,14 @@ android {
3434
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
3535
}
3636
}
37-
dataBinding {
38-
enabled = true
37+
buildFeatures {
38+
dataBinding true
3939
}
4040
}
4141

4242
dependencies {
4343
implementation fileTree(dir: 'libs', include: ['*.jar'])
4444
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
45-
implementation 'androidx.appcompat:appcompat:1.0.0'
46-
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
45+
implementation 'androidx.appcompat:appcompat:1.2.0'
46+
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-rc1'
4747
}

‎DessertClicker-Starter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ buildscript {
2424
jcenter()
2525
}
2626
dependencies {
27-
classpath 'com.android.tools.build:gradle:4.0.0'
27+
classpath 'com.android.tools.build:gradle:4.0.1'
2828
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2929

3030
// NOTE: Do not place your application dependencies here; they belong

‎DevBytes-starter/app/build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ apply plugin: "androidx.navigation.safeargs"
2121
apply plugin: 'kotlin-android-extensions'
2222

2323
android {
24-
compileSdkVersion 28
24+
compileSdkVersion 30
2525
defaultConfig {
2626
applicationId "com.example.android.devbyteviewer"
27-
minSdkVersion 19
28-
targetSdkVersion 28
27+
minSdkVersion 21
28+
targetSdkVersion 30
2929
versionCode 1
3030
versionName "1.0"
3131
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -38,8 +38,8 @@ android {
3838
}
3939
}
4040

41-
dataBinding {
42-
enabled = true
41+
buildFeatures {
42+
dataBinding true
4343
}
4444

4545
}
@@ -49,7 +49,7 @@ dependencies {
4949
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
5050

5151
// support libraries
52-
implementation 'androidx.appcompat:appcompat:1.0.2'
52+
implementation 'androidx.appcompat:appcompat:1.2.0'
5353
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
5454
implementation 'com.google.android.material:material:1.0.0'
5555

@@ -85,7 +85,7 @@ dependencies {
8585

8686
// arch components
8787
// ViewModel and LiveData
88-
def lifecycle_version = "2.2.0-alpha01"
88+
def lifecycle_version = "2.2.0"
8989
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
9090

9191
// logging

‎DevBytes-starter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ buildscript {
2323
jcenter()
2424
}
2525
dependencies {
26-
classpath 'com.android.tools.build:gradle:4.0.0'
26+
classpath 'com.android.tools.build:gradle:4.0.1'
2727
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2828
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0"
2929

‎GDGFinder-Starter/app/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,11 @@ apply plugin: 'kotlin-kapt'
2222
apply plugin: "androidx.navigation.safeargs"
2323

2424
android {
25-
compileSdkVersion 28
26-
dataBinding {
27-
enabled = true
28-
}
25+
compileSdkVersion 30
2926
defaultConfig {
3027
applicationId "com.example.android.gdgfinder"
3128
minSdkVersion 19
32-
targetSdkVersion 28
29+
targetSdkVersion 30
3330
versionCode 1
3431
versionName "1.0"
3532
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -44,6 +41,10 @@ android {
4441
androidExtensions {
4542
experimental = true
4643
}
44+
45+
buildFeatures {
46+
dataBinding true
47+
}
4748
}
4849

4950
dependencies {

‎GDGFinder-Starter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ buildscript {
2525
jcenter()
2626
}
2727
dependencies {
28-
classpath 'com.android.tools.build:gradle:4.0.0'
28+
classpath 'com.android.tools.build:gradle:4.0.1'
2929
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$version_kotlin"
3030
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$version_navigation"
3131
}

‎GuessTheWord-Starter/app/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ apply plugin: 'kotlin-android-extensions'
2121
apply plugin: "androidx.navigation.safeargs"
2222

2323
android {
24-
compileSdkVersion 28
24+
compileSdkVersion 30
2525
defaultConfig {
2626
applicationId "com.example.android.guesstheword"
2727
minSdkVersion 19
28-
targetSdkVersion 28
28+
targetSdkVersion 30
2929
versionCode 1
3030
versionName "1.0"
3131
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -37,21 +37,21 @@ android {
3737
}
3838
}
3939

40-
dataBinding {
41-
enabled = true
40+
buildFeatures {
41+
dataBinding true
4242
}
4343
}
4444

4545
dependencies {
4646
implementation fileTree(dir: 'libs', include: ['*.jar'])
4747
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
48-
implementation 'androidx.appcompat:appcompat:1.0.2'
48+
implementation 'androidx.appcompat:appcompat:1.2.0'
4949
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
5050
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
5151
testImplementation 'junit:junit:4.12'
5252

5353
// KTX
54-
implementation 'androidx.core:core-ktx:1.0.1'
54+
implementation 'androidx.core:core-ktx:1.3.1'
5555

5656
// Navigation
5757
implementation "android.arch.navigation:navigation-fragment-ktx:1.0.0"

‎GuessTheWord-Starter/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ buildscript {
2323
jcenter()
2424
}
2525
dependencies {
26-
classpath 'com.android.tools.build:gradle:4.0.0'
26+
classpath 'com.android.tools.build:gradle:4.0.1'
2727
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
2828
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0"
2929

‎RecyclerViewClickHandler-Starter/app/build.gradle

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ apply plugin: 'kotlin-kapt'
2121
apply plugin: 'androidx.navigation.safeargs'
2222

2323
android {
24-
compileSdkVersion 28
24+
compileSdkVersion 30
2525
defaultConfig {
2626
applicationId "com.example.android.trackmysleepqualityrecyclerview"
2727
minSdkVersion 19
28-
targetSdkVersion 28
28+
targetSdkVersion 30
2929
versionCode 1
3030
versionName "1.0"
3131
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -39,8 +39,8 @@ android {
3939
}
4040

4141
// Enables data binding.
42-
dataBinding {
43-
enabled = true
42+
buildFeatures {
43+
dataBinding true
4444
}
4545

4646
}
@@ -51,18 +51,18 @@ dependencies {
5151
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
5252

5353
// Support libraries
54-
implementation "androidx.appcompat:appcompat:1.0.0"
55-
implementation "androidx.fragment:fragment:1.0.0"
56-
implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha2"
54+
implementation "androidx.appcompat:appcompat:1.2.0"
55+
implementation "androidx.fragment:fragment:1.2.5"
56+
implementation "androidx.constraintlayout:constraintlayout:2.0.0-rc1"
5757

5858
// Android KTX
59-
implementation 'androidx.core:core-ktx:1.0.1'
59+
implementation 'androidx.core:core-ktx:1.3.1'
6060

6161
// Room and Lifecycle dependencies
6262
implementation "androidx.room:room-runtime:$room_version"
6363
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
6464
kapt "androidx.room:room-compiler:$room_version"
65-
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
65+
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
6666

6767
// Coroutines
6868
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version"
@@ -71,10 +71,5 @@ dependencies {
7171
// Navigation
7272
implementation "android.arch.navigation:navigation-fragment-ktx:$navigationVersion"
7373
implementation "android.arch.navigation:navigation-ui-ktx:$navigationVersion"
74-
75-
// Testing
76-
testImplementation 'junit:junit:4.12'
77-
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
78-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
7974
}
8075

‎RecyclerViewClickHandler-Starter/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ buildscript {
2121
ext {
2222
kotlin_version = '1.3.72'
2323
archLifecycleVersion = '1.1.1'
24-
room_version = '2.0.0'
25-
coroutine_version = '1.0.0'
26-
gradleVersion = '4.0.0'
27-
navigationVersion = '1.0.0-alpha07'
24+
room_version = '2.2.0'
25+
coroutine_version = '1.3.7'
26+
gradleVersion = '4.0.1'
27+
navigationVersion = '1.0.0'
2828
dataBindingCompilerVersion = gradleVersion // Always need to be the same.
2929
}
3030

‎RecyclerViewDiffUtilDataBinding-Starter/app/build.gradle

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ apply plugin: 'kotlin-kapt'
2121
apply plugin: 'androidx.navigation.safeargs'
2222

2323
android {
24-
compileSdkVersion 28
24+
compileSdkVersion 30
2525
defaultConfig {
2626
applicationId "com.example.android.trackmysleepqualityrecyclerview"
2727
minSdkVersion 19
28-
targetSdkVersion 28
28+
targetSdkVersion 30
2929
versionCode 1
3030
versionName "1.0"
3131
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -39,8 +39,8 @@ android {
3939
}
4040

4141
// Enables data binding.
42-
dataBinding {
43-
enabled = true
42+
buildFeatures {
43+
dataBinding true
4444
}
4545

4646
}
@@ -51,18 +51,18 @@ dependencies {
5151
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
5252

5353
// Support libraries
54-
implementation "androidx.appcompat:appcompat:1.0.0"
55-
implementation "androidx.fragment:fragment:1.0.0"
56-
implementation "androidx.constraintlayout:constraintlayout:2.0.0-alpha2"
54+
implementation "androidx.appcompat:appcompat:1.2.0"
55+
implementation "androidx.fragment:fragment:1.2.5"
56+
implementation "androidx.constraintlayout:constraintlayout:2.0.0-rc1"
5757

5858
// Android KTX
59-
implementation 'androidx.core:core-ktx:1.0.1'
59+
implementation 'androidx.core:core-ktx:1.3.1'
6060

6161
// Room and Lifecycle dependencies
6262
implementation "androidx.room:room-runtime:$room_version"
6363
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
6464
kapt "androidx.room:room-compiler:$room_version"
65-
implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
65+
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
6666

6767
// Coroutines
6868
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version"
@@ -71,10 +71,5 @@ dependencies {
7171
// Navigation
7272
implementation "android.arch.navigation:navigation-fragment-ktx:$navigationVersion"
7373
implementation "android.arch.navigation:navigation-ui-ktx:$navigationVersion"
74-
75-
// Testing
76-
testImplementation 'junit:junit:4.12'
77-
androidTestImplementation 'androidx.test:runner:1.1.0-alpha4'
78-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
7974
}
8075

‎RecyclerViewDiffUtilDataBinding-Starter/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ buildscript {
2121
ext {
2222
kotlin_version = '1.3.72'
2323
archLifecycleVersion = '1.1.1'
24-
room_version = '2.0.0'
25-
coroutine_version = '1.0.0'
26-
gradleVersion = '4.0.0'
27-
navigationVersion = '1.0.0-alpha07'
24+
room_version = '2.2.0'
25+
coroutine_version = '1.3.7'
26+
gradleVersion = '4.0.1'
27+
navigationVersion = '1.0.0'
2828
dataBindingCompilerVersion = gradleVersion // Always need to be the same.
2929
}
3030

0 commit comments

Comments
 (0)
This repository has been archived.