Skip to content

Commit a59f456

Browse files
committed
Merge branch 'master' into executors
2 parents 57d3b15 + c1adf5b commit a59f456

File tree

102 files changed

+6418
-5573
lines changed

Some content is hidden

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

102 files changed

+6418
-5573
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build Release Artifacts
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- 'releases/**'
8+
9+
jobs:
10+
build-artifacts:
11+
runs-on: ubuntu-latest
12+
env:
13+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
steps:
15+
- uses: actions/checkout@v3
16+
17+
- name: Perform gradle build
18+
run: |
19+
./gradlew firebasePublish -PprojectsToPublish=firebase-firestore -PpublishMode=RELEASE -PincludeFireEscapeArtifacts=true
20+
- name: Upload generated artifacts
21+
uses: actions/upload-artifact@v2
22+
with:
23+
name: release_artifacts.zip
24+
path: build/*.zip
25+
retention-days: 5

.github/workflows/create_releases.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ jobs:
1717
- name: Create base branch
1818
uses: peterjgrainger/[email protected]
1919
with:
20-
branch: '${{ inputs.name }}'
20+
branch: 'releases/${{ inputs.name }}'
2121
- name: Create release branch
2222
uses: peterjgrainger/[email protected]
2323
with:
24-
branch: '${{ inputs.name }}.release'
24+
branch: 'releases/${{ inputs.name }}.release'
2525

2626
create-pull-request:
2727
runs-on: ubuntu-latest
@@ -44,6 +44,6 @@ jobs:
4444
- name: Create Pull Request
4545
uses: peter-evans/create-pull-request@v4
4646
with:
47-
base: '${{ inputs.name }}'
48-
branch: '${{ inputs.name }}.release'
47+
base: 'releases/${{ inputs.name }}'
48+
branch: 'releases/${{ inputs.name }}.release'
4949
title: '${{ inputs.name}} release'

.github/workflows/merge-to-main.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Merge to main
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
types:
8+
- opened
9+
- labeled
10+
- unlabeled
11+
12+
jobs:
13+
pr-message:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
pull-requests: write
17+
steps:
18+
- uses: mshick/add-pr-comment@v2
19+
with:
20+
message: >
21+
### 📝 PRs merging into main branch
22+
23+
**Our main branch should always be in a releasable state**.
24+
If you are working on a larger change, or if you don't want
25+
this change to see the light of the day just yet, consider
26+
using a feature branch first, and only merge into the main
27+
branch when the code complete and ready to be released.
28+
29+
30+
**Add the 'main-merge-ack' label to your PR to confirm
31+
merging into the main branch is intended.**
32+
33+
- name: Label checker
34+
if: "!contains( github.event.pull_request.labels.*.name, 'main-merge-ack')"
35+
run: |
36+
echo Missing 'main-merge-ack' label. Read the comment about merging to master in your PR for more information.
37+
exit 1
38+
39+
- name: Success
40+
run: exit 0

appcheck/firebase-appcheck-safetynet/src/main/java/com/google/firebase/appcheck/safetynet/SafetyNetAppCheckProviderFactory.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
/**
2424
* Implementation of an {@link AppCheckProviderFactory} that builds {@link
2525
* SafetyNetAppCheckProvider}s. This is the default implementation.
26-
*
27-
* @deprecated Use {@code PlayIntegrityAppCheckProviderFactory} instead.
2826
*/
29-
@Deprecated
3027
public class SafetyNetAppCheckProviderFactory implements AppCheckProviderFactory {
3128

3229
private static final SafetyNetAppCheckProviderFactory instance =
@@ -37,10 +34,7 @@ private SafetyNetAppCheckProviderFactory() {}
3734
/**
3835
* Gets an instance of this class for installation into a {@link
3936
* com.google.firebase.appcheck.FirebaseAppCheck} instance.
40-
*
41-
* @deprecated Use {@code PlayIntegrityAppCheckProviderFactory#getInstance} instead.
4237
*/
43-
@Deprecated
4438
@NonNull
4539
public static SafetyNetAppCheckProviderFactory getInstance() {
4640
return instance;

appcheck/firebase-appcheck/ktx/src/androidTest/kotlin/com/google/firebase/appcheck/ktx/FirebaseAppCheckTests.kt

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -37,70 +37,70 @@ const val EXISTING_APP = "existing"
3737

3838
@RunWith(AndroidJUnit4ClassRunner::class)
3939
abstract class BaseTestCase {
40-
@Before
41-
fun setUp() {
42-
Firebase.initialize(
43-
ApplicationProvider.getApplicationContext(),
44-
FirebaseOptions.Builder()
45-
.setApplicationId(APP_ID)
46-
.setApiKey(API_KEY)
47-
.setProjectId("123")
48-
.build()
49-
)
40+
@Before
41+
fun setUp() {
42+
Firebase.initialize(
43+
ApplicationProvider.getApplicationContext(),
44+
FirebaseOptions.Builder()
45+
.setApplicationId(APP_ID)
46+
.setApiKey(API_KEY)
47+
.setProjectId("123")
48+
.build()
49+
)
5050

51-
Firebase.initialize(
52-
ApplicationProvider.getApplicationContext(),
53-
FirebaseOptions.Builder()
54-
.setApplicationId(APP_ID)
55-
.setApiKey(API_KEY)
56-
.setProjectId("123")
57-
.build(),
58-
EXISTING_APP
59-
)
60-
}
51+
Firebase.initialize(
52+
ApplicationProvider.getApplicationContext(),
53+
FirebaseOptions.Builder()
54+
.setApplicationId(APP_ID)
55+
.setApiKey(API_KEY)
56+
.setProjectId("123")
57+
.build(),
58+
EXISTING_APP
59+
)
60+
}
6161

62-
@After
63-
fun cleanUp() {
64-
FirebaseApp.clearInstancesForTest()
65-
}
62+
@After
63+
fun cleanUp() {
64+
FirebaseApp.clearInstancesForTest()
65+
}
6666
}
6767

6868
@RunWith(AndroidJUnit4ClassRunner::class)
6969
class FirebaseAppCheckTests : BaseTestCase() {
70-
@Test
71-
fun appCheck_default_callsDefaultGetInstance() {
72-
assertThat(Firebase.appCheck).isSameInstanceAs(FirebaseAppCheck.getInstance())
73-
}
70+
@Test
71+
fun appCheck_default_callsDefaultGetInstance() {
72+
assertThat(Firebase.appCheck).isSameInstanceAs(FirebaseAppCheck.getInstance())
73+
}
7474

75-
@Test
76-
fun appCheck_with_custom_firebaseapp_calls_GetInstance() {
77-
val app = Firebase.app(EXISTING_APP)
78-
assertThat(Firebase.appCheck(app))
79-
.isSameInstanceAs(FirebaseAppCheck.getInstance(app))
80-
}
75+
@Test
76+
fun appCheck_with_custom_firebaseapp_calls_GetInstance() {
77+
val app = Firebase.app(EXISTING_APP)
78+
assertThat(Firebase.appCheck(app)).isSameInstanceAs(FirebaseAppCheck.getInstance(app))
79+
}
8180

82-
@Test
83-
fun appCheckToken_destructuring_declaration_works() {
84-
val mockAppCheckToken = object : AppCheckToken() {
85-
override fun getToken(): String = "randomToken"
81+
@Test
82+
fun appCheckToken_destructuring_declaration_works() {
83+
val mockAppCheckToken =
84+
object : AppCheckToken() {
85+
override fun getToken(): String = "randomToken"
8686

87-
override fun getExpireTimeMillis(): Long = 23121997
88-
}
87+
override fun getExpireTimeMillis(): Long = 23121997
88+
}
8989

90-
val (token, expiration) = mockAppCheckToken
90+
val (token, expiration) = mockAppCheckToken
9191

92-
assertThat(token).isEqualTo(mockAppCheckToken.token)
93-
assertThat(expiration).isEqualTo(mockAppCheckToken.expireTimeMillis)
94-
}
92+
assertThat(token).isEqualTo(mockAppCheckToken.token)
93+
assertThat(expiration).isEqualTo(mockAppCheckToken.expireTimeMillis)
94+
}
9595
}
9696

9797
internal const val LIBRARY_NAME: String = "fire-app-check-ktx"
9898

9999
@RunWith(AndroidJUnit4ClassRunner::class)
100100
class LibraryVersionTest : BaseTestCase() {
101-
@Test
102-
fun libraryRegistrationAtRuntime() {
103-
val publisher = Firebase.app.get(UserAgentPublisher::class.java)
104-
assertThat(publisher.userAgent).contains(LIBRARY_NAME)
105-
}
101+
@Test
102+
fun libraryRegistrationAtRuntime() {
103+
val publisher = Firebase.app.get(UserAgentPublisher::class.java)
104+
assertThat(publisher.userAgent).contains(LIBRARY_NAME)
105+
}
106106
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import com.google.firebase.platforminfo.LibraryVersionComponent
2525

2626
/** Returns the [FirebaseAppCheck] instance of the default [FirebaseApp]. */
2727
val Firebase.appCheck: FirebaseAppCheck
28-
get() = FirebaseAppCheck.getInstance()
28+
get() = FirebaseAppCheck.getInstance()
2929

3030
/** Returns the [FirebaseAppCheck] instance of a given [FirebaseApp]. */
3131
fun Firebase.appCheck(app: FirebaseApp) = FirebaseAppCheck.getInstance(app)
@@ -48,6 +48,6 @@ internal const val LIBRARY_NAME: String = "fire-app-check-ktx"
4848

4949
/** @suppress */
5050
class FirebaseAppCheckKtxRegistrar : ComponentRegistrar {
51-
override fun getComponents(): List<Component<*>> =
52-
listOf(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME))
51+
override fun getComponents(): List<Component<*>> =
52+
listOf(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME))
5353
}

build.gradle

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ buildscript {
3939
classpath 'net.ltgt.gradle:gradle-errorprone-plugin:1.3.0'
4040
classpath 'gradle.plugin.com.github.sherter.google-java-format:google-java-format-gradle-plugin:0.9'
4141
classpath 'com.google.gms:google-services:4.3.3'
42-
classpath 'org.jlleitschuh.gradle:ktlint-gradle:9.2.1'
42+
classpath "com.ncorti.ktfmt.gradle:plugin:0.11.0"
4343
}
4444
}
4545

@@ -87,7 +87,11 @@ configure(subprojects) {
8787
}
8888
}
8989

90-
apply plugin: "org.jlleitschuh.gradle.ktlint"
90+
apply plugin: "com.ncorti.ktfmt.gradle"
91+
92+
ktfmt {
93+
googleStyle()
94+
}
9195
}
9296

9397
task clean(type: Delete) {

buildSrc/build.gradle.kts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
plugins {
16-
id("org.jlleitschuh.gradle.ktlint") version "9.2.1"
16+
id("com.ncorti.ktfmt.gradle") version "0.11.0"
1717
id("com.github.sherter.google-java-format") version "0.9"
1818
`kotlin-dsl`
1919
}
@@ -32,7 +32,11 @@ repositories {
3232
val perfPluginVersion = System.getenv("FIREBASE_PERF_PLUGIN_VERSION") ?: "1.4.1"
3333

3434
googleJavaFormat {
35-
toolVersion = "1.10.0"
35+
toolVersion = "1.15.0"
36+
}
37+
38+
ktfmt {
39+
googleStyle()
3640
}
3741

3842
dependencies {
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2021 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.gradle
15+
16+
import java.io.File
17+
import java.nio.file.Files
18+
import java.nio.file.StandardCopyOption
19+
import org.gradle.api.DefaultTask
20+
import org.gradle.api.file.RegularFileProperty
21+
import org.gradle.api.tasks.InputFile
22+
import org.gradle.api.tasks.Internal
23+
import org.gradle.api.tasks.OutputFile
24+
import org.gradle.api.tasks.TaskAction
25+
26+
abstract class NdkBinaryFixTask : DefaultTask() {
27+
@get:InputFile abstract val inputFile: RegularFileProperty
28+
29+
@get:OutputFile
30+
val outputFile: File
31+
get() = inputFile.get().asFile.let { File(it.parentFile, "lib${it.name}.so") }
32+
33+
@get:Internal
34+
val into: String
35+
get() = "jni/${outputFile.parentFile.name}"
36+
37+
@TaskAction
38+
fun run() {
39+
Files.copy(
40+
inputFile.get().asFile.toPath(),
41+
outputFile.toPath(),
42+
StandardCopyOption.REPLACE_EXISTING
43+
)
44+
}
45+
}

0 commit comments

Comments
 (0)