
Fixes #162107 Commands that were helpful when working on this pr. `dart dev/tools/bin/generate_gradle_lockfiles.dart --no-gradle-generation` from flutter/flutter root. `./gradlew test` from packages/flutter_tools/gradle. `git add -- ":*.lockfile"` for adding only lockfile changes. `../../bin/cache/dart-sdk/bin/dart bin/test_runner.dart test -t android_java11_dependency_smoke_tests` from dev/devicelab `ktlint --editorconfig=dev/bots/test/analyze-test-input/.editorconfig --baseline=dev/bots/test/analyze-test-input/ktlint-baseline.xml packages/flutter_tools/gradle/src/ --format` formatting kotlin code. Need ktlint 1.5 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing.
40 lines
1.2 KiB
Kotlin
40 lines
1.2 KiB
Kotlin
// Copyright 2014 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
package com.flutter.gradle
|
|
|
|
import kotlinx.serialization.json.JsonObject
|
|
import kotlinx.serialization.json.buildJsonObject
|
|
import kotlinx.serialization.json.put
|
|
import kotlinx.serialization.json.putJsonArray
|
|
|
|
/*
|
|
* See https://developer.android.com/training/app-links/ for more information about app link.
|
|
*/
|
|
data class AppLinkSettings(
|
|
val applicationId: String?
|
|
) {
|
|
var deeplinkingFlagEnabled = false
|
|
val deeplinks = mutableSetOf<Deeplink>()
|
|
|
|
// An example json:
|
|
// {
|
|
// applicationId: "com.example.app",
|
|
// deeplinks: [
|
|
// {"scheme":"http", "host":"example.com", "path":".*"},
|
|
// {"scheme":"https","host":"example.com","path":".*"}
|
|
// ]
|
|
// }
|
|
fun toJson(): JsonObject =
|
|
buildJsonObject {
|
|
put("applicationId", applicationId)
|
|
put("deeplinkingFlagEnabled", deeplinkingFlagEnabled)
|
|
putJsonArray("deeplinks") {
|
|
for (deeplink: Deeplink in deeplinks) {
|
|
add(deeplink.toJson())
|
|
}
|
|
}
|
|
}
|
|
}
|