Skip to content

Commit 7be45bc

Browse files
committed
Merge branch 'master' into vk.agp_7.2
2 parents dd4b83e + 3280a27 commit 7be45bc

File tree

82 files changed

+2208
-509
lines changed

Some content is hidden

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

82 files changed

+2208
-509
lines changed

.github/workflows/changelog.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Changelog
2+
3+
on:
4+
pull_request
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
danger:
12+
runs-on: ubuntu-22.04
13+
env:
14+
BUNDLE_GEMFILE: ./ci/danger/Gemfile
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 100
19+
submodules: true
20+
- uses: ruby/setup-ruby@v1
21+
with:
22+
ruby-version: '2.7'
23+
- name: Setup Bundler
24+
run: ./ci/danger/setup_bundler.sh
25+
- name: Danger CHANGELOG verifier
26+
env:
27+
DANGER_GITHUB_API_TOKEN: ${{ secrets.GOOGLE_OSS_BOT_TOKEN }}
28+
run:
29+
'[ ! -z $DANGER_GITHUB_API_TOKEN ] && bundle exec danger --dangerfile=./ci/danger/Dangerfile || echo "Skipping Danger for External Contributor"'

.github/workflows/fireperf-e2e.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,12 @@ jobs:
105105
assignees: ['jeremyjiang-dev', 'leotianlizhan', 'raymondlam', 'visumickey']
106106
});
107107
}
108+
- name: Upload test artifacts
109+
if: always()
110+
uses: actions/upload-artifact@v3
111+
with:
112+
name: test-artifacts (${{ matrix.environment }})
113+
path: |
114+
~/.m2/repository/com/google/firebase/perf-plugin
115+
**/build/reports
116+
**/build/test-results

.github/workflows/smoke-tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,13 @@ jobs:
5757
BUILD_ID: ${{ github.run_id }}
5858
ARTIFACTS: ${{ runner.temp }}
5959
run: java -jar runner.jar smoke-tests/runner.config
60+
61+
- name: Upload test artifacts
62+
if: always()
63+
uses: actions/upload-artifact@v3
64+
with:
65+
name: smoke-tests-artifacts
66+
path: |
67+
${{ runner.temp }}/**/*.apk
68+
${{ runner.temp }}/**/changed-artifacts.json
69+
${{ runner.temp }}/**/smoke-test-dependencies.log
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
version=16.0.1
1+
version=16.0.2
2+
latestReleasedVersion=16.0.1
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
version=16.0.1
1+
version=16.0.2
2+
latestReleasedVersion=16.0.1
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=16.0.1
2-
latestReleasedVersion=16.0.0
1+
version=16.0.2
2+
latestReleasedVersion=16.0.1
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
version=16.0.1
1+
version=16.0.2
2+
latestReleasedVersion=16.0.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=16.0.1
1+
version=16.0.2
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
version=16.0.1
1+
version=16.0.2
2+
latestReleasedVersion=16.0.1

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ operator fun AppCheckToken.component2() = expireTimeMillis
4646

4747
internal const val LIBRARY_NAME: String = "fire-app-check-ktx"
4848

