Skip to content

Commit 39c8bf9

Browse files
authored
Merge branch 'master' into ehsann/update-or-query-tests
2 parents 68abe55 + dd56689 commit 39c8bf9

File tree

238 files changed

+9529
-1318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+9529
-1318
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Post release cleanup
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
name:
7+
description: 'Release name'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
create-pull-request:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/[email protected]
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Run post release cleanup task
20+
run: |
21+
./gradlew postReleaseCleanup
22+
23+
- name: Create Pull Request
24+
uses: peter-evans/create-pull-request@v4
25+
with:
26+
base: 'master'
27+
branch: 'releases/${{ inputs.name }}.mergeback'
28+
add-paths: |
29+
**/CHANGELOG.md
30+
**/gradle.properties
31+
**/*.gradle
32+
**/*.gradle.kts
33+
title: '${{ inputs.name}} mergeback'
34+
body: |
35+
Auto-generated PR for cleaning up release ${{ inputs.name}}
36+
37+
NO_RELEASE_CHANGE
38+
commit-message: 'Post release cleanup for ${{ inputs.name }}'

.github/workflows/sessions-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@ jobs:
3939
env:
4040
FTL_RESULTS_BUCKET: fireescape
4141
run: |
42-
./gradlew :firebase-sessions:test-app:deviceCheck withErrorProne -PtargetBackend="prod"
42+
./gradlew :firebase-sessions:test-app:deviceCheck withErrorProne -PtargetBackend="prod" -PuseReleasedVersions

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,11 @@ To run formatting on your entire project you can run
255255
./gradlew :<firebase-project>:googleJavaFormat
256256
```
257257

258+
To auto-format, just run
259+
```bash
260+
./gradlew :<firebase-project>:gJf
261+
```
262+
258263
#### Kotlin
259264

260265
Kotlin code in this repo is formatted with the `ktfmt` tool. You can enable
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.2
1+
version=17.1.0
22
latestReleasedVersion=17.0.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.2
1+
version=17.1.0
22
latestReleasedVersion=17.0.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.2
1+
version=17.1.0
22
latestReleasedVersion=17.0.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.2
1+
version=17.1.0
22
latestReleasedVersion=17.0.1

appcheck/firebase-appcheck/api.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,23 @@ package com.google.firebase.appcheck {
3232
method public void onAppCheckTokenChanged(@NonNull com.google.firebase.appcheck.AppCheckToken);
3333
}
3434

35+
public final class FirebaseAppCheckKt {
36+
method @NonNull public static com.google.firebase.appcheck.FirebaseAppCheck appCheck(@NonNull com.google.firebase.Firebase, @NonNull com.google.firebase.FirebaseApp app);
37+
method @NonNull public static operator String component1(@NonNull com.google.firebase.appcheck.AppCheckToken);
38+
method public static operator long component2(@NonNull com.google.firebase.appcheck.AppCheckToken);
39+
method @NonNull public static com.google.firebase.appcheck.FirebaseAppCheck getAppCheck(@NonNull com.google.firebase.Firebase);
40+
}
41+
42+
}
43+
44+
package com.google.firebase.appcheck.ktx {
45+
46+
public final class FirebaseAppCheckKt {
47+
method @Deprecated @NonNull public static com.google.firebase.appcheck.FirebaseAppCheck appCheck(@NonNull com.google.firebase.ktx.Firebase, @NonNull com.google.firebase.FirebaseApp app);
48+
method @Deprecated @NonNull public static operator String component1(@NonNull com.google.firebase.appcheck.AppCheckToken);
49+
method @Deprecated public static operator long component2(@NonNull com.google.firebase.appcheck.AppCheckToken);
50+
method @Deprecated @NonNull public static com.google.firebase.appcheck.FirebaseAppCheck getAppCheck(@NonNull com.google.firebase.ktx.Firebase);
51+
}
52+
3553
}
3654

appcheck/firebase-appcheck/firebase-appcheck.gradle

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
plugins {
1616
id 'firebase-library'
17+
id("kotlin-android")
1718
}
1819

1920
firebaseLibrary {
@@ -44,31 +45,34 @@ android {
4445
}
4546

4647
dependencies {
47-
implementation 'com.google.firebase:firebase-annotations:16.2.0'
48-
implementation 'com.google.firebase:firebase-common:20.3.1'
49-
implementation 'com.google.firebase:firebase-components:17.1.0'
50-
implementation project(':appcheck:firebase-appcheck-interop')
48+
androidTestImplementation "androidx.annotation:annotation:1.0.0"
49+
androidTestImplementation "androidx.test.ext:junit:$androidxTestJUnitVersion"
50+
androidTestImplementation "androidx.test:core:$androidxTestCoreVersion"
51+
androidTestImplementation "com.google.truth:truth:$googleTruthVersion"
52+
androidTestImplementation 'androidx.test:runner:1.2.0'
53+
androidTestImplementation 'junit:junit:4.12'
54+
androidTestImplementation 'org.mockito:mockito-core:2.25.0'
55+
androidTestImplementation 'org.mockito:mockito-inline:2.25.0'
56+
androidTestImplementation project(':appcheck:firebase-appcheck')
57+
androidTestImplementation project(':integ-testing')
58+
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
59+
implementation 'androidx.annotation:annotation:1.1.0'
5160
implementation 'com.google.android.gms:play-services-base:18.0.1'
5261
implementation 'com.google.android.gms:play-services-tasks:18.0.1'
53-
62+
implementation 'com.google.firebase:firebase-annotations:16.2.0'
63+
implementation project(':appcheck:firebase-appcheck-interop')
64+
implementation project(path: ':appcheck:firebase-appcheck-interop')
65+
implementation(project(":firebase-common"))
66+
implementation(project(":firebase-common:ktx"))
67+
implementation(project(":firebase-components"))
5468
javadocClasspath 'com.google.auto.value:auto-value-annotations:1.6.6'
55-
56-
testImplementation project(':integ-testing')
69+
testImplementation "androidx.test:core:$androidxTestCoreVersion"
70+
testImplementation "com.google.truth:truth:$googleTruthVersion"
71+
testImplementation "org.robolectric:robolectric:$robolectricVersion"
72+
testImplementation 'androidx.test:rules:1.2.0'
73+
testImplementation 'junit:junit:4.12'
5774
testImplementation 'junit:junit:4.13-beta-2'
5875
testImplementation 'org.mockito:mockito-core:2.25.0'
5976
testImplementation 'org.mockito:mockito-inline:2.25.0'
60-
testImplementation "org.robolectric:robolectric:$robolectricVersion"
61-
testImplementation "com.google.truth:truth:$googleTruthVersion"
62-
testImplementation "androidx.test:core:$androidxTestCoreVersion"
63-
testImplementation 'androidx.test:rules:1.2.0'
64-
65-
androidTestImplementation project(':appcheck:firebase-appcheck')
66-
androidTestImplementation project(':integ-testing')
67-
androidTestImplementation "androidx.test.ext:junit:$androidxTestJUnitVersion"
68-
androidTestImplementation 'androidx.test:runner:1.2.0'
69-
androidTestImplementation "com.google.truth:truth:$googleTruthVersion"
70-
androidTestImplementation 'junit:junit:4.12'
71-
androidTestImplementation "androidx.annotation:annotation:1.0.0"
72-
androidTestImplementation 'org.mockito:mockito-core:2.25.0'
73-
androidTestImplementation 'org.mockito:mockito-inline:2.25.0'
74-
}
77+
testImplementation project(':integ-testing')
78+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=17.0.2
1+
version=17.1.0
22
latestReleasedVersion=17.0.1

appcheck/firebase-appcheck/ktx/api.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
// Signature format: 2.0
22
package com.google.firebase.appcheck.ktx {
33

4-
public final class FirebaseAppCheckKt {
5-
method @NonNull public static com.google.firebase.appcheck.FirebaseAppCheck appCheck(@NonNull com.google.firebase.ktx.Firebase, @NonNull com.google.firebase.FirebaseApp app);
6-
method @NonNull public static operator String component1(@NonNull com.google.firebase.appcheck.AppCheckToken);
7-
method public static operator long component2(@NonNull com.google.firebase.appcheck.AppCheckToken);
8-
method @NonNull public static com.google.firebase.appcheck.FirebaseAppCheck getAppCheck(@NonNull com.google.firebase.ktx.Firebase);
4+
public final class LoggingKt {
95
}
106

117
}

appcheck/firebase-appcheck/ktx/ktx.gradle

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414

1515
plugins {
1616
id 'firebase-library'
17-
id 'kotlin-android'
17+
id("kotlin-android")
1818
}
1919

2020
firebaseLibrary {
2121
libraryGroup "appcheck"
2222
testLab.enabled = true
23-
publishJavadoc = true
23+
publishJavadoc = false
2424
publishSources = true
2525
}
2626

@@ -52,22 +52,17 @@ android {
5252
}
5353

5454
dependencies {
55-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
56-
57-
implementation 'com.google.firebase:firebase-common:20.3.1'
58-
implementation 'com.google.firebase:firebase-components:17.1.0'
59-
implementation 'com.google.firebase:firebase-common-ktx:20.3.1'
60-
implementation 'androidx.annotation:annotation:1.1.0'
61-
implementation project(path: ':appcheck:firebase-appcheck')
62-
implementation project(path: ':appcheck:firebase-appcheck-interop')
63-
55+
androidTestImplementation "androidx.test:core:$androidxTestCoreVersion"
56+
androidTestImplementation "com.google.truth:truth:$googleTruthVersion"
57+
androidTestImplementation 'androidx.test:runner:1.2.0'
58+
androidTestImplementation 'junit:junit:4.12'
59+
api(project(":appcheck:firebase-appcheck"))
60+
androidTestImplementation(project(":appcheck:firebase-appcheck-interop"))
61+
api(project(":firebase-common"))
62+
api(project(":firebase-common:ktx"))
63+
implementation(project(":firebase-components"))
64+
testImplementation "com.google.truth:truth:$googleTruthVersion"
6465
testImplementation "org.robolectric:robolectric:$robolectricVersion"
6566
testImplementation 'junit:junit:4.12'
66-
testImplementation "com.google.truth:truth:$googleTruthVersion"
6767
testImplementation 'org.mockito:mockito-core:2.25.0'
68-
69-
androidTestImplementation 'junit:junit:4.12'
70-
androidTestImplementation "com.google.truth:truth:$googleTruthVersion"
71-
androidTestImplementation 'androidx.test:runner:1.2.0'
72-
androidTestImplementation "androidx.test:core:$androidxTestCoreVersion"
73-
}
68+
}

appcheck/firebase-appcheck/ktx/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
<application>
1919
<service android:name="com.google.firebase.components.ComponentDiscoveryService" android:exported="false">
20-
<meta-data android:name="com.google.firebase.components:com.google.firebase.appcheck.ktx.FirebaseAppCheckKtxRegistrar"
20+
<meta-data android:name="com.google.firebase.components:com.google.firebase.appcheck.ktx.FirebaseAppcheckLegacyRegistrar"
2121
android:value="com.google.firebase.components.ComponentRegistrar" />
2222
</service>
2323
</application>
24-
</manifest>
24+
</manifest>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Copyright 2023 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
package com.google.firebase.appcheck.ktx
15+
16+
import androidx.annotation.Keep
17+
import com.google.firebase.appcheck.BuildConfig
18+
import com.google.firebase.components.Component
19+
import com.google.firebase.components.ComponentRegistrar
20+
import com.google.firebase.platforminfo.LibraryVersionComponent
21+
22+
internal const val LIBRARY_NAME: String = "fire-app-check-ktx"
23+
24+
/** @suppress */
25+
@Keep
26+
class FirebaseAppcheckLegacyRegistrar : ComponentRegistrar {
27+
override fun getComponents(): List<Component<*>> {
28+
return listOf(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME))
29+
}
30+
}
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// Copyright 2022 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.google.firebase.appcheck
16+
17+
import androidx.test.core.app.ApplicationProvider
18+
import androidx.test.internal.runner.junit4.AndroidJUnit4ClassRunner
19+
import com.google.common.truth.Truth.assertThat
20+
import com.google.firebase.Firebase
21+
import com.google.firebase.FirebaseApp
22+
import com.google.firebase.FirebaseOptions
23+
import com.google.firebase.app
24+
import com.google.firebase.initialize
25+
import com.google.firebase.platforminfo.UserAgentPublisher
26+
import org.junit.After
27+
import org.junit.Before
28+
import org.junit.Test
29+
import org.junit.runner.RunWith
30+
31+
const val APP_ID = "APP_ID"
32+
const val API_KEY = "API_KEY"
33+
34+
const val EXISTING_APP = "existing"
35+
36+
@RunWith(AndroidJUnit4ClassRunner::class)
37+
abstract class BaseTestCase {
38+
@Before
39+
fun setUp() {
40+
Firebase.initialize(
41+
ApplicationProvider.getApplicationContext(),
42+
FirebaseOptions.Builder()
43+
.setApplicationId(APP_ID)
44+
.setApiKey(API_KEY)
45+
.setProjectId("123")
46+
.build()
47+
)
48+
49+
Firebase.initialize(
50+
ApplicationProvider.getApplicationContext(),
51+
FirebaseOptions.Builder()
52+
.setApplicationId(APP_ID)
53+
.setApiKey(API_KEY)
54+
.setProjectId("123")
55+
.build(),
56+
EXISTING_APP
57+
)
58+
}
59+
60+
@After
61+
fun cleanUp() {
62+
FirebaseApp.clearInstancesForTest()
63+
}
64+
}
65+
66+
@RunWith(AndroidJUnit4ClassRunner::class)
67+
class FirebaseAppCheckTests : BaseTestCase() {
68+
@Test
69+
fun appCheck_default_callsDefaultGetInstance() {
70+
assertThat(Firebase.appCheck).isSameInstanceAs(FirebaseAppCheck.getInstance())
71+
}
72+
73+
@Test
74+
fun appCheck_with_custom_firebaseapp_calls_GetInstance() {
75+
val app = Firebase.app(EXISTING_APP)
76+
assertThat(Firebase.appCheck(app)).isSameInstanceAs(FirebaseAppCheck.getInstance(app))
77+
}
78+
79+
@Test
80+
fun appCheckToken_destructuring_declaration_works() {
81+
val mockAppCheckToken =
82+
object : AppCheckToken() {
83+
override fun getToken(): String = "randomToken"
84+
85+
override fun getExpireTimeMillis(): Long = 23121997
86+
}
87+
88+
val (token, expiration) = mockAppCheckToken
89+
90+
assertThat(token).isEqualTo(mockAppCheckToken.token)
91+
assertThat(expiration).isEqualTo(mockAppCheckToken.expireTimeMillis)
92+
}
93+
}
94+
95+
@RunWith(AndroidJUnit4ClassRunner::class)
96+
class LibraryVersionTest : BaseTestCase() {
97+
@Test
98+
fun libraryRegistrationAtRuntime() {
99+
val publisher = Firebase.app.get(UserAgentPublisher::class.java)
100+
}
101+
}

0 commit comments

Comments
 (0)