-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
The 5.1.0 version download seems not work when we integrated it into our private plugin. #237
Comments
Thanks for the pull request. I'm not sure if that's the solution to your problem though. Can you provide a small sample build script (not a large complex project) that demonstrates the issue? If possible, please also add a unit test to your pull request to make sure you're actually fixing the bug. Thanks. |
I don't have simple build script to reprodcue this problem because we emebbed it into our plugins. Its really hard to reproduce it without our plugin environment. I tested it my pull in my local and it can correctly download file. I am not sure whether I can make a simple script to reproduct this issue. |
@michel-kraemer our plugin defer to configurre src property after gradle evaluated root project. but we add the download task before project evaluation finished. So the cachedSources will be firstly initialized by this "cachedSources = new ArrayList<>(sourceObjects.size());", but its size is 0. I think this is the root cause of this issue. |
issue-237-sample.zip |
Thanks. I'll have a look at it and get back to you. |
Thanks for the analysis and the test project. You were on the right track! I've fixed the issue and released a new version 5.1.1. Please try again. (Please also consider contributing your project to the Who's using gradle-download-task thread. Thanks) |
Describe the bug
When I upgrade our gradle download task from 3.2.0 to 5.1.0, It always throw output result is empty file. I set src for download task, but task alwasys think the task output is uptodate. I debug the source code and confim the sourceObjects has value, I found the line 1108 codes, the cachedSources is not null but its value is empty, so ervery time the download task executed but no actually download action happended.
A clear and concise description of what the bug is. What did you expect to happen and what happened instead?
I think it should not simply check cachedSources is null, it also need to check its size.
Sample build script
we use it in our gradle plugin. here is the code link https://github.com/simonjhy/liferay-portal/blob/master/modules/sdk/gradle-plugins-workspace/src/main/java/com/liferay/gradle/plugins/workspace/configurator/RootProjectConfigurator.java#L1018
If possible, provide a sample build script to reproduce the issue.
The text was updated successfully, but these errors were encountered: