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

chore: Generate type-safe accessors for convention plugins #186

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mattcreaser
Copy link
Member

Issue #, if available:

Description of changes:
Update the build-logic project to generate and consume type-safe accessors for the various plugins being applied to the main project.

Previously, because the version catalog information was not available when compiling our convention plugins, the convention plugins needed to use the string IDs when applying plugins to the consuming project. This works fine, but loses one of the advantages of using a version catalog in the first place.

This PR adds a task to the build-logic project such that, when build-logic is built, the libs.versions.toml catalog (which is shared between amplify-ui and build-logic projects) is read and used to generate a class definition enumerating its contents. The plugin code in build-logic can then import that class to get type-safe accessors that refer to the dependency declarations in the version catalog, which can be used in place of their String IDs.

How did you test these changes?
Verified project still built correctly

Documentation update required?

  • No
  • Yes (Please include a PR link for the documentation update)

General Checklist

  • Added Unit Tests
  • Added Integration Tests
  • Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
  • Ensure commit message has the appropriate scope (e.g fix(liveness): message, fix(authenticator): message, fix(all): message)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant