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 Worker API #138

Closed
dulmandakh opened this issue May 15, 2019 · 12 comments
Closed

use Worker API #138

dulmandakh opened this issue May 15, 2019 · 12 comments
Assignees

Comments

@dulmandakh
Copy link
Contributor

Worker API introduced in Gradle 5.4.1 allows to execute work concurrently and asynchronously, and I think it might be useful to download files concurrently. It might be best to add support for it release 4.x version, since most users still use 3.x and it won't be a breaking change.

https://guides.gradle.org/using-the-worker-api/

Thank you

@michel-kraemer
Copy link
Owner

michel-kraemer commented Jun 23, 2019

This is a good idea but I cannot implement it yet as we still need to support Gradle versions older than 4.10.3 (that should be the minimum version for the worker API). I'll pin this issue for the time being and get back to this at a later point in time.

@ZacSweers
Copy link

ZacSweers commented Jun 20, 2020

@michel-kraemer out of curiosity, why support such an old version?

michel-kraemer added a commit that referenced this issue Jul 4, 2020
@michel-kraemer
Copy link
Owner

@ZacSweers You're right. I just deprecated Gradle 2.x up to 4.x as well as Java 7. This will allow me to do some cleanup in gradle-download-task 5.0.0. 👍

@dulmandakh
Copy link
Contributor Author

dulmandakh commented May 26, 2021

@michel-kraemer how about dropping 5.x too, then support only 6.x and 7.x.

FYI, latest 5.x or 5.6.4 was releases on Nov 01, 2019, also we need 5.4.1 to support Worker API.

@cortinico
Copy link

Hey @michel-kraemer are there some updates on this front?
Is this task up for grab or are you planning to work on it?

@michel-kraemer
Copy link
Owner

@cortinico Sorry, there are no updates on this at the moment. Do you have any specific need for this feature?

@cortinico
Copy link

Do you have any specific need for this feature?

Yup we use gradle-download-task inside react-native for a series of native libraries that needs to be downloaded during the build. The download step is on the critical path, and we do have to download six libraries. Having them run in parallel would be a great improvement.

I'm wondering what was the plan here. If you're planning on working on Worker API support, you're welcoming external contributions or should we create our own wrapper

@michel-kraemer
Copy link
Owner

OK. Sounds good. I will reprioritise my efforts then!

I'm wondering what was the plan here.

The long-term plan was to deprecate support for Gradle versions 2.x-4.x and then eventually implement support for the worker API (besides other improvements, which would then become possible) after a reasonable period of time. I just checked the commit log and this thread here and noticed that 2.x-4.x have been deprecated in July 2020 already! 😳 So, I think it's really time to move on now.

I will start refactoring as soon as possible. You can expect the first commits in the next few days. I'll keep you informed about the progress.

@michel-kraemer michel-kraemer self-assigned this Jan 9, 2022
michel-kraemer added a commit that referenced this issue Jan 15, 2022
michel-kraemer added a commit that referenced this issue Jan 16, 2022
michel-kraemer added a commit that referenced this issue Jan 16, 2022
@michel-kraemer
Copy link
Owner

@cortinico I've just published a snapshot of the upcoming gradle-download-task 5.0.0 with support for the worker API and parallel downloads.

If you want, you can try it out as follows:

buildscript {
    repositories {
        maven {
            url 'https://oss.sonatype.org/content/groups/public'
        }
    }
    dependencies {
        classpath 'de.undercouch:gradle-download-task:5.0.0-SNAPSHOT'
    }
}

apply plugin: 'de.undercouch.download'

The actual usage of the plugin has not changed. Your build script should automatically download files in parallel with this version.

The plugin requires Gradle 5.x and Java 8 now.

I'll make some more adjustments and improvements and release 5.0.0 in the next few weeks. I'll keep this issue open until then for feedback and further discussion.

@dulmandakh
Copy link
Contributor Author

Thanks @michel-kraemer. React Native uses Gradle 7.x and JDK 11, so it would be ok.

@michel-kraemer
Copy link
Owner

Version 5.0.0 has just been released. I'm closing this issue now. Please let me know if you have any more ideas or feedback!

@cortinico
Copy link

Version 5.0.0 has just been released. I'm closing this issue now. Please let me know if you have any more ideas or feedback!

Thank you very much for doing it 🙏

facebook-github-bot pushed a commit to facebook/react-native that referenced this issue Feb 2, 2022
Summary:
This enables concurrent task exection and parallel downloads

See also michel-kraemer/gradle-download-task#138

## Changelog

[General] [Changed] - Update gradle-download-task to 5.0.1 to support concurrent downloads

Pull Request resolved: #32995

Test Plan: Build runs successfully.

Reviewed By: ShikaSD

Differential Revision: D33892817

Pulled By: cortinico

fbshipit-source-id: 515443573e17a5c2b16a1cf3cea4bf3c5c2d96a7
shwanton pushed a commit to shwanton/react-native-macos that referenced this issue Feb 13, 2023
Summary:
This enables concurrent task exection and parallel downloads

See also michel-kraemer/gradle-download-task#138

## Changelog

[General] [Changed] - Update gradle-download-task to 5.0.1 to support concurrent downloads

Pull Request resolved: facebook#32995

Test Plan: Build runs successfully.

Reviewed By: ShikaSD

Differential Revision: D33892817

Pulled By: cortinico

fbshipit-source-id: 515443573e17a5c2b16a1cf3cea4bf3c5c2d96a7
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

No branches or pull requests

4 participants