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

Use a different syntax in task block #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MichaelKunze
Copy link

Use withType<> syntax to configure all tasks of the relevant type.

Use withType<> syntax to configure all tasks of the relevant type.
@BeneStem
Copy link
Owner

I am not sure if this is a good way of doing it.
In the official gradle spring boot documentation they are using the style I was using...

Do you have some source for confirming that withType<> is actually better?
I myself think its better but all docs I found say otherwise :(

@MichaelKunze
Copy link
Author

withType:

/**
 * Returns a collection containing the objects in this collection of the given type. Equivalent to calling
 * {@code withType(type).all(configureAction)}
 *
 * @param S The type of objects to find.
 * @param configuration The action to execute for each object in the resulting collection.
 * @return The matching objects. Returns an empty collection if there are no such objects
 * in this collection.
 * @see [DomainObjectCollection.withType]
 */

getByName:

/**
 * Returns a collection containing the objects in this collection of the given type. Equivalent to calling
 * {@code withType(type).all(configureAction)}
 *
 * @param S The type of objects to find.
 * @param configuration The action to execute for each object in the resulting collection.
 * @return The matching objects. Returns an empty collection if there are no such objects
 * in this collection.
 * @see [DomainObjectCollection.withType]
 */

withType will simply configure all tasks of the type bootRun. Lets say you create a custom task bootRunLocal which will feed a 'local' spring profile into the task. That will be configured as well.

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.

2 participants