AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 1 | # Versioning |
| 2 | |
| 3 | [TOC] |
| 4 | |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 5 | This page covers Jetpack's usage of Semantic Versioning and pre-release cycles, |
| 6 | including the expectations at each cycle and criteria for moving to the next |
| 7 | cycle or SemVer revision. |
| 8 | |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 9 | ## Semantic versioning and binary compatibility {#semver} |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 10 | |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 11 | Artifacts follow strict [semantic versioning](http://semver.org) for binary |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 12 | compatibility with an added inter-version sequence of pre-release revisions. |
| 13 | Versions for finalized release artifacts, which are available on |
| 14 | [Google Maven](https://maven.google.com) will follow the format |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 15 | `<major>.<minor>.<bugfix>` with an optional `-<alpha|beta|rc><nn>` suffix. |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 16 | Internal or nightly releases, which are available on |
| 17 | [androidx.dev](http://androidx.dev), use the `-SNAPSHOT` suffix. |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 18 | |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 19 | ### Behavioral and source compatibility {#compat} |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 20 | |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 21 | Libraries are required to preserve *behavioral compatibility* -- APIs must |
| 22 | behave as described in their documentation -- across minor versions. Special |
| 23 | consideration must also be made for changes to undocumented behavior, as |
| 24 | developers may have made their own assumptions about API contracts based on |
| 25 | observed behavior. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 26 | |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 27 | Libraries are strongly encouraged to preserve *source compatibility* across |
| 28 | minor versions. Strictly requiring source compatibility would require major |
| 29 | version bumps when implementing quality-of-life improvements such as nullability |
| 30 | annotations or generics, which would be [disruptive](#major-implications) to the |
| 31 | library ecosystem. |
| 32 | |
| 33 | ### Notation {#notation} |
AndroidX Core Team | 5c914c4 | 2021-02-08 17:22:57 +0000 | [diff] [blame] | 34 | |
| 35 | Major (`x.0.0`) |
| 36 | : An artifact's major version indicates a guaranteed forward-compatibility |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 37 | window. The number is incremented only when introducing breaking API or |
| 38 | behavioral changes. |
AndroidX Core Team | 5c914c4 | 2021-02-08 17:22:57 +0000 | [diff] [blame] | 39 | |
| 40 | Minor (`1.x.0`) |
| 41 | : Minor indicates compatible public API changes. This number is incremented |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 42 | when APIs are added, including the addition of |
Ian Baker | 186108e | 2023-11-20 06:54:36 -0800 | [diff] [blame] | 43 | [`@Deprecated` annotations](/docs/api_guidelines/index.md#deprecation-and-removal). |
AndroidX Core Team | 5c914c4 | 2021-02-08 17:22:57 +0000 | [diff] [blame] | 44 | Binary compatibility must be preserved between minor version changes. |
| 45 | |
| 46 | Bugfix (`1.0.x`) |
| 47 | : Bugfix indicates internal changes to address broken behavior. Care should be |
| 48 | taken to ensure that existing clients are not broken, including clients that |
| 49 | may have been working around long-standing broken behavior. |
| 50 | |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 51 | #### Pre-release cycles {#prerelease} |
AndroidX Core Team | 5c914c4 | 2021-02-08 17:22:57 +0000 | [diff] [blame] | 52 | |
alanv | e048d1c | 2021-02-11 08:46:57 -0800 | [diff] [blame] | 53 | Alpha (`1.0.0-alphaXX`) |
AndroidX Core Team | 5c914c4 | 2021-02-08 17:22:57 +0000 | [diff] [blame] | 54 | : Feature development and API stabilization phase. |
| 55 | |
alanv | e048d1c | 2021-02-11 08:46:57 -0800 | [diff] [blame] | 56 | Beta (`1.0.0-betaXX`) |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 57 | : Functional stabilization phase. Suitable for production use. |
AndroidX Core Team | 5c914c4 | 2021-02-08 17:22:57 +0000 | [diff] [blame] | 58 | |
alanv | e048d1c | 2021-02-11 08:46:57 -0800 | [diff] [blame] | 59 | RC (`1.0.0-rcXX`) |
AndroidX Core Team | 5c914c4 | 2021-02-08 17:22:57 +0000 | [diff] [blame] | 60 | : Verification phase. |
| 61 | |
| 62 | Stable (no-suffix) |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 63 | : Recommended for production use. |
AndroidX Core Team | 5c914c4 | 2021-02-08 17:22:57 +0000 | [diff] [blame] | 64 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 65 | In the past -- and only in rare cases -- libraries have used a `-devXX` suffix |
| 66 | to indicate that a public release does not yet meet the requirements for Alpha. |
| 67 | We **strongly discourage** libraries from using `-devXX`, as failing to meet the |
| 68 | requirements for Alpha indicates that a library should not be publicly released. |
| 69 | |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 70 | ### Major (`x.0.0`) {#major} |
| 71 | |
| 72 | An artifact's major version indicates a guaranteed forward-compatibility window. |
| 73 | For example, a developer could update an artifact versioned `2.0.0` to `2.7.3` |
alanv | e048d1c | 2021-02-11 08:46:57 -0800 | [diff] [blame] | 74 | without taking any additional action; however, updating from `2.7.3` to `3.0.0` |
| 75 | may require a complete rewrite of their application or cause conflicts with |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 76 | their dependencies. Major version bumps are |
| 77 | [strongly discouraged](#major-implications). |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 78 | |
alanv | e54cc24 | 2021-02-11 13:49:33 -0800 | [diff] [blame] | 79 | #### When to increment {#major-when} |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 80 | |
| 81 | An artifact *must* increment its major version number in response to breaking |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 82 | changes in binary or behavioral compatibility within the library itself *or* in |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 83 | response to breaking changes within a dependency. |
| 84 | |
| 85 | For example, if an artifact updates a SemVer-type dependency from `1.0.0` to |
| 86 | `2.0.0` then the artifact must also bump its own major version number. |
| 87 | |
| 88 | An artifact *may in rare cases* increment its major version number to indicate |
| 89 | an important but non-breaking change in the library. Note, however, that the |
| 90 | SemVer implications of incrementing the major version are the same as a breaking |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 91 | change -- dependent projects *must* assume the major version change is breaking |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 92 | and update their dependency specifications. |
| 93 | |
alanv | e54cc24 | 2021-02-11 13:49:33 -0800 | [diff] [blame] | 94 | #### Ecosystem implications {#major-implications} |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 95 | |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 96 | When an artifact increases its major version, *all* artifacts that depended on |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 97 | the previous major version are no longer considered compatible and must |
| 98 | explicitly migrate to depend on the new major version. |
| 99 | |
| 100 | As a result, if the library ecosystem is slow to adopt a new major version of an |
| 101 | artifact then developers may end up in a situation where they cannot update an |
| 102 | artifact because they depend on a library that has not yet adopted the new major |
| 103 | version. |
| 104 | |
| 105 | For this reason, we *strongly* recommend against increasing the major version of |
| 106 | a “core” artifact that is depended upon by other libraries. “Leaf” artifacts -- |
| 107 | those that apps depend upon directly and are not used by other libraries -- have |
| 108 | a much easier time increasing their major version. |
| 109 | |
alanv | e54cc24 | 2021-02-11 13:49:33 -0800 | [diff] [blame] | 110 | #### Process requirements {#major-process} |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 111 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 112 | If the artifact has dependencies within Jetpack, owners *must* complete an |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 113 | assessment before implementing any breaking changes to binary or behavioral |
| 114 | compatibility. |
| 115 | |
| 116 | Otherwise, owners are *strongly recommended* to complete the assessment before |
| 117 | implementing any breaking changes to binary or behavioral compatibility, as such |
| 118 | changes may negatively impact downstream clients in Android git or Google's |
| 119 | repository. These clients are not part of our pre-submit workflow, but filling |
| 120 | out the assessment will provide insight into how they will be affected by a |
| 121 | major version change. |
| 122 | |
| 123 | ### Minor (`1.x.0`) {#minor} |
| 124 | |
| 125 | Minor indicates compatible public API changes. This number is incremented when |
AndroidX Core Team | b73968c | 2023-03-30 10:06:49 -0700 | [diff] [blame] | 126 | APIs are added -- including the addition of `@Deprecated` annotations -- and |
| 127 | libraries must go through a full [pre-release](#pre-release-suffix) cycle before |
| 128 | reaching stable. Binary compatibility must be preserved between minor version |
| 129 | changes. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 130 | |
| 131 | #### Moving between minor versions: |
| 132 | |
| 133 | * A change in the minor revision indicates the addition of binary-compatible |
| 134 | APIs. Libraries **must** increment their minor revision when adding APIs. |
| 135 | Dependent libraries are not required to update their minimum required |
| 136 | version unless they depend on newly-added APIs. |
| 137 | |
| 138 | ### Bugfix (`1.0.x`) {#bugfix} |
| 139 | |
| 140 | Bugfix indicates internal changes to address broken behavior. Care should be |
| 141 | taken to ensure that existing clients are not broken, including clients that may |
AndroidX Core Team | b73968c | 2023-03-30 10:06:49 -0700 | [diff] [blame] | 142 | have been working around long-standing broken behavior. Bugfix releases *do not* |
| 143 | go through a pre-release cycle and are considered stable. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 144 | |
| 145 | #### Moving between bugfix versions: |
| 146 | |
| 147 | * A change in the bugfix revision indicates changes in behavior to fix bugs. |
| 148 | The API surface does not change. Changes to the bugfix version may *only* |
| 149 | occur in a release branch. The bugfix revision must always be `.0` in a |
| 150 | development branch. |
| 151 | |
| 152 | ### Pre-release suffixes {#pre-release-suffix} |
| 153 | |
| 154 | The pre-release suffix indicates stability and feature completeness of a |
| 155 | release. A typical release will begin as alpha, move to beta after acting on |
| 156 | feedback from internal and external clients, move to release candidate for final |
| 157 | verification, and ultimately move to a finalized build. |
| 158 | |
| 159 | Alpha, beta, and release candidate releases are versioned sequentially using a |
| 160 | leading zero (ex. alpha01, beta11, rc01) for compatibility with the |
| 161 | lexicographic ordering of versions used by SemVer. |
| 162 | |
| 163 | ### Snapshot {#snapshot} |
| 164 | |
| 165 | Snapshot releases are whatever exists at tip-of-tree. They are only subject to |
| 166 | the constraints placed on the average commit. Depending on when it's cut, a |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 167 | snapshot may even be binary-identical to an `alpha`, `beta`, or `RC` release. |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 168 | |
| 169 | ### Tooling guarantees |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 170 | |
| 171 | Versioning policies are enforced by the following Gradle tasks: |
| 172 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 173 | - `checkApi`: ensures that changes to public API are intentional and tracked, |
| 174 | asking the developer to explicitly run `updateApi` (see below) if any |
| 175 | changes are detected |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 176 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 177 | - `checkApiRelease`: verifies that API changes between previously released and |
| 178 | currently under-development versions conform to semantic versioning |
| 179 | guarantees |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 180 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 181 | - `updateApi`: commits API changes to source control in such a way that they |
| 182 | can be reviewed in pre-submit via Gerrit `API+2` and reviewed in post-submit |
| 183 | by API Council |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 184 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 185 | `SNAPSHOT` is automatically added to the version string for all builds that |
| 186 | occur outside the build server for release branches. Local release builds may be |
| 187 | forced by passing `-Prelease` to the Gradle command line. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 188 | |
| 189 | ## Picking the right version {#picking-the-right-version} |
| 190 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 191 | Libraries follow [semantic versioning](#semver), which means that the version |
| 192 | code is strongly tied to the API surface. A full version consists of revision |
| 193 | numbers for major, minor, and bugfix as well as a pre-release stage and |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 194 | revision. Correct versioning is, for the most part, automatically enforced; |
| 195 | however, please check for the following: |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 196 | |
| 197 | ### Initial version {#initial-version} |
| 198 | |
| 199 | If your library is brand new, your version should start at 1.0.0, e.g. |
| 200 | `1.0.0-alpha01`. |
| 201 | |
| 202 | The initial release within a new version always starts at `alpha01`. Note the |
| 203 | two-digit revision code, which allows us to do up to 99 revisions within a |
| 204 | pre-release stage. |
| 205 | |
| 206 | ### Pre-release stages |
| 207 | |
| 208 | A single version will typically move through several revisions within each of |
| 209 | the pre-release stages: alpha, beta, rc, and stable. Subsequent revisions within |
| 210 | a stage (ex. alpha, beta) are incremented by 1, ex. `alpha01` is followed by |
| 211 | `alpha02` with no gaps. |
| 212 | |
| 213 | ### Moving between pre-release stages and revisions |
| 214 | |
| 215 | Libraries are expected to go through a number of pre-release stages within a |
| 216 | version prior to release, with stricter requirements at each stage to ensure a |
| 217 | high-quality stable release. The owner for a library should typically submit a |
| 218 | CL to update the stage or revision when they are ready to perform a public |
| 219 | release. |
| 220 | |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 221 | Libraries are expected to allow >= 2 weeks per pre-release stage. This "soaking |
| 222 | period" gives developers time to try each version, find bugs, and ensure a |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 223 | quality stable release. Therefore, at minimum: |
| 224 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 225 | - An `alpha` version must be publicly available for 2 weeks before releasing a |
| 226 | public `beta` |
| 227 | - A `beta` version must be publicly available for 2 weeks before releasing a |
| 228 | public `rc` |
| 229 | - A `rc` version must be publicly available for 2 weeks before releasing a |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 230 | public stable version |
| 231 | |
| 232 | Your library must meet the following criteria to move your public release to |
| 233 | each stage: |
| 234 | |
| 235 | ### Alpha {#alpha} |
| 236 | |
| 237 | Alpha releases are expected to be functionally stable, but may have unstable API |
AndroidX Core Team | 2cf0d5b | 2024-07-29 10:20:04 -0700 | [diff] [blame] | 238 | surface or incomplete features. Changes in alpha do trigger API Council review, |
| 239 | but the feedback does not block an alpha release. Library owners are expected to |
| 240 | have performed a minimum level of validation. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 241 | |
| 242 | #### Within the `alphaXX` cycle |
| 243 | |
AndroidX Core Team | b73968c | 2023-03-30 10:06:49 -0700 | [diff] [blame] | 244 | * Workflow |
| 245 | * Development happens in `androidx-main` or `androidx-platform-dev` |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 246 | * API surface |
| 247 | * Prior to `alpha01` release, API tracking **must** be enabled (either |
| 248 | `publish=true` or create an `api` directory) and remain enabled |
| 249 | * May add/remove APIs within `alpha` cycle, but deprecate/remove cycle is |
| 250 | strongly recommended. |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 251 | * May use |
Ian Baker | 186108e | 2023-11-20 06:54:36 -0800 | [diff] [blame] | 252 | [experimental APIs](/docs/api_guidelines/index.md#experimental-api) |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 253 | across same-version group boundaries |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 254 | * Testing |
AndroidX Core Team | baf089a | 2023-10-09 07:45:09 -0700 | [diff] [blame] | 255 | * Ensure the library is testable. Follow the guideline on |
Ian Baker | 186108e | 2023-11-20 06:54:36 -0800 | [diff] [blame] | 256 | [go/androidx/testability](/docs/testability.md) |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 257 | * All changes **should** be accompanied by a `Test:` stanza |
| 258 | * All pre-submit and post-submit tests are passing |
| 259 | * Flaky or failing tests **must** be suppressed or fixed within one day |
| 260 | (if affecting pre-submit) or three days (if affecting post-submit) |
| 261 | |
| 262 | ### Beta {#beta} |
| 263 | |
| 264 | Beta releases are ready for production use but may contain bugs. They are |
| 265 | expected to be functionally stable and have highly-stable, feature-complete API |
alanv | e048d1c | 2021-02-11 08:46:57 -0800 | [diff] [blame] | 266 | surface. All APIs should have been reviewed by API Council at this stage. Tests |
| 267 | should have 100% coverage of public API surface and translations must be 100% |
| 268 | complete. |
| 269 | |
| 270 | While beta represents API Freeze, it does not necessarily mean APIs are locked |
| 271 | down permanently. A limited number of exceptions may be granted by API Council |
| 272 | in cases where ship-blocking mistakes or significant user experience issues can |
| 273 | be addressed with minimal changes to the API surface. Exceptions **will not** be |
| 274 | granted for new features, non-trivial API changes, significant refactorings, or |
| 275 | any changes likely to introduce additional functional instability. Requests for |
| 276 | exceptions **must** be accompanied by a justification explaining why the change |
AndroidX Core Team | 0db91f0 | 2021-05-06 22:45:18 +0000 | [diff] [blame] | 277 | cannot be made in a future minor version. This policy does not apply to |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 278 | additions of experimental `@RequiresOptIn` APIs or changes to `@RequiresOptIn` |
| 279 | APIs. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 280 | |
AndroidX Core Team | ee9c1aa | 2021-04-06 17:29:05 +0000 | [diff] [blame] | 281 | #### Checklist for moving to `beta01` {#beta-checklist} |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 282 | |
| 283 | * API surface |
| 284 | * Entire API surface has been reviewed by API Council |
| 285 | * All APIs from alpha undergoing deprecate/remove cycle must be removed |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 286 | * The final removal of a `@Deprecated` API should occur in alpha, not |
| 287 | in beta |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 288 | * Must not use |
Ian Baker | 186108e | 2023-11-20 06:54:36 -0800 | [diff] [blame] | 289 | [experimental APIs](/docs/api_guidelines#experimental-api) |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 290 | across same-version group boundaries |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 291 | * Testing |
| 292 | * All public APIs are tested |
| 293 | * All pre-submit and post-submit tests are enabled (e.g. all suppressions |
| 294 | are removed) and passing |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 295 | * Use of experimental Kotlin features (e.g. `@OptIn`) must be audited for |
| 296 | stability |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 297 | * All dependencies are `beta`, `rc`, or stable |
| 298 | * Be able to answer the question "How will developers test their apps against |
| 299 | your library?" |
| 300 | * Ideally, this is an integration app with automated tests that cover the |
| 301 | main features of the library and/or a `-testing` artifact as seen in |
| 302 | other Jetpack libraries |
| 303 | |
| 304 | #### Within the `betaXX` cycle |
| 305 | |
AndroidX Core Team | b73968c | 2023-03-30 10:06:49 -0700 | [diff] [blame] | 306 | * Workflow |
| 307 | * Development happens in `androidx-main` or, in extremely limited cases, |
| 308 | changes are cherry-picked to a `-release` branch |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 309 | * API surface |
alanv | e54cc24 | 2021-02-11 13:49:33 -0800 | [diff] [blame] | 310 | * May not add, remove, or change APIs unless granted an exception by API |
| 311 | Council following the beta API change exception request process |
AndroidX Core Team | 0db91f0 | 2021-05-06 22:45:18 +0000 | [diff] [blame] | 312 | * Must go through the full `@Deprecate` and hard-removal cycle in |
| 313 | separate `beta` releases for any exception-approved API removals or |
| 314 | changes |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 315 | * May not remove `@RequiresOptIn` annotations from experimental APIs, as |
| 316 | this would amount to an API addition |
| 317 | * **May** add new `@RequiresOptIn` APIs and change existing experimental |
AndroidX Core Team | 0db91f0 | 2021-05-06 22:45:18 +0000 | [diff] [blame] | 318 | APIs |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 319 | |
| 320 | ### RC {#rc} |
| 321 | |
| 322 | Release candidates are expected to be nearly-identical to the final release, but |
| 323 | may contain critical last-minute fixes for issues found during integration |
| 324 | testing. |
| 325 | |
| 326 | #### Checklist for moving to `rc01` |
| 327 | |
| 328 | * All previous checklists still apply |
| 329 | * Release branch, e.g. `androidx-<group_id>-release`, is created |
| 330 | * API surface |
| 331 | * Any API changes from `beta` cycle are reviewed by API Council |
alanv | 5e4feac | 2022-07-13 09:55:38 -0700 | [diff] [blame] | 332 | * No **known** `P0` or `P1` (ship-blocking) issues |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 333 | * All dependencies are `rc` or stable |
| 334 | |
| 335 | #### Within the `rcXX` cycle |
| 336 | |
AndroidX Core Team | b73968c | 2023-03-30 10:06:49 -0700 | [diff] [blame] | 337 | * Changes are cherry-picked to a `-release` branch |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 338 | * Ship-blocking bug fixes only |
| 339 | * All changes must have corresponding tests |
| 340 | * No API changes allowed |
| 341 | |
| 342 | ### Stable {#stable} |
| 343 | |
| 344 | Final releases are well-tested, both by internal tests and external clients, and |
| 345 | their API surface is reviewed and finalized. While APIs may be deprecated and |
| 346 | removed in future versions, any APIs added at this stage must remain for at |
| 347 | least a year. |
| 348 | |
| 349 | #### Checklist for moving to stable |
| 350 | |
| 351 | * Identical to a previously released `rcXX` (note that this means any bugs |
| 352 | that result in a new release candidate will necessarily delay your stable |
| 353 | release by a minimum of two weeks) |
| 354 | * No changes of any kind allowed |
| 355 | * All dependencies are stable |
| 356 | |
| 357 | ## Updating your version {#update} |
| 358 | |
| 359 | A few notes about version updates: |
| 360 | |
AndroidX Core Team | 408c27b | 2020-12-15 15:57:00 +0000 | [diff] [blame] | 361 | - The version of your library listed in `androidx-main` should *always* be |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 362 | higher than the version publicly available on Google Maven. This allows us |
AndroidX Core Team | 408c27b | 2020-12-15 15:57:00 +0000 | [diff] [blame] | 363 | to do proper version tracking and API tracking. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 364 | - Version increments must be done before the CL cutoff date (aka the build cut |
| 365 | date). |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 366 | - **Increments to the next stability suffix** (like `alpha` to `beta`) should |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 367 | be handled by the library owner |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 368 | - Version increments in release branches will need to follow the guide |
Ian Baker | 186108e | 2023-11-20 06:54:36 -0800 | [diff] [blame] | 369 | [How to update your version on a release branch](/docs/release_branches.md#update-your-version) |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 370 | - When you're ready for `rc01`, the increment to `rc01` should be done in |
AndroidX Core Team | 408c27b | 2020-12-15 15:57:00 +0000 | [diff] [blame] | 371 | `androidx-main` and then your release branch should be snapped to that |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 372 | build. See the guide |
Ian Baker | 186108e | 2023-11-20 06:54:36 -0800 | [diff] [blame] | 373 | [Snap your release branch](/docs/release_branches.md#snap) |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 374 | on how to do this. After the release branch is snapped to that build, you |
| 375 | will need to update your version in `androidx-main` to `alpha01` of the next |
AndroidX Core Team | 408c27b | 2020-12-15 15:57:00 +0000 | [diff] [blame] | 376 | minor (or major) version. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 377 | |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 378 | ### How to update your version |
| 379 | |
AndroidX Core Team | 8322ab1 | 2024-04-11 14:27:28 -0700 | [diff] [blame] | 380 | 1. Update the version listed in `libraryversions.toml` |
AndroidX Core Team | 95cd3da | 2021-01-14 11:47:43 -0500 | [diff] [blame] | 381 | 1. If your library is a `beta` or `rc01` version, run `./gradlew |
| 382 | <your-lib>:updateApi`. This will create an API txt file for the new version |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 383 | of your library. For other versions, this step is not required |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 384 | 1. Verify changes with `./gradlew checkApi verifyDependencyVersions`. |
| 385 | 1. Commit these change as one commit. |
| 386 | 1. Upload these changes to Gerrit for review. |
| 387 | |
| 388 | An example of a version bump can be found here: |
| 389 | [aosp/833800](https://android-review.googlesource.com/c/platform/frameworks/support/+/833800) |
| 390 | |
| 391 | ## `-ktx` Modules {#ktx} |
| 392 | |
Ian Baker | 186108e | 2023-11-20 06:54:36 -0800 | [diff] [blame] | 393 | [Kotlin extension libraries](/docs/api_guidelines/index.md#module-ktx) |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 394 | (`-ktx`) follow the same versioning requirements as other libraries, but with |
| 395 | one exception: they must match the version of the Java libraries that they |
| 396 | extend. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 397 | |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 398 | For example, let's say you are developing a Java library |
| 399 | `androidx.foo:foo-bar:1.1.0-alpha01` and you want to add a Kotlin extension |
| 400 | library `androidx.foo:foo-bar-ktx`. Your new `androidx.foo:foo-bar-ktx` library |
| 401 | will start at version `1.1.0-alpha01` instead of `1.0.0-alpha01`. |
AndroidX Core Team | 2e416b2 | 2020-12-03 22:58:07 +0000 | [diff] [blame] | 402 | |
| 403 | If your `androidx.foo:foo-bar` module was in version `1.0.0-alpha06`, then the |
AndroidX Core Team | 21ccf65 | 2022-04-01 14:53:07 +0000 | [diff] [blame] | 404 | Kotlin extension module would start in version `1.0.0-alpha06`. |
alanv | 842f5e0 | 2022-10-11 07:25:45 -0700 | [diff] [blame] | 405 | |
| 406 | ## FAQ |
| 407 | |
| 408 | ### When does an alpha ship? |
| 409 | |
| 410 | For public releases, an alpha ships when the library lead believes it is ready. |
| 411 | Generally, these occur during the batched bi-weekly (every 2 weeks) release |
| 412 | because all tip-of-tree dependencies will need to be released too. |
| 413 | |
alanv | 842f5e0 | 2022-10-11 07:25:45 -0700 | [diff] [blame] | 414 | ### Can alpha work (ex. for the next Minor release) occur in the primary development branch during beta API lockdown? |
| 415 | |
AndroidX Core Team | 76f6545 | 2024-01-02 11:39:57 -0800 | [diff] [blame] | 416 | Generally, no. This is by design. Focus should be spent on improving the Beta |
| 417 | version and adding documentation/samples/blog posts for usage! |
| 418 | |
| 419 | In limited cases, the |
| 420 | [`@RequiresOptIn`](/docs/api_guidelines/index.md#experimental-api) |
| 421 | meta-annotation may be used to extend development of a feature beyond the alpha |
| 422 | cycle. When doing so, extreme care must be taken to avoid destabilizing the rest |
| 423 | of the library. |
alanv | 842f5e0 | 2022-10-11 07:25:45 -0700 | [diff] [blame] | 424 | |
| 425 | ### Is there an API freeze window between alpha and beta while API surface is reviewed and tests are added, but before the beta is released? |
| 426 | |
| 427 | Yes. If any new APIs are added in this window, the beta release will be blocked |
| 428 | until API review is complete and addressed. |
| 429 | |
| 430 | ### How often can a beta release? |
| 431 | |
AndroidX Core Team | 5fa6198 | 2023-01-13 10:43:41 -0500 | [diff] [blame] | 432 | As often as needed; however, releases outside of the bi-weekly (every 2 weeks) |
alanv | 842f5e0 | 2022-10-11 07:25:45 -0700 | [diff] [blame] | 433 | release will need to get approval from the TPM (natnaelbelay@). |