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

DGP: Rename conflicting 'maybeCreate' helper function. #3763

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

adam-enko
Copy link
Member

@adam-enko adam-enko commented Aug 26, 2024

DGPv1 and v2 both have a similar utility function: fun <T> NamedDomainObjectContainer<T>.maybeCreate. However, their behaviour is slightly different.

v1: find the item by name, OR create the item and configure it.
v2: maybe create the item, AND exist the new/existing item.

The only usage of v1's version was in the gradleConfiguration.kt, so this PR moves it and renames it to findOrCreate(), to avoid confusion.

DGPv1 and v2 both have a similar utility function: `fun <T> NamedDomainObjectContainer<T>.maybeCreate`. However, their behaviour is slightly different.

v1: maybe create the item, OR if it exists, configure it.
v2: maybe create the item, AND exist the new/existing item.

The only usage of v1's version was in the `gradleConfiguration.kt`, so this PR moves it and renames it to `findOrCreate()`, to avoid confusion.
@adam-enko adam-enko added the runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin label Aug 26, 2024
@adam-enko adam-enko self-assigned this Aug 26, 2024
@adam-enko adam-enko merged commit b594af4 into master Aug 27, 2024
14 checks passed
@adam-enko adam-enko deleted the adam/feat/OSIP-355/fix-maybecreate branch August 27, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants