Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libs.versions.toml: Lib alias starting with a lowercase letter followed by an uppercase letter don't work when referenced later #28928

Open
programmerHaaks opened this issue Apr 23, 2024 · 3 comments
Labels
a:bug has:workaround Indicates that the issue has a workaround in:dependency-version-catalog re:comprehensibility reasonable errors and warnings, clear dsl, mental overload

Comments

@programmerHaaks
Copy link

Current Behavior

Libraries (and bundles) declared with a single lowercase letter followed by an uppercase letter don't work. When referencing the lib Gradle can't find it when you build.

An observation/"workaround": If you reference the lib with an uppercase letter instead (without changing the definition to start with an uppercase letter) it works.

Expected Behavior

Using a lowercase letter as the first letter and an uppercase letter as the second letter in a variable name when declaring a library in the libs.versions.toml and referencing it later with the same name should work.

Context (optional)

Some of the libs I use start with a lowercase letter followed by an uppercase one. I wanted to do the same when declaring aliases for them in my libs.versions.toml file.

Steps to Reproduce

Declare a library alias in the libs.versions.toml file that starts with a single lower-case letter that is followed by an upper-case letter. E.g. mLib

Use this library in your build.gradle file
E.g. testImplementation libs.mLib

Build the project. It gives an error like Could not get unknown property 'mLib' for extension 'libs' of type org.gradle.accessors.dm.LibrariesForLibs.

Gradle version

8.7

Build scan URL (optional)

No response

Your Environment (optional)

Gradle wrapper 8.7,
Java 17 Temurin,
Ubuntu 22.04.4 LTS

@programmerHaaks
Copy link
Author

programmerHaaks commented Apr 23, 2024

Should be labeled "dependency-version-catalog", but I can't add it myself.

@ov7a
Copy link
Member

ov7a commented Apr 23, 2024

Can you share a MWE, please?

The ideal way to provide a reproducer is to leverage our reproducer template.

@ov7a ov7a added in:dependency-version-catalog has:workaround Indicates that the issue has a workaround re:comprehensibility reasonable errors and warnings, clear dsl, mental overload and removed to-triage labels Apr 23, 2024
@ov7a
Copy link
Member

ov7a commented Apr 25, 2024

The issue is in the backlog of the relevant team, but the existence of a workaround means it might take a while before a fix is made.


P.S. I managed to reproduce this, but having a self-contained reproducer with multiple examples would still help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug has:workaround Indicates that the issue has a workaround in:dependency-version-catalog re:comprehensibility reasonable errors and warnings, clear dsl, mental overload
Projects
None yet
Development

No branches or pull requests

2 participants