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

Management of locally installed dotnet tools #44

Closed
AgentEnder opened this issue May 18, 2021 · 6 comments · Fixed by #46
Closed

Management of locally installed dotnet tools #44

AgentEnder opened this issue May 18, 2021 · 6 comments · Fixed by #46
Assignees
Labels
enhancement New feature or request outdated

Comments

@AgentEnder
Copy link
Member

I definitely agree about installing tools being the path for getting this executor up and running.

I see something like this:

  1. Init schematic is updated to create the tool-manifest, with some messaging about "Tool Manifest created for managing dotnet tools"
  2. Tools are installed if needed at the time a schematic that would use them is used the first time.
    • In practice, this means that we can have this format tool, or the swagger cli tool later, or other tools be known by the package, but only installed if users care about them.
    • A process flow with this would look something like: User runs nx format my-api -> Executor checks for tool in manifest, installs if missing -> Executor checks that tool has been restored, reports error message otherwise -> Executor runs tool
  3. Add a restore schematic (simple schematic, runs dotnet restore and dotnet tool restore)
  4. Update init schematic to add nx g @nx-dotnet/core:restore to npm prepare scripts. Something like:
        const package = readJson(host, 'package.json')
        const prepareSteps = package.scripts.prepare?.split?.('&&')?.map?.(x => x.trim()) ?? [];
        if (!prepareSteps.includes('nx g @nx-dotnet/core:restore')) {
            prepareSteps.push('nx g @nx-dotnet/core:restore')
        }
        package.scripts.prepare = prepareSteps.join(' && ')
        writeJson(host, 'package.json', package)

I'll create new issues for the tool management when I am home this evening.

After we get tool-mgmt in, this executor should be pretty quick to test.

Originally posted by @AgentEnder in #13 (comment)

@bcallaghan-et
Copy link
Collaborator

@AgentEnder I can start working on this today. The steps you've laid out are enough to get me started.

@AgentEnder AgentEnder added the enhancement New feature or request label May 18, 2021
@AgentEnder
Copy link
Member Author

@bcallaghan-et Make sure to extract the steps for checking if tool is in manifest + checking if tools have been restored to utilities so they are easy to use from other generators.

@bcallaghan-et
Copy link
Collaborator

When a tool is installed locally, the binaries are cached in a global location, and the version number is noted in the local manifest file. If the same tool is re-installed, the cached binaries are used. Would it be acceptable to "install" the tool every time, rather than checking if it has been installed?

@AgentEnder
Copy link
Member Author

As long as the cached binary is used instead of deleting and reinstalling I am good with that.

bcallaghan-et referenced this issue in Etogy/nx-dotnet May 18, 2021
Create the manifest file so future generators can install local tools

Fixes #44
bcallaghan-et referenced this issue in Etogy/nx-dotnet May 18, 2021
Add a method that future builders can use to install additional tools

Fixes #44
bcallaghan-et referenced this issue in Etogy/nx-dotnet May 18, 2021
Add restore to prepare script so new installs fully set up the workspace

Fixes #44
github-actions bot pushed a commit that referenced this issue May 19, 2021
# [0.6.0](v0.5.2...v0.6.0) (2021-05-19)

### Bug Fixes

* **core:** add unused options parameter ([c434d32](c434d32))
* **core:** pass client through to init schematic ([5908947](5908947))

### Features

* **core:** add a generator for dotnet restore ([96082a1](96082a1))
* **core:** add restore to prepare script during init ([c2b1c23](c2b1c23)), closes [#44](#44)
* **core:** create tool manifest during init ([996aaee](996aaee)), closes [#44](#44)
* **dotnet:** add a method to install local tools ([6ab5d4a](6ab5d4a)), closes [#44](#44)
@github-actions
Copy link
Contributor

🎉 This issue has been resolved in version 0.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request outdated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants