go-task / task

A task runner / simpler Make alternative written in Go
https://taskfile.dev
MIT License
11.42k stars 617 forks source link

Wrapper script like in Gradle #1015

Open krystian-panek-vmltech opened 1 year ago

krystian-panek-vmltech commented 1 year ago

Task has install script which installs Tool OS-wide. However, it would be nice to connect the Task tool version to concrete projects in which it is being used by wrapper script concept like e.g in Gradle - https://docs.gradle.org/current/userguide/gradle_wrapper.html

Right now I implemented my own wrapper script, however, it would be nice to have such a feature prepared in the Task tool project as well.

The value given here is that nobody needs to care about the version of the Task tool used in the project as the tool is downloaded automatically in a version compatible with the project. This is especially cool for Task tool maintainers as they could take less care about backward compatibility, so this feature is a win-win.

pd93 commented 1 year ago

could take less care about backward compatibility

Task already supports a wide variety of official and community-made installation methods and will always need to be backwards-compatible for non major version releases regardless of a script like this existing.

However, I don't see why something like this can't also exist. If somebody is willing to contribute, then I'm sure the installation page could be updated to include it.

Suggestions on how a user might install something like this are welcome. i.e. Do they just copy/paste the script into their project? I'm not particularly familiar with how gradlew works other than running it on other people's projects. Maybe our installation script could have a --wrapper flag added that will insert this script into your project rather than installing task globally?

For anyone else that ends up on this issue, I also recommend looking at tools like Nix which are designed to manage project dependencies with specific versions - though I'm aware that not everyone likes Nix :P

krystian-panek-vmltech commented 1 year ago

Maybe our installation script could have a --wrapper flag

yep sounds cool.

regarding Nix... the problem is that even the Nix installer script is supporting Windows only with WSL2 but I am unable to enforce my tool users to use it.

So I am trying to limit the number of tools to be installed manually as a prerequisite by users to a minimum and such a wrapper script/installer approach just does its job.