Use modern providers.gradleProperty APIs for GitHub Packages Gradle credential examples#45247
Use modern providers.gradleProperty APIs for GitHub Packages Gradle credential examples#45247ShreckYe wants to merge 6 commits into
providers.gradleProperty APIs for GitHub Packages Gradle credential examples#45247Conversation
Prefer Provider.getOrNull() over the .orNull property accessor so examples match the Provider API method name explicitly.
Declare GitHub Packages dependency repositories in settings scripts with dependencyResolutionManagement, and clarify that publishing credentials stay in the build script while consuming uses settings.
…on for both traditional build scripts and Centralizing Repository Declarations, instead of favoring the latter
…more repetitive "file" typo Based on an AI review against GitHub's documentation fundamentals (https://docs.github.com/en/contributing/writing-for-github-docs/about-githubs-documentation-fundamentals) and the linked style guide requirements for links. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Thanks for submitting a PR to the GitHub Docs project! In order to review and merge PRs most efficiently, we require that all PRs grant maintainer edit access before we review them. For information on how to do this, see the documentation. |
How to review these changes 👓Thank you for your contribution. To review these changes, choose one of the following options: A Hubber will need to deploy your changes internally to review. Table of review linksNote: Please update the URL for your staging server or codespace. The table shows the files in the
Key: fpt: Free, Pro, Team; ghec: GitHub Enterprise Cloud; ghes: GitHub Enterprise Server 🤖 This comment is automatically generated. |
providers.gradleProperty APIs for GitHub Packages Gradle credential examples
Why:
Gradle recommends newer APIs such
providers.gradleProperty()for project properties supplied through build-level sources (gradle.properties,-P,ORG_GRADLE_PROJECT_*). For GitHub Packages credentials, this matches how users typically configuregpr.userandgpr.key, while avoiding the broaderfindPropertylookup (extra properties, name collisions with tasks/extensions, etc.).providers.gradlePropertycan also be used in the settings script.What's being changed (if available, include any code snippets, screenshots, or gifs):
project.findProperty(...)toproviders.gradleProperty(...).getOrNull()inworking-with-the-gradle-registry.md.Fix typos of the repeating "file" words in the sentences "build.gradle.kts file (Kotlin DSL) file" BTW.
Fix an indentation issue of a closing bracket in the code BTW.
Check off the following: