xref: /aosp_15_r20/external/accompanist/docs/using-snapshot-version.md (revision fa44fe6ae8e729aa3cfe5c03eedbbf98fb44e2c6)
1*fa44fe6aSInna Palant# Using a Snapshot Version of the Library
2*fa44fe6aSInna Palant
3*fa44fe6aSInna PalantIf you would like to depend on the cutting edge version of the Accompanist
4*fa44fe6aSInna Palantlibrary, you can use the [snapshot versions][snap] that are published to
5*fa44fe6aSInna Palant[Sonatype OSSRH](https://central.sonatype.org/)'s snapshot repository. These are updated on every commit to `main`.
6*fa44fe6aSInna Palant
7*fa44fe6aSInna PalantTo do so:
8*fa44fe6aSInna Palant
9*fa44fe6aSInna Palant```groovy
10*fa44fe6aSInna Palantrepositories {
11*fa44fe6aSInna Palant    // ...
12*fa44fe6aSInna Palant    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
13*fa44fe6aSInna Palant}
14*fa44fe6aSInna Palant
15*fa44fe6aSInna Palantdependencies {
16*fa44fe6aSInna Palant    // Check the latest SNAPSHOT version from the link above
17*fa44fe6aSInna Palant    classpath 'com.google.accompanist:accompanist-coil:XXX-SNAPSHOT'
18*fa44fe6aSInna Palant}
19*fa44fe6aSInna Palant```
20*fa44fe6aSInna Palant
21*fa44fe6aSInna PalantYou might see a number of different versioned snapshots. If we use an example:
22*fa44fe6aSInna Palant
23*fa44fe6aSInna Palant* `0.3.0-SNAPSHOT` is a build from the `main` branch, and depends on the latest tagged Jetpack Compose release (i.e. [alpha03](https://developer.android.com/jetpack/androidx/releases/compose#1.0.0-alpha03)).
24*fa44fe6aSInna Palant* `0.3.0.compose-6574163-SNAPSHOT` is a build from the `snapshot` branch. This depends on the [SNAPSHOT build](https://androidx.dev) of Jetpack Compose from build `6574163`. You should only use these if you are using Jetpack Compose snapshot versions (see below).
25*fa44fe6aSInna Palant
26*fa44fe6aSInna Palant### Using Jetpack Compose Snapshots
27*fa44fe6aSInna Palant
28*fa44fe6aSInna PalantIf you're using [`SNAPSHOT`](https://androidx.dev) versions of the `androidx.compose` libraries, you might run into issues with the current stable Accompanist release forcing an older version of those libraries.
29*fa44fe6aSInna Palant
30*fa44fe6aSInna PalantWe publish snapshot versions of Accompanist which depend on recent Jetpack Compose SNAPSHOT repositories. To find a recent build, look through the [snapshot repository][snap] for any versions in the scheme `x.x.x.compose-YYYY-SNAPSHOT` (for example: `0.3.0.compose-6574163-SNAPSHOT`). The `YYYY` in the scheme is the snapshot build being used from [AndroidX](https://androidx.dev) (from the example: build [`6574163`](https://androidx.dev/snapshots/builds/6574163/artifacts)). You can then use it like so:
31*fa44fe6aSInna Palant
32*fa44fe6aSInna Palant
33*fa44fe6aSInna Palant``` groovy
34*fa44fe6aSInna Palantrepositories {
35*fa44fe6aSInna Palant    // ...
36*fa44fe6aSInna Palant    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
37*fa44fe6aSInna Palant}
38*fa44fe6aSInna Palant
39*fa44fe6aSInna Palantdependencies {
40*fa44fe6aSInna Palant    // Check the latest SNAPSHOT version from the link above
41*fa44fe6aSInna Palant    classpath 'com.google.accompanist:accompanist-coil:XXXX.compose-YYYYY-SNAPSHOT'
42*fa44fe6aSInna Palant}
43*fa44fe6aSInna Palant```
44*fa44fe6aSInna Palant
45*fa44fe6aSInna PalantThese builds are updated regularly, but there's no guarantee that we will create one for a given snapshot number.
46*fa44fe6aSInna Palant
47*fa44fe6aSInna Palant*Note:* you might also see versions in the scheme `x.x.x.ui-YYYY-SNAPSHOT`. These are the same, just using an older suffix.
48*fa44fe6aSInna Palant
49*fa44fe6aSInna Palant
50*fa44fe6aSInna Palant [snap]: https://oss.sonatype.org/content/repositories/snapshots/com/google/accompanist/