49+
/** @suppress */
4950
class FirebaseAppCheckKtxRegistrar : ComponentRegistrar {
5051
override fun getComponents(): List<Component<*>> =
5152
listOf(LibraryVersionComponent.create(LIBRARY_NAME, BuildConfig.VERSION_NAME))

build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ buildscript {
2525
}
2626
maven {
2727
url 'https://storage.googleapis.com/android-ci/mvn/'
28+
metadataSources {
29+
artifact()
30+
}
2831
}
2932

3033
}
@@ -45,7 +48,7 @@ ext {
4548
playServicesVersion = '16.0.1'
4649
supportAnnotationsVersion = '28.0.0'
4750
googleTruthVersion = '1.1.2'
48-
grpcVersion = '1.44.1'
51+
grpcVersion = '1.48.1'
4952
robolectricVersion = '4.3.1'
5053
protocVersion = '3.17.3'
5154
javaliteVersion = '3.17.3'
@@ -75,6 +78,9 @@ configure(subprojects) {
7578
mavenCentral()
7679
maven {
7780
url 'https://storage.googleapis.com/android-ci/mvn/'
81+
metadataSources {
82+
artifact()
83+
}
7884
}
7985
}
8086

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
package com.google.firebase.gradle.plugins
2+
3+
import java.io.File
4+
import javax.inject.Inject
5+
import org.gradle.api.DefaultTask
6+
import org.gradle.api.provider.ListProperty
7+
import org.gradle.api.provider.Property
8+
import org.gradle.api.provider.SetProperty
9+
import org.gradle.api.tasks.CacheableTask
10+
import org.gradle.api.tasks.Classpath
11+
import org.gradle.api.tasks.Input
12+
import org.gradle.api.tasks.InputFile
13+
import org.gradle.api.tasks.InputFiles
14+
import org.gradle.api.tasks.OutputDirectory
15+
import org.gradle.api.tasks.PathSensitive
16+
import org.gradle.api.tasks.PathSensitivity
17+
import org.gradle.api.tasks.TaskAction
18+
import org.gradle.process.ExecOperations
19+
import org.gradle.workers.WorkAction
20+
import org.gradle.workers.WorkParameters
21+
import org.gradle.workers.WorkerExecutor
22+
import org.json.JSONObject
23+
/**
24+
* Extension class for [GenerateDocumentationTask].
25+
*
26+
* Provides public configurations for the task.
27+
*
28+
* @property dackkaJarFile a [File] of the Dackka fat jar
29+
* @property dependencies a list of all dependent jars (the classpath)
30+
* @property kotlinSources a list of kotlin source roots
31+
* @property javaSources a list of java source roots
32+
* @property suppressedFiles a list of files to exclude from documentation
33+
* @property outputDirectory where to store the generated files
34+
*/
35+
@CacheableTask
36+
abstract class GenerateDocumentationTaskExtension : DefaultTask() {
37+
@get:[InputFile Classpath]
38+
abstract val dackkaJarFile: Property<File>
39+
40+
@get:[InputFiles Classpath]
41+
abstract val dependencies: ListProperty<File>
42+
43+
@get:InputFiles
44+
@get:PathSensitive(PathSensitivity.RELATIVE)
45+
abstract val kotlinSources: ListProperty<File>
46+
47+
@get:InputFiles
48+
@get:PathSensitive(PathSensitivity.RELATIVE)
49+
abstract val javaSources: ListProperty<File>
50+
51+
@get:InputFiles
52+
@get:PathSensitive(PathSensitivity.RELATIVE)
53+
abstract val suppressedFiles: ListProperty<File>
54+
55+
@get:InputFiles
56+
@get:PathSensitive(PathSensitivity.RELATIVE)
57+
abstract val packageListFiles: ListProperty<File>
58+
59+
@get:Input
60+
abstract val clientName: Property<String>
61+
62+
@get:OutputDirectory
63+
abstract val outputDirectory: Property<File>
64+
}
65+
66+
/**
67+
* Wrapper data class for External package-lists in Dokka
68+
*
69+
* This class allows us to map package-lists in a type-safe way, versus inline straight to
70+
* a map. This extra step could be removed- but it could also catch bugs in the future.
71+
*
72+
* @property packageList the prepared package-list file to map against
73+
* @property externalLink the url to map with when generating the docs
74+
*/
75+
data class ExternalDocumentationLink(
76+
val packageList: File,
77+
val externalLink: String
78+
)
79+
80+
/**
81+
* Task to run Dackka on a project.
82+
*
83+
* Since dackka needs to be run on the command line, we have to organize the arguments for dackka into
84+
* a json file. We then pass that json file to dackka as an argument.
85+
*
86+
* @see GenerateDocumentationTaskExtension
87+
*/
88+
abstract class GenerateDocumentationTask @Inject constructor(
89+
private val workerExecutor: WorkerExecutor
90+
) : GenerateDocumentationTaskExtension() {
91+
92+
@TaskAction
93+
fun build() {
94+
val configFile = saveToJsonFile(constructArguments())
95+
launchDackka(clientName, configFile, workerExecutor)
96+
}
97+
98+
private fun constructArguments(): JSONObject {
99+
val jsonMap = mapOf(
100+
"moduleName" to "",
101+
"outputDir" to outputDirectory.get().path,
102+
"globalLinks" to "",
103+
"sourceSets" to listOf(mutableMapOf(
104+
"sourceSetID" to mapOf(
105+
"scopeId" to "androidx",
106+
"sourceSetName" to "main"
107+
),
108+
"sourceRoots" to kotlinSources.get().map { it.path } + javaSources.get().map { it.path },
109+
"classpath" to dependencies.get().map { it.path },
110+
"documentedVisibilities" to listOf("PUBLIC", "PROTECTED"),
111+
"skipEmptyPackages" to "true",
112+
"suppressedFiles" to suppressedFiles.get().map { it.path },
113+
"externalDocumentationLinks" to createExternalLinks(packageListFiles).map { mapOf(
114+
"url" to it.externalLink,
115+
"packageListUrl" to it.packageList.toURI()
116+
) }
117+
)),
118+
"offlineMode" to "true",
119+
"noJdkLink" to "true"
120+
)
121+
122+
return JSONObject(jsonMap)
123+
}
124+
125+
private fun createExternalLinks(packageLists: ListProperty<File>): List<ExternalDocumentationLink> {
126+
val linksMap = mapOf(
127+
"android" to "https://developer.android.com/reference/kotlin/",
128+
"google" to "https://developers.google.com/android/reference/",
129+
"firebase" to "https://firebase.google.com/docs/reference/kotlin/",
130+
"coroutines" to "https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/"
131+
)
132+
133+
return packageLists.get().map {
134+
val externalLink = linksMap[it.parentFile.nameWithoutExtension] ?: throw RuntimeException("Unexpected package-list found: ${it.name}")
135+
ExternalDocumentationLink(it, externalLink)
136+
}
137+
}
138+
139+
private fun saveToJsonFile(jsonObject: JSONObject): File {
140+
val outputFile = File.createTempFile("dackkaArgs", ".json")
141+
142+
outputFile.deleteOnExit()
143+
outputFile.writeText(jsonObject.toString(2))
144+
145+
return outputFile
146+
}
147+
148+
private fun launchDackka(clientName: Property<String>, argsFile: File, workerExecutor: WorkerExecutor) {
149+
val workQueue = workerExecutor.noIsolation()
150+
151+
workQueue.submit(DackkaWorkAction::class.java) {
152+
args.set(listOf(argsFile.path, "-loggingLevel", "WARN"))
153+
classpath.set(setOf(dackkaJarFile.get()))
154+
projectName.set(clientName)
155+
}
156+
}
157+
}
158+
159+
/**
160+
* Parameters needs to launch the Dackka fat jar on the command line.
161+
*
162+
* @property args a list of arguments to pass to Dackka- should include the json arguments file
163+
* @property classpath the classpath to use during execution of the jar file
164+
* @property projectName name of the calling project, used for the devsite tenant (output directory)
165+
*/
166+
interface DackkaParams : WorkParameters {
167+
val args: ListProperty<String>
168+
val classpath: SetProperty<File>
169+
val projectName: Property<String>
170+
}
171+
172+
/**
173+
* Work action to launch dackka with a [DackkaParams].
174+
*
175+
* Work actions are organized sections of work, offered by gradle.
176+
*/
177+
abstract class DackkaWorkAction @Inject constructor(
178+
private val execOperations: ExecOperations
179+
) : WorkAction<DackkaParams> {
180+
override fun execute() {
181+
execOperations.javaexec {
182+
mainClass.set("org.jetbrains.dokka.MainKt")
183+
args = parameters.args.get()
184+
classpath(parameters.classpath.get())
185+
186+
environment("DEVSITE_TENANT", "client/${parameters.projectName.get()}")
187+
}
188+
}
189+
}

0 commit comments

Comments
 (0)