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

[TIMOB-24829] Android: Use incremental tasks for Hyperloop build steps #189

Closed
wants to merge 1 commit into from

Conversation

janvennemann
Copy link
Contributor

This is something i hacked together over the last days and should be treated more of a feature proposal than an actual pull request. Since the whole Android build pipeline currently has little to no caching of its different build steps, i tried to implement an incremental task approach to speed up the Android Hyperloop plugin.

The task and change detection stuff is heavily inspired by Gradle because i think they did a pretty neat job there, so i adopted it to the async nature of Node and simplified everything a little bit. Maybe this can even be integrated in the daemon in the feature by using the fs-watcher stuff from there and use the task system for implementing our build pipelines as plugins.

To sum this up:

  • Created a file monitor that is able to work between builds by storing its state in a file. This is the main difference to other available file watchers for node
  • Created a simple task structure which uses the file monitoring to support incremental task runs
  • Took the different build steps and refactored them into single tasks that are run after each other. They all have defined input and output files on which they work on and those are used to check if we can do an incremental task run.
  • Huge improvement on testability: We can easily unit test single tasks. The Android build itself as well as the Hyperloop plugin currently do not have not a single unit.

Obviously this is not complete yet (missing unit tests for the base tasks, move the file monitor and base tasks to their own module), but i would love to hear some thoughts on this. I had to write so many manual caching logic around builds steps in the Android Builder and in Hyperloop lately that i thought this might be a great thing to have. This is also a good example to see how easy it is to integrate into our existing build pipeline.

@hansemannn hansemannn changed the title [TIMOB-24829] Use incremental tasks for Hyperloop build steps [TIMOB-24829] Android: Use incremental tasks for Hyperloop build steps Jun 30, 2017
@hansemannn hansemannn added this to the v2.2.0 milestone Jun 30, 2017
@hansemannn
Copy link
Contributor

@janvennemann Please cherry-pick and open against master, thx!

@janvennemann
Copy link
Contributor Author

Closed in favor of #205

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.

None yet

2 participants