question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

keepUnused flag not respected for entries under [versions]

See original GitHub issue

This use-case might be a misuse of the version catalog but our project stores versions that while aren’t referenced within the TOML file, they are referenced by the project (e.g. compileSdk version used in android gradle plugin).

android {
    compileSdk = libs.versions.compileSdk.get().toInt()
}

I assumed setting keepUnused = true would solve this but “unused” version declarations were still removed when running versionCatalogUpdate. I did verify that keepUnused = true was indeed working for unused library declarations.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Egorandcommented, Jun 6, 2022

Well, these versions do not fit the definition of “used in dependencies” - they’re simply referenced in build.gradle files. @keep-ing them individually probably makes sense to me, since version catalog is not really designed for storing non-dependency versions, so @keep is a small price to pay for convenience!

1reaction
hvissercommented, Jun 4, 2022

Hmm there are tests for that I think so if you have a small reproducible case where used versions (used in dependencies!) are removed then I’d be interested in that.

Versions that are used like in the example, not used in any dependency, will always need a keep configuration. You don’t need to keep all versions in recent versions of the plugin, you can specify exactly which one to keep using config or # @keep as a comment above the version you want to keep, see the readme for details on that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Arm Compiler Errors and Warnings Reference Guide Version ...
The Arm Compiler Errors and Warnings Reference Guide provides lists of the errors and warnings that each of the compilation tools can generate....
Read more >
Accessing, Defining & Managing System Preferences ... - Altium
This page provides a landing point to the preferences in Altium Designer. You can set up various preferences across different functional ...
Read more >
US7475093B2 - Memory cache management in XML/relational data ...
With respect to hash tables and hash entry keys, three types of cache stores ... At 302, caches are not allowed to keep...
Read more >
Retain 4.9.2: Configuration and Administration
Retain is not a backup/restore system. About This Guide. This is the administrative documentation for Retain Unified Archiving version 4.9.2.
Read more >
ifs.astroscu.unam.mx/sfsanchez/FIT3D/README_FIT3D.txt
FIT3D # # Version 1.1 # FIT3D comprises routines to fit stellar continuum and gas ... to define 5 entries: (1) The input...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found