-
Notifications
You must be signed in to change notification settings - Fork 192
/
CrateSet.kt
82 lines (71 loc) · 2.38 KB
/
CrateSet.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
data class Crate(val name: String, val versionPropertyName: String)
object CrateSet {
const val STABLE_VERSION_PROP_NAME = "smithy.rs.runtime.crate.stable.version"
const val UNSTABLE_VERSION_PROP_NAME = "smithy.rs.runtime.crate.unstable.version"
/*
* Crates marked as `STABLE_VERSION_PROP_NAME` should have the following package metadata in their `Cargo.toml`
*
* [package.metadata.smithy-rs-release-tooling]
* stable = true
*/
val StableCrates = setOf(
// AWS crates
"aws-config",
"aws-credential-types",
"aws-runtime",
"aws-runtime-api",
"aws-sigv4",
"aws-types",
// smithy crates
"aws-smithy-async",
"aws-smithy-runtime-api",
"aws-smithy-runtime",
"aws-smithy-types",
)
val version = { name: String ->
when {
StableCrates.contains(name) -> STABLE_VERSION_PROP_NAME
else -> UNSTABLE_VERSION_PROP_NAME
}
}
val AWS_SDK_RUNTIME = listOf(
"aws-config",
"aws-credential-types",
"aws-endpoint",
"aws-http",
"aws-hyper",
"aws-runtime",
"aws-runtime-api",
"aws-sig-auth",
"aws-sigv4",
"aws-types",
).map { Crate(it, version(it)) }
val SMITHY_RUNTIME_COMMON = listOf(
"aws-smithy-async",
"aws-smithy-checksums",
"aws-smithy-client",
"aws-smithy-eventstream",
"aws-smithy-http",
"aws-smithy-http-auth",
"aws-smithy-http-tower",
"aws-smithy-json",
"aws-smithy-protocol-test",
"aws-smithy-query",
"aws-smithy-runtime",
"aws-smithy-runtime-api",
"aws-smithy-types",
"aws-smithy-types-convert",
"aws-smithy-xml",
).map { Crate(it, version(it)) }
val AWS_SDK_SMITHY_RUNTIME = SMITHY_RUNTIME_COMMON
val SERVER_SMITHY_RUNTIME = SMITHY_RUNTIME_COMMON + listOf(
Crate("aws-smithy-http-server", UNSTABLE_VERSION_PROP_NAME),
Crate("aws-smithy-http-server-python", UNSTABLE_VERSION_PROP_NAME),
Crate("aws-smithy-http-server-typescript", UNSTABLE_VERSION_PROP_NAME),
)
val ENTIRE_SMITHY_RUNTIME = (AWS_SDK_SMITHY_RUNTIME + SERVER_SMITHY_RUNTIME).toSortedSet(compareBy { it.name })
}