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