|
1 | 1 | # Code Updater
|
2 | 2 |
|
3 |
| -The purpose of this project is to update all code versioning and dependencies below a directory. This is useful when you have a large number of projects that you want to update all at once. This application is designed to be run on a local machine, and then the changes are committed to source control. This allows for a more controlled update process, as you can manually check the changes before committing them. |
| 3 | +The purpose of this project is to update all code versioning and dependencies below a directory. This is useful when you have a large number of projects that you want to update all at once. This application is assumed to run on a local machine, and then the changes are manually committed to source control. This allows for a more controlled update process, because a developer is meant to manually check the changes before committing them. |
4 | 4 |
|
5 |
| -## What this Updates |
| 5 | +It would be great to get this to work for all kinds of languages/frameworks someday, but for now it's just .NET and NPM. |
| 6 | + |
| 7 | +## What Updates Are Done |
6 | 8 |
|
7 | 9 | - Updates .NET *.csproj files to use a specified C# Language Version
|
8 |
| -- Updates .NET *.csproj files to use a specified .NET SDK Version (TargetFramework) |
| 10 | +- Updates .NET *.csproj files to use a specified .NET SDK Version (AKA TargetFramework element) |
9 | 11 | - Updates all NuGet packages in all *.csproj files to the latest version
|
10 | 12 | - Updates all NPM packages in all package.json files to the latest version
|
11 | 13 |
|
12 |
| -## How to Use |
| 14 | +## How to Use It |
13 | 15 |
|
14 |
| -Remember, the purpose of this is to update code. It is assumed, and recommended, a developer runs this locally and verifies the changes before comitting to source control. Below are the steps to take. |
| 16 | +Remember, the purpose of this is to update code. It is assumed, and recommended, a developer runs this locally and verifies the changes before comitting to source control. Below are the steps assumed steps a user would follow. |
15 | 17 |
|
16 | 18 | There are 2 ways to run this. As a .NET Tool installed on your machine, or downloading the repository and running the code yourself.
|
17 | 19 |
|
18 |
| -1. Install the application |
19 |
| - - Install the tool globally by running `todo` |
20 |
| - - Clone this repository locally |
| 20 | +1. Install the application. Choose one: |
| 21 | + - Install the tool globally by running `dotnet tool install --global ProgrammerAL.Tools.CodeUpdater --version 1.0.0` |
| 22 | + - Or clone this repository locally |
21 | 23 | 2. Run the application
|
22 | 24 | - If you installed the tool, run it with the command: `code-updater --config-file "C:/my-repos/my-app-1"`
|
23 | 25 | - If you downloaded the code, open a terminal to the `~/src/CodeUpdater/CodeUpdater` directory and run the application using dotnet run while passing in the required arguments. Example: `dotnet run -- --config-file "C:/my-repos/my-app-1"`
|
24 | 26 | 3. Wait for the application to finish. It will output the number of projects updated, and the number of projects that failed to update.
|
25 |
| -4. Manually check a diff of all the projects to ensure everything is as you expect |
| 27 | +4. Manually check a diff of all the file changes to ensure everything is as you expect |
26 | 28 | 5. Commit the code changes to source control. Wait for a CI/CD pipeline to run and ensure everything is still working as expected.
|
27 | 29 |
|
28 | 30 | ## CLI Options
|
@@ -85,6 +87,21 @@ Ignore packages inside node_modules folder:
|
85 | 87 | - /node_modules/
|
86 | 88 | - \node_modules\
|
87 | 89 |
|
| 90 | +## Installing Locally vs Downloading the Code |
| 91 | + |
| 92 | +The tool is very opinionated. It updates all packages to the latest version, and sets some project level properties. If the tool does some things you can't use for your projects, you can download the code, make changes, and keep thay for yourself. Maybe in the future we can hide certain settings behind a flag. Feel free to file an issue and and we can discuss it. |
| 93 | + |
| 94 | +## Required 3rd Party Software |
| 95 | + |
| 96 | +In order to run the tool you need the following software installed on your local machine. |
| 97 | + |
| 98 | +- .NET CLI |
| 99 | + - So you can install .NET Tool from nuget.org |
| 100 | +- PowerShell |
| 101 | + - Quick Reminder: PowerShell is cross platform, you can run it on Linux and MacOS, not just Windows |
| 102 | + |
| 103 | +PowerShell is required as a workaround. The NPM executable on Windows doesn't run like other applications. It doesn't exit like a normal process. I don't know why, I never spent the time figuring it out. The workaround makes PowerShell the host application so it exits like you would expect, when the process is done. For this reason, whenever an external process must be run, it's run through PowerShell. Kind of a hack, but it works well enough. |
| 104 | + |
88 | 105 | ## .NET Standard Projects
|
89 | 106 |
|
90 | 107 | When updating *.csproj files to a specific `TargetFramework` version, the project is skipped if using .NET Standard. Those are usually set for a specific level of API compatibility so we don't want to mess with those.
|
|
0 commit comments