Skip to content

Commit 3ce11bc

Browse files
authored
chore(*): add jetpack compose dependencies (#1407)
1 parent e3c0439 commit 3ce11bc

File tree

14 files changed

+415
-46
lines changed

14 files changed

+415
-46
lines changed

admob/app/build.gradle

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,20 @@ plugins {
77
check.dependsOn 'assembleDebugAndroidTest'
88

99
android {
10-
compileSdkVersion 33
10+
compileSdk 33
1111

1212
defaultConfig {
1313
applicationId "com.google.samples.quickstart.admobexample"
14-
minSdkVersion 19
15-
targetSdkVersion 33
14+
minSdk 21 // minSdk would be 19 without compose
15+
targetSdk 33
1616
versionCode 1
1717
versionName "1.0"
1818
multiDexEnabled true
1919

2020
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
21+
vectorDrawables {
22+
useSupportLibrary true
23+
}
2124
}
2225

2326
buildTypes {
@@ -35,6 +38,17 @@ android {
3538

3639
buildFeatures {
3740
viewBinding = true
41+
compose true
42+
}
43+
compileOptions {
44+
sourceCompatibility JavaVersion.VERSION_1_8
45+
targetCompatibility JavaVersion.VERSION_1_8
46+
}
47+
kotlinOptions {
48+
jvmTarget = '1.8'
49+
}
50+
composeOptions {
51+
kotlinCompilerExtensionVersion '1.3.0'
3852
}
3953
}
4054

@@ -46,6 +60,7 @@ dependencies {
4660
implementation 'androidx.browser:browser:1.0.0'
4761
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.2'
4862
implementation 'androidx.navigation:navigation-ui-ktx:2.5.2'
63+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
4964

5065
implementation 'com.google.android.gms:play-services-ads:21.2.0'
5166

@@ -56,9 +71,18 @@ dependencies {
5671
// for Google Analytics. This is recommended, but not required.
5772
implementation 'com.google.firebase:firebase-analytics'
5873

74+
// Jetpack Compose
75+
implementation "androidx.compose.ui:ui:$compose_version"
76+
implementation "androidx.compose.material:material:$compose_version"
77+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
78+
implementation 'androidx.activity:activity-compose:1.5.1'
79+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
80+
5981
debugImplementation "androidx.fragment:fragment-testing:1.5.2"
6082
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
6183
androidTestImplementation 'androidx.test:rules:1.4.0'
6284
androidTestImplementation 'androidx.test:runner:1.4.0'
6385
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
86+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
87+
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
6488
}

analytics/app/build.gradle

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@ plugins {
77
check.dependsOn 'assembleDebugAndroidTest'
88

99
android {
10-
compileSdkVersion 33
10+
compileSdk 33
1111

1212
defaultConfig {
1313
applicationId "com.google.firebase.quickstart.analytics"
14-
minSdkVersion 19
15-
targetSdkVersion 33
14+
minSdk 21 // minSdk would be 19 without compose
15+
targetSdk 33
1616
versionCode 1
1717
versionName "1.0"
1818
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
1919
multiDexEnabled true
20+
vectorDrawables {
21+
useSupportLibrary true
22+
}
2023
}
2124

2225
buildTypes {
@@ -28,6 +31,22 @@ android {
2831

2932
buildFeatures {
3033
viewBinding = true
34+
compose true
35+
}
36+
compileOptions {
37+
sourceCompatibility JavaVersion.VERSION_1_8
38+
targetCompatibility JavaVersion.VERSION_1_8
39+
}
40+
kotlinOptions {
41+
jvmTarget = '1.8'
42+
}
43+
composeOptions {
44+
kotlinCompilerExtensionVersion '1.3.0'
45+
}
46+
packagingOptions {
47+
resources {
48+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
49+
}
3150
}
3251
}
3352

@@ -40,6 +59,7 @@ dependencies {
4059
implementation "androidx.preference:preference-ktx:1.2.0"
4160
// Needed to override the version used by preference-ktx
4261
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
62+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
4363

4464
// Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
4565
implementation platform('com.google.firebase:firebase-bom:30.4.1')
@@ -50,8 +70,17 @@ dependencies {
5070
// Firebase Analytics (Kotlin)
5171
implementation 'com.google.firebase:firebase-analytics-ktx'
5272

73+
// Jetpack Compose
74+
implementation "androidx.compose.ui:ui:$compose_version"
75+
implementation "androidx.compose.material:material:$compose_version"
76+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
77+
implementation 'androidx.activity:activity-compose:1.5.1'
78+
5379
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
5480
androidTestImplementation 'androidx.test:rules:1.4.0'
5581
androidTestImplementation 'androidx.test:runner:1.4.0'
5682
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
83+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
84+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
85+
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
5786
}

appdistribution/app/build.gradle

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ plugins {
55
}
66

77
android {
8-
compileSdkVersion 33
8+
compileSdk 33
99
defaultConfig {
1010
applicationId "com.google.firebase.appdistributionquickstart"
11-
minSdkVersion 19
12-
targetSdkVersion 33
11+
minSdk 21 // minSdk would be 19 without compose
12+
targetSdk 33
1313
versionCode 1
1414
versionName "1.0"
1515

1616
multiDexEnabled true
17+
vectorDrawables {
18+
useSupportLibrary true
19+
}
1720
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1821
}
1922

@@ -27,6 +30,22 @@ android {
2730

2831
buildFeatures {
2932
viewBinding = true
33+
compose true
34+
}
35+
compileOptions {
36+
sourceCompatibility JavaVersion.VERSION_1_8
37+
targetCompatibility JavaVersion.VERSION_1_8
38+
}
39+
kotlinOptions {
40+
jvmTarget = '1.8'
41+
}
42+
composeOptions {
43+
kotlinCompilerExtensionVersion '1.3.0'
44+
}
45+
packagingOptions {
46+
resources {
47+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
48+
}
3049
}
3150
lint {
3251
warning 'InvalidPackage'
@@ -40,6 +59,7 @@ dependencies {
4059
implementation 'com.google.android.material:material:1.6.1'
4160
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
4261
implementation 'androidx.multidex:multidex:2.0.1'
62+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
4363

4464
// Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
4565
implementation platform('com.google.firebase:firebase-bom:30.4.1')
@@ -51,8 +71,17 @@ dependencies {
5171
// for Google Analytics. This is recommended, but not required.
5272
implementation 'com.google.firebase:firebase-analytics'
5373

74+
// Jetpack Compose
75+
implementation "androidx.compose.ui:ui:$compose_version"
76+
implementation "androidx.compose.material:material:$compose_version"
77+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
78+
implementation 'androidx.activity:activity-compose:1.5.1'
79+
5480
androidTestImplementation 'androidx.test:runner:1.4.0'
5581
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
5682
androidTestImplementation 'androidx.test:rules:1.4.0'
5783
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
84+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
85+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
86+
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
5887
}

auth/app/build.gradle

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,14 @@ android {
1212

1313
defaultConfig {
1414
applicationId "com.google.firebase.quickstart.auth"
15-
minSdkVersion 19
16-
targetSdkVersion 33
15+
minSdk 21 // minSdk would be 19 without compose
16+
targetSdk 33
1717
versionCode 1
1818
versionName "1.0"
1919
multiDexEnabled true
20+
vectorDrawables {
21+
useSupportLibrary true
22+
}
2023
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2124
}
2225

@@ -27,13 +30,24 @@ android {
2730
}
2831
}
2932

30-
compileOptions {
31-
sourceCompatibility 1.8
32-
targetCompatibility 1.8
33-
}
34-
3533
buildFeatures {
3634
viewBinding = true
35+
compose true
36+
}
37+
compileOptions {
38+
sourceCompatibility JavaVersion.VERSION_1_8
39+
targetCompatibility JavaVersion.VERSION_1_8
40+
}
41+
kotlinOptions {
42+
jvmTarget = '1.8'
43+
}
44+
composeOptions {
45+
kotlinCompilerExtensionVersion '1.3.0'
46+
}
47+
packagingOptions {
48+
resources {
49+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
50+
}
3751
}
3852
}
3953

@@ -48,6 +62,14 @@ dependencies {
4862
implementation 'com.google.android.material:material:1.6.1'
4963
implementation 'androidx.navigation:navigation-fragment-ktx:2.5.2'
5064
implementation 'androidx.navigation:navigation-ui-ktx:2.5.2'
65+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
66+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
67+
68+
// Jetpack Compose
69+
implementation "androidx.compose.ui:ui:$compose_version"
70+
implementation "androidx.compose.material:material:$compose_version"
71+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
72+
implementation 'androidx.activity:activity-compose:1.5.1'
5173

5274
// Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
5375
implementation platform('com.google.firebase:firebase-bom:30.4.1')
@@ -73,4 +95,7 @@ dependencies {
7395
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
7496
androidTestImplementation 'androidx.test:rules:1.4.0'
7597
androidTestImplementation 'androidx.test:runner:1.4.0'
98+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
99+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
100+
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
76101
}

build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
buildscript {
2+
ext {
3+
compose_version = '1.2.1'
4+
}
25
repositories {
36
google()
47
mavenCentral()

crash/app/build.gradle

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ plugins {
88
check.dependsOn 'assembleDebugAndroidTest'
99

1010
android {
11-
compileSdkVersion 33
11+
compileSdk 33
1212

1313
defaultConfig {
1414
applicationId "com.google.samples.quickstart.crash"
15-
minSdkVersion 19
16-
targetSdkVersion 33
15+
minSdk 21 // minSdk would be 19 without compose
16+
targetSdk 33
1717
versionCode 1
1818
versionName "1.0"
19+
vectorDrawables {
20+
useSupportLibrary true
21+
}
1922
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2023
}
2124

@@ -33,6 +36,22 @@ android {
3336

3437
buildFeatures {
3538
viewBinding = true
39+
compose true
40+
}
41+
compileOptions {
42+
sourceCompatibility JavaVersion.VERSION_1_8
43+
targetCompatibility JavaVersion.VERSION_1_8
44+
}
45+
kotlinOptions {
46+
jvmTarget = '1.8'
47+
}
48+
composeOptions {
49+
kotlinCompilerExtensionVersion '1.3.0'
50+
}
51+
packagingOptions {
52+
resources {
53+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
54+
}
3655
}
3756
}
3857

@@ -41,6 +60,8 @@ dependencies {
4160
implementation project(":internal:chooserx")
4261
implementation 'com.google.android.material:material:1.6.1'
4362
implementation "androidx.activity:activity-ktx:1.5.1"
63+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
64+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
4465

4566
// Import the Firebase BoM (see: https://firebase.google.com/docs/android/learn-more#bom)
4667
implementation platform('com.google.firebase:firebase-bom:30.4.1')
@@ -55,9 +76,18 @@ dependencies {
5576
// For use in the CustomKeySamples -- for testing Google Api Availability.
5677
implementation 'com.google.android.gms:play-services-base:18.1.0'
5778

79+
// Jetpack Compose
80+
implementation "androidx.compose.ui:ui:$compose_version"
81+
implementation "androidx.compose.material:material:$compose_version"
82+
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
83+
implementation 'androidx.activity:activity-compose:1.5.1'
84+
5885
testImplementation 'junit:junit:4.13.2'
5986
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
6087
androidTestImplementation 'androidx.test:rules:1.4.0'
6188
androidTestImplementation 'androidx.test:runner:1.4.0'
6289
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
90+
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
91+
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
92+
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
6393
}

0 commit comments

Comments
 (0)