-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Improve testcluster distribution artifact handling #38933
Merged
mark-vieira
merged 3 commits into
elastic:master
from
mark-vieira:improved-testclusters-dependency-sync
Feb 15, 2019
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
77 changes: 0 additions & 77 deletions
77
...rc/src/main/java/org/elasticsearch/gradle/testclusters/SyncTestClustersConfiguration.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering why the cast is needed here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CopySpec.from()
simply takesObject...
as an argument. Each item passed can be any of the types listed here. We can't just pass a raw lambda, as Java has now idea what SAM type to cast it to. So we have to explicitly cast it as one of the supported types. We don't have this problem in Groovy as{ }
returns an instance ofClosure
.There's actually no real need to include the generic type arguments here, Gradle will figure this out at runtime, but its more explicit and folks reading the code immediately see what that lambda returns.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additionally, if it's not obvious, we wrap all this in a
Callable
because we are iterating over aConfiguration
here so we can return aFileTree
from each resolved artifact. Doing so causes the Configuration to be resolved (and files to be downloaded) so we want to defer this until task execution. Or in this case more specifically, during task graph calculation.