Skip to content

New Catalogue API Feedback #15674

@ZacSweers

Description

@ZacSweers

Hey! I'm not sure where the right place is for this, so I hope this is ok. I've been tinkering with the upcoming catalogue API in 7.0 nightlies and wanted to share some feedback. Some of these might be bugs and one is a feature request

So far:

  • Why do catalogues have to start with a lowercase letter? I know they are properties, but considering it's accessing a structured container it feels a bit of a superficial limitation.
  • Failures to load are not super well-defined in the IDE. If it fails, it appears successful unless I go searching in IDE build logs
  • While the top-level eventually indexes, none of the generated internals are deemed as accessible (see screenshot)

image

  • A common case we've solved is a library with a common group and multiple artifacts that are not all necessarily used together, but I don't see a way to describe this in dependencies toml files currently. Basically - we want a bundle but where you define them together and can consume a-la-carte. Some syntax ideas below:
# Currently requires this, which has a lot of duplication and potentially verbose
[versions]
retrofit = "2.9.0"

[dependencies]
retrofit = { group = "com.squareup.retrofit2", version.ref = "retrofit", name = "retrofit" }
retrofit-moshi = { group = "com.squareup.retrofit2", version.ref = "retrofit", name = "converter-moshi" }
retrofit-wire = { group = "com.squareup.retrofit2", version.ref = "retrofit", name = "converter-wire" }
retrofit-scalars = { group = "com.squareup.retrofit2", version.ref = "retrofit", name = "converter-scalars" }

# Option 1 - Works with existing syntax but can result in long lines due to inline map requirements in toml
[dependencies]
retrofit = { group = "com.squareup.retrofit2", version = "2.9.0", artifacts = { retrofit = "retrofit", moshi = "converter-moshi", wire = "converter-wire", scalars = "converter-scalars" } }

# Option 2 - Array of nested tables
[[dependencies.retrofit]]
group = "com.squareup.retrofit2"
version = "2.9.0"
  # 'name' is optional - use the key as the name if absent, in this case "retrofit"
  [dependencies.retrofit.retrofit]
  [dependencies.retrofit.moshi]
    name = "converter-moshi"
  [dependencies.retrofit.wire]
    name = "converter-wire"
  [dependencies.retrofit.scalars]
    name = "converter-scalars"

# Option 3 - Array of nested tables but properties are top-level
[dependencies.retrofit]
group = "com.squareup.retrofit2"
version = "2.9.0"
# Remaining keys are artifact names
retrofit = "retrofit"
moshi = "converter-moshi"
wire = "converter-wire"
scalars = "converter-scalars"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions