Rustify tasks#274
Conversation
- Implement a new `java-task-helper` binary to handle build tool commands - Add support for Maven and Gradle build tool detection and execution - Integrate `java-task-helper` into the Zed Java extension tasks - Add automated download logic for the task helper binary - Update `justfile` with new recipes for building and installing the helper - Update `Cargo.lock` and `Cargo.toml` with new dependencies
- add test class, run all tests, and clear cache tasks to tasks.json - refactor binary download logic by moving it from proxy.rs to download.rs - update download logic to use allow_download flag and handle status updates - implement remove_all_files_except in the download flow
- update run_test_method to use file argument for module lookup - update run_test_class to use file argument for module lookup - update run_all_tests to use file argument for module lookup - refactor task_clear_cache to execute directly instead of returning TaskCommand - update main entry point to handle clear-cache subcommand
06b2fed to
c192e2a
Compare
- update release-proxy.yml to build and package java-task-helper - update task_verification_test.rs to dynamically locate java-task-helper binary - remove hardcoded paths for task helper in tests
playdohface
left a comment
There was a problem hiding this comment.
I like this, it works on my machine™️ and already gave me ideas on how to make the tasks smarter and gives us a sane programming model for doing so.
Also, all that is missing to make this work ootb in Windows is a platform-independent way of figuring out the extension workdir in the tasks.json context - either via upstream changes in Zed or with some clever polyglot scripts.
Caveat: I can't speak to the changes in the github-workflows, it looks fine but I know too little about github workflows to say with confidence
| fn run_all_tests(&self, file: &str) -> TaskCommand; | ||
| } | ||
|
|
||
| pub fn detect_build_tool(cwd: &Path) -> (Box<dyn BuildTool>, PathBuf) { |
There was a problem hiding this comment.
I think this could be smarter, with similar logic like in find_closest_module - we should determine the correct build-tool and wrapper per file, walking up the tree until we find pom.xml or build.gradle and consider that the "project root". Currently, as was the case with the old shell script, the builtin tasks break if you don't open your project at the java project root which can be quite annoying
| }; | ||
|
|
||
| const TASK_HELPER_BINARY: &str = "java-task-helper"; | ||
| const TASK_HELPER_INSTALL_PATH: &str = "proxy-bin"; |
There was a problem hiding this comment.
nit: probably proxy-bin/ is not a great name for this folder anymore now that it contains more than just the proxy binary. I vote bin/
Hi thanks, Example tasks.json: |
|
@drmaniac yes, if we can truly make this work across platforms and shells that's a major win imo
|
|
Could we maybe inject the PATH to task-helper from Zed somehow? That would simplify the code in |
|
@tartarughina Zed would have to provide this as a TaskVariable. It might be easier to convince the Zed team to just provide the extension-workdir or its parent as a TaskVariable to all tasks instead of doing something along the lines of zed-industries/zed#45932 and that would effectively solve our problem here, so I think it's worth a shot That's what I believe would be required on the Zed side: zed-industries/zed#59564 |
Key Highlights of the PR Description: