Replace a catalog package with your own
plinto's catalog gives every organization its build systems, toolchains and common libraries. A package of yours with a catalog name replaces the catalog's for you: it shadows the catalog's in your version groups, while every other organization keeps reading the catalog's. Your projects name it as they did, so no plinto.conf changes.
Replace, or add versions
What a package of yours does to the catalog's depends on where it comes from:
| Your package of a catalog name | What your groups see |
|---|---|
| A new package, a linked repository, uploaded files, or an import of something else | yours alone: it replaces the catalog's |
| An import of the same library the catalog imported, at another version | the catalog's versions and yours: it adds versions, see below |
1. Make your package
In the Code app, New package, with the catalog's name spelled as the catalog spells it: Archive, not archive. Another spelling is refused, as it would be a second package beside the catalog's:
the catalog's package is Archive: a package of the name is spelled so
An import of something else takes a catalog name only when you name it so, with --name, or by typing the name in the package's row of the plan in the Code app's Import:
$ plinto import maven com.example:archive:2.0 --name com.example:archive=Archive
Without it, the import is refused, so nothing replaces a catalog package by chance:
these are the catalog's packages, from elsewhere than this import's: name them otherwise, or by those names to replace the catalog's in this organization
Archive 2.0: the catalog's Archive is no import
2. Release it
Build it into your group like any package. Its first release is numbered above the catalog's: if the catalog has Archive 1.0-10, yours starts at 1.0-11. The build that releases it pins it in the group, so from that revision on, your projects build with yours.
A version the catalog has is never yours: uploading files as one of the catalog's versions is refused.
3. What changes
-
Your groups list your versions alone, and the Groups app marks the package replaces the catalog's.
-
Old revisions keep the catalog's version they pinned: a revision that pinned the catalog's
Archive 1.0-9builds as it did. -
Merges from the catalog skip it, with a warning in the merge's plan, and take everything else as before:
main has its own Archive, so the catalog's 1.0-12 is not taken -
Build systems and packagers are replaced the same way: your own
JavaBuildorArchivebuilds your organization's projects, and nobody else's. -
Other organizations never see your package, and the catalog doesn't change.
4. Go back to the catalog's
When the catalog has what you needed, open your package in the Code app and choose Use the catalog's again…. Your groups take whatever is latest in the catalog's main with their next merge of it:
JavaConfiguration goes back to the catalog's: its own 1.0-2 → 1.0-3
- Your releases stay, so a revision that pinned one still builds with it. Nothing builds your repository any more, and it keeps its history.
- A version you held by hand stays yours until a person takes the catalog's.
- A line only yours has, such as
0.2where the catalog's main has none, stays while projects ask for it. - Use yours again shadows the catalog's once more. The page lists each time yours did, from one revision to another.
You and the catalog each number your own builds, so the catalog may have released a 1.0-2 while yours had one too. Your groups then name the catalog's as 1.0-2@plinto, and plain 1.0-2 stays yours, so what an old revision pinned never changes. The apps show either one as 1.0 and the commit it was built from; a revision's page shows the whole version, 1.0-2@plinto.
When an import adds versions
An import of the library the catalog imported, from the same place, doesn't replace it: your versions join the catalog's. A library built with an older Kotlin brings KotlinStdLib 2.3.0 of yours, and your groups read it beside the catalog's newer ones. A version the catalog already has is pinned from the catalog, never copied.
In the Groups app, a package that mixes the two says yours or catalog beside each version.
Not yet
- Templates: a template of yours can't take the name of one of the catalog's.