Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,34 @@ Then take whichever artifacts you need:
```kotlin
dependencies {
// The View. No Compose dependency.
implementation("com.github.rayzone107:segmentedprogressbar:2.0.0")
implementation("com.github.rayzone107.SegmentedProgressBar:segmentedprogressbar:2.0.0")

// Optional: the Jetpack Compose bindings.
implementation("com.github.rayzone107:segmentedprogressbar-compose:2.0.0")
implementation("com.github.rayzone107.SegmentedProgressBar:segmentedprogressbar-compose:2.0.0")
}
```

They are separate artifacts on purpose, so a View-only project never inherits the
Compose runtime. The Compose artifact depends on the View one for the shared
geometry and option types, so taking both never gives you two copies of anything.

> [!IMPORTANT]
> Mind the group: `com.github.rayzone107.SegmentedProgressBar`, with a **dot**
> before the repository name, not `com.github.rayzone107:`. That is how JitPack
> addresses a repository publishing more than one artifact.
>
> The shorter `com.github.rayzone107:segmentedprogressbar` does resolve, by
> coincidence: JitPack reads the artifact id as a repository name, and this
> repository happens to be called that. There is no repository named
> `segmentedprogressbar-compose`, though, so the Compose artifact resolves only
> under the dotted group. Use the dotted form for both and they stay consistent.
> Both coordinates are listed on the
> [JitPack build page](https://jitpack.io/#rayzone107/SegmentedProgressBar) for
> each tag if you would rather copy them from there.

> [!NOTE]
> JitPack builds each tag on first request, so the very first resolve after a
> release can take a minute. The exact coordinate for a tag is printed on that
> tag's [JitPack build page](https://jitpack.io/#rayzone107/SegmentedProgressBar).
> release takes a few minutes. Later resolves are served from its cache.

---

Expand Down Expand Up @@ -819,9 +832,13 @@ under R8 with no configuration on your side.
Most code needs no changes. See [docs/MIGRATION.md](docs/MIGRATION.md) for the
full list; the short version:

- **The coordinate is `com.github.rayzone107:segmentedprogressbar`.** The 0.0.1
README told people to depend on `com.github.rayzone107:durationview`, which is a
different library of mine entirely.
- **The coordinate changed**, to
`com.github.rayzone107.SegmentedProgressBar:segmentedprogressbar`. The extra dot
is JitPack's addressing for a repository with more than one artifact, which this
one now is. Worth knowing either way: the 0.0.1 README told people to depend on
`com.github.rayzone107:durationview`, a different library of mine entirely, and
the tags that did build, `1.00` and `tag_v1`, no longer resolve at all, because
JitPack cannot build 2018 Gradle any more.
- **`setBackgroundColor(int)` still works** but is deprecated, because it shadows
`View.setBackgroundColor` with a different meaning. Use
`setProgressBarBackgroundColor(int)` instead, the method the old README
Expand Down
31 changes: 25 additions & 6 deletions docs/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ supports below API 26, you cannot use 2.0.0.

```
Manifest merger failed : uses-sdk:minSdkVersion 21 cannot be smaller than
version 26 declared in library [com.github.rayzone107:segmentedprogressbar:2.0.0]
version 26 declared in library
[com.github.rayzone107.SegmentedProgressBar:segmentedprogressbar:2.0.0]
```

There is no workaround other than raising your own `minSdk`, or staying on 0.0.1.
Expand Down Expand Up @@ -130,14 +131,32 @@ bar.divisions = 10 // indices 3 and 7 are now revealed

## 9. Dependency coordinate

The 0.0.1 README documented the coordinate as
`com.github.rayzone107:durationview:0.0.1`, which was a copy-paste error from
another project. The correct 2.0.0 coordinate is:
The 2.0.0 coordinate is:

```kotlin
implementation("com.github.rayzone107:segmentedprogressbar:2.0.0")
implementation("com.github.rayzone107.SegmentedProgressBar:segmentedprogressbar:2.0.0")
```

Note the **dot** before the repository name. That is how JitPack addresses a
repository publishing more than one artifact, which this one now does. The
artifact id itself is unchanged.

`com.github.rayzone107:segmentedprogressbar` also resolves, since JitPack reads
the artifact id as a repository name and this repository happens to be called
that, but there is no repository named `segmentedprogressbar-compose`, so the
Compose artifact needs the dotted group. Using it for both keeps them consistent.

Whatever you had before was probably not working anyway:

- The 0.0.1 README documented the coordinate as
`com.github.rayzone107:durationview:0.0.1`, a copy-paste error naming a
different library of mine entirely.
- The version was never `0.0.1` as far as JitPack is concerned. It serves by git
tag, and the tags on this repository are `1.00`, `1.01` and `tag_v1`. The `1.01`
build failed even at the time.
- None of them resolve today. JitPack rebuilds on request, and the 2018 build
cannot run on current infrastructure.

## 10. Things that did *not* change

- The class name and package: `com.rachitgoyal.segmented.SegmentedProgressBar`.
Expand Down Expand Up @@ -194,7 +213,7 @@ remaining caveat is that a drop shadow forces a software layer.
There is now a second artifact if you want a Composable rather than a View:

```kotlin
implementation("com.github.rayzone107:segmentedprogressbar-compose:2.0.0")
implementation("com.github.rayzone107.SegmentedProgressBar:segmentedprogressbar-compose:2.0.0")
```

It shares the option enums and the layout maths with the View, so the two render
Expand Down
Loading