forked from com-lihaoyi/mill
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Jvm methods to match specified signatures
Related to com-lihaoyi#3772 Refactor `Jvm.scala` to consolidate subprocess and classloader spawning operations into four specified signatures. * **Refactor `callSubprocess` method:** - Rename to `call`. - Update parameters to match the specified `call` signature. - Use `jvmCommandArgs` to generate command arguments. - Call `os.call` with the updated parameters. * **Refactor `runSubprocess` method:** - Rename to `spawn`. - Update parameters to match the specified `spawn` signature. - Use `jvmCommandArgs` to generate command arguments. - Call `os.spawn` with the updated parameters. * **Add `spawnClassloader` method:** - Create a new method to match the specified `spawnClassloader` signature. - Use `mill.api.ClassLoader.create` to create a classloader. * **Add `callClassloader` method:** - Create a new method to match the specified `callClassloader` signature. - Use `spawnClassloader` to create a classloader and set it as the context classloader. - Execute the provided function with the new classloader and restore the old classloader afterward. * **Add tests in `JvmTests.scala`:** - Add tests for the new `call` method. - Add tests for the new `spawn` method. - Add tests for the new `callClassloader` method. - Add tests for the new `spawnClassloader` method.
- Loading branch information
1 parent
f23475c
commit 1e3205c
Showing
2 changed files
with
143 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters