Skip to content

Commit 157147f

Browse files
authored
fix deprecation message (#5409)
1 parent 1e83580 commit 157147f

File tree

19 files changed

+304
-820
lines changed

19 files changed

+304
-820
lines changed

appcheck/firebase-appcheck/src/main/java/com/google/firebase/appcheck/ktx/FirebaseAppCheck.kt

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,38 +23,30 @@ import com.google.firebase.ktx.Firebase
2323
import com.google.firebase.ktx.app
2424

2525
/**
26+
* Accessing this object for Kotlin apps has changed; see the
27+
* [migration guide](https://firebase.google.com/docs/android/kotlin-migration).
28+
*
2629
* Returns the [FirebaseAppCheck] instance of the default [FirebaseApp].
2730
* @deprecated **Deprecation Notice:** The Kotlin extensions (KTX) APIs have been added to their
2831
* respective main modules, and the Kotlin extension (KTX) APIs in
2932
* `com.google.firebase.firebase-appcheck-ktx` are now deprecated. As early as April 2024, we'll no
3033
* longer release KTX modules. For details, see the
3134
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
3235
*/
33-
@Deprecated(
34-
"Use `com.google.firebase.appcheck.Firebase.appCheck` from the main module instead.",
35-
ReplaceWith(
36-
expression = "com.google.firebase.Firebase.appCheck",
37-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appcheck.appCheck"]
38-
)
39-
)
4036
val Firebase.appCheck: FirebaseAppCheck
4137
get() = FirebaseAppCheck.getInstance()
4238

4339
/**
40+
* Accessing this object for Kotlin apps has changed; see the
41+
* [migration guide](https://firebase.google.com/docs/android/kotlin-migration).
42+
*
4443
* Returns the [FirebaseAppCheck] instance of a given [FirebaseApp].
4544
* @deprecated **Deprecation Notice:** The Kotlin extensions (KTX) APIs have been added to their
4645
* respective main modules, and the Kotlin extension (KTX) APIs in
4746
* `com.google.firebase.firebase-appcheck-ktx` are now deprecated. As early as April 2024, we'll no
4847
* longer release KTX modules. For details, see the
4948
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
5049
*/
51-
@Deprecated(
52-
"Use `com.google.firebase.appcheck.Firebase.appCheck(app)` from the main module instead.",
53-
ReplaceWith(
54-
expression = "com.google.firebase.Firebase.appCheck(app)",
55-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appcheck.appCheck"]
56-
)
57-
)
5850
fun Firebase.appCheck(app: FirebaseApp) = FirebaseAppCheck.getInstance(app)
5951

6052
/**
@@ -68,8 +60,8 @@ fun Firebase.appCheck(app: FirebaseApp) = FirebaseAppCheck.getInstance(app)
6860
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
6961
*/
7062
@Deprecated(
71-
"Use `com.google.firebase.appcheck.AppCheckToken.component1` from the main module instead.",
72-
ReplaceWith(expression = "component1()", imports = ["com.google.firebase.appcheck.component1"])
63+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
64+
ReplaceWith("")
7365
)
7466
operator fun AppCheckToken.component1() = token
7567

@@ -84,8 +76,8 @@ operator fun AppCheckToken.component1() = token
8476
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
8577
*/
8678
@Deprecated(
87-
"Use `com.google.firebase.appcheck.AppCheckToken.component2` from the main module instead.",
88-
ReplaceWith(expression = "component2()", imports = ["com.google.firebase.appcheck.component2"])
79+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
80+
ReplaceWith("")
8981
)
9082
operator fun AppCheckToken.component2() = expireTimeMillis
9183

@@ -98,12 +90,8 @@ operator fun AppCheckToken.component2() = expireTimeMillis
9890
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
9991
*/
10092
@Deprecated(
101-
"Use `com.google.firebase.appcheck.FirebaseAppCheckKtxRegistrar` from the main module instead.",
102-
ReplaceWith(
103-
expression = "FirebaseAppCheckKtxRegistrar",
104-
imports =
105-
["com.google.firebase.Firebase", "com.google.firebase.appcheck.FirebaseAppCheckKtxRegistrar"]
106-
)
93+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
94+
ReplaceWith("")
10795
)
10896
class FirebaseAppCheckKtxRegistrar : ComponentRegistrar {
10997
override fun getComponents(): List<Component<*>> = listOf()

firebase-appdistribution-api/src/main/java/com/google/firebase/appdistribution/ktx/FirebaseAppDistribution.kt

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,16 @@ import com.google.firebase.components.ComponentRegistrar
2424
import com.google.firebase.ktx.Firebase
2525

2626
/**
27+
* Accessing this object for Kotlin apps has changed; see the
28+
* [migration guide](https://firebase.google.com/docs/android/kotlin-migration).
29+
*
2730
* Returns the [FirebaseAppDistribution] instance of the default [FirebaseApp].
2831
* @deprecated **Deprecation Notice:** The Kotlin extensions (KTX) APIs have been added to their
2932
* respective main modules, and the Kotlin extension (KTX) APIs in
3033
* `com.google.firebase:firebase-appdistribution-api-ktx` are now deprecated. As early as April
3134
* 2024, we'll no longer release KTX modules. For details, see the
3235
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
3336
*/
34-
@Deprecated(
35-
"Use `com.google.firebase.Firebase.appDistribution` from the main module instead.",
36-
ReplaceWith(
37-
expression = "com.google.firebase.Firebase.appDistribution",
38-
imports =
39-
["com.google.firebase.Firebase", "com.google.firebase.appdistribution.appDistribution"]
40-
)
41-
)
4237
val Firebase.appDistribution: FirebaseAppDistribution
4338
get() = FirebaseAppDistribution.getInstance()
4439

@@ -53,11 +48,8 @@ val Firebase.appDistribution: FirebaseAppDistribution
5348
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
5449
*/
5550
@Deprecated(
56-
"Use `com.google.firebase.appdistribution.AppDistributionRelease.component1()` from the main module instead.",
57-
ReplaceWith(
58-
expression = "component1()",
59-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appdistribution.component1"]
60-
)
51+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
52+
ReplaceWith("")
6153
)
6254
operator fun AppDistributionRelease.component1() = binaryType
6355

@@ -72,11 +64,8 @@ operator fun AppDistributionRelease.component1() = binaryType
7264
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
7365
*/
7466
@Deprecated(
75-
"Use `com.google.firebase.appdistribution.AppDistributionRelease.component2()` from the main module instead.",
76-
ReplaceWith(
77-
expression = "component2()",
78-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appdistribution.component2"]
79-
)
67+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
68+
ReplaceWith("")
8069
)
8170
operator fun AppDistributionRelease.component2() = displayVersion
8271

@@ -91,11 +80,8 @@ operator fun AppDistributionRelease.component2() = displayVersion
9180
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
9281
*/
9382
@Deprecated(
94-
"Use `com.google.firebase.appdistribution.AppDistributionRelease.component3()` from the main module instead.",
95-
ReplaceWith(
96-
expression = "component3()",
97-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appdistribution.component3"]
98-
)
83+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
84+
ReplaceWith("")
9985
)
10086
operator fun AppDistributionRelease.component3() = versionCode
10187

@@ -110,11 +96,8 @@ operator fun AppDistributionRelease.component3() = versionCode
11096
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
11197
*/
11298
@Deprecated(
113-
"Use `com.google.firebase.appdistribution.AppDistributionRelease.component4()` from the main module instead.",
114-
ReplaceWith(
115-
expression = "component4()",
116-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appdistribution.component4"]
117-
)
99+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
100+
ReplaceWith("")
118101
)
119102
operator fun AppDistributionRelease.component4() = releaseNotes
120103

@@ -129,11 +112,8 @@ operator fun AppDistributionRelease.component4() = releaseNotes
129112
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
130113
*/
131114
@Deprecated(
132-
"Use `com.google.firebase.appdistribution.UpdateProgress.component1()` from the main module instead.",
133-
ReplaceWith(
134-
expression = "component1()",
135-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appdistribution.component1"]
136-
)
115+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
116+
ReplaceWith("")
137117
)
138118
operator fun UpdateProgress.component1() = apkBytesDownloaded
139119

@@ -148,11 +128,8 @@ operator fun UpdateProgress.component1() = apkBytesDownloaded
148128
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
149129
*/
150130
@Deprecated(
151-
"Use `com.google.firebase.appdistribution.UpdateProgress.component2()` from the main module instead.",
152-
ReplaceWith(
153-
expression = "component2()",
154-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appdistribution.component2"]
155-
)
131+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
132+
ReplaceWith("")
156133
)
157134
operator fun UpdateProgress.component2() = apkFileTotalBytes
158135

@@ -167,11 +144,8 @@ operator fun UpdateProgress.component2() = apkFileTotalBytes
167144
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
168145
*/
169146
@Deprecated(
170-
"Use `com.google.firebase.appdistribution.UpdateProgress.component3()` from the main module instead.",
171-
ReplaceWith(
172-
expression = "component3()",
173-
imports = ["com.google.firebase.Firebase", "com.google.firebase.appdistribution.component3"]
174-
)
147+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
148+
ReplaceWith("")
175149
)
176150
operator fun UpdateProgress.component3() = updateStatus
177151

@@ -184,15 +158,8 @@ operator fun UpdateProgress.component3() = updateStatus
184158
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
185159
*/
186160
@Deprecated(
187-
"Use `com.google.firebase.appdistribution.FirebaseAppDistributionKtxRegistrar` from the main module instead.",
188-
ReplaceWith(
189-
expression = "FirebaseAppDistributionKtxRegistrar",
190-
imports =
191-
[
192-
"com.google.firebase.Firebase",
193-
"com.google.firebase.appdistribution.FirebaseAppDistributionKtxRegistrar"
194-
]
195-
)
161+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
162+
ReplaceWith("")
196163
)
197164
@Keep
198165
class FirebaseAppDistributionKtxRegistrar : ComponentRegistrar {

firebase-common/src/main/java/com/google/firebase/ktx/Firebase.kt

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,30 @@ import kotlinx.coroutines.asCoroutineDispatcher
4444
object Firebase
4545

4646
/**
47+
* Accessing this object for Kotlin apps has changed; see the migration guide:
48+
* https://firebase.google.com/docs/android/kotlin-migration.
49+
*
4750
* Returns the default firebase app instance.
4851
* @deprecated **Deprecation Notice:** The Kotlin extensions (KTX) APIs have been added to their
4952
* respective main modules, and the Kotlin extension (KTX) APIs in
5053
* `com.google.firebase.firebase-common-ktx` are now deprecated. As early as April 2024, we'll no
5154
* longer release KTX modules. For details, see the
5255
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration).
5356
*/
54-
@Deprecated(
55-
"Use `com.google.firebase.Firebase.app` from the main module instead.",
56-
ReplaceWith(
57-
expression = "com.google.firebase.Firebase.app",
58-
imports = ["com.google.firebase.Firebase", "com.google.firebase.app"],
59-
)
60-
)
6157
val Firebase.app: FirebaseApp
6258
get() = FirebaseApp.getInstance()
6359

6460
/**
61+
* Accessing this object for Kotlin apps has changed; see the migration guide:
62+
* https://firebase.google.com/docs/android/kotlin-migration.
63+
*
6564
* Returns a named firebase app instance.
6665
* @deprecated **Deprecation Notice:** The Kotlin extensions (KTX) APIs have been added to their
6766
* respective main modules, and the Kotlin extension (KTX) APIs in
6867
* `com.google.firebase.firebase-common-ktx` are now deprecated. As early as April 2024, we'll no
6968
* longer release KTX modules. For details, see the
7069
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration).
7170
*/
72-
@Deprecated(
73-
"Use `com.google.firebase.Firebase.app(name)` from the main module instead.",
74-
ReplaceWith(
75-
expression = "com.google.firebase.Firebase.app(name)",
76-
imports = ["com.google.firebase.Firebase", "com.google.firebase.app"]
77-
)
78-
)
7971
fun Firebase.app(name: String): FirebaseApp = FirebaseApp.getInstance(name)
8072

8173
/**
@@ -87,11 +79,8 @@ fun Firebase.app(name: String): FirebaseApp = FirebaseApp.getInstance(name)
8779
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
8880
*/
8981
@Deprecated(
90-
"Use `com.google.firebase.Firebase.initialize(context)` from the main module instead.",
91-
ReplaceWith(
92-
expression = "com.google.firebase.Firebase.initialize(context)",
93-
imports = ["com.google.firebase.Firebase", "com.google.firebase.initialize"]
94-
)
82+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
83+
ReplaceWith("")
9584
)
9685
fun Firebase.initialize(context: Context): FirebaseApp? = FirebaseApp.initializeApp(context)
9786

@@ -104,11 +93,8 @@ fun Firebase.initialize(context: Context): FirebaseApp? = FirebaseApp.initialize
10493
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
10594
*/
10695
@Deprecated(
107-
"Use `com.google.firebase.Firebase.initialize(context, options)` from the main module instead.",
108-
ReplaceWith(
109-
expression = "com.google.firebase.Firebase.initialize(context, options)",
110-
imports = ["com.google.firebase.Firebase", "com.google.firebase.initialize"]
111-
)
96+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
97+
ReplaceWith("")
11298
)
11399
fun Firebase.initialize(context: Context, options: FirebaseOptions): FirebaseApp =
114100
FirebaseApp.initializeApp(context, options)
@@ -122,16 +108,16 @@ fun Firebase.initialize(context: Context, options: FirebaseOptions): FirebaseApp
122108
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
123109
*/
124110
@Deprecated(
125-
"Use `com.google.firebase.Firebase.initialize(context, options, name)` from the main module instead.",
126-
ReplaceWith(
127-
expression = "com.google.firebase.Firebase.initialize(context, options, name)",
128-
imports = ["com.google.firebase.Firebase", "com.google.firebase.initialize"]
129-
)
111+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
112+
ReplaceWith("")
130113
)
131114
fun Firebase.initialize(context: Context, options: FirebaseOptions, name: String): FirebaseApp =
132115
FirebaseApp.initializeApp(context, options, name)
133116

134117
/**
118+
* Accessing this object for Kotlin apps has changed; see the migration guide:
119+
* https://firebase.google.com/docs/android/kotlin-migration.
120+
*
135121
* Returns options of default FirebaseApp
136122
* @deprecated **Deprecation Notice:** The Kotlin extensions (KTX) APIs have been added to their
137123
* respective main modules, and the Kotlin extension (KTX) APIs in
@@ -140,22 +126,16 @@ fun Firebase.initialize(context: Context, options: FirebaseOptions, name: String
140126
* [FAQ about this initiative.](https://firebase.google.com/docs/android/kotlin-migration)
141127
*/
142128
@Deprecated(
143-
"Use `com.google.firebase.Firebase.options` from the main module instead.",
144-
ReplaceWith(
145-
expression = "com.google.firebase.Firebase.options",
146-
imports = ["com.google.firebase.Firebase", "com.google.firebase.options"]
147-
)
129+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
130+
ReplaceWith("")
148131
)
149132
val Firebase.options: FirebaseOptions
150133
get() = Firebase.app.options
151134

152135
/** @suppress */
153136
@Deprecated(
154-
"Use `com.google.firebase.FirebaseCommonKtxRegistrar` from the main module instead.",
155-
ReplaceWith(
156-
expression = "FirebaseCommonKtxRegistrar",
157-
imports = ["com.google.firebase.Firebase", "com.google.firebase.FirebaseCommonKtxRegistrar"]
158-
)
137+
"Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.",
138+
ReplaceWith("")
159139
)
160140
@Keep
161141
class FirebaseCommonKtxRegistrar : ComponentRegistrar {

0 commit comments

Comments
 (0)