Граф коммитов

79 Коммитов

Автор SHA1 Сообщение Дата
Ken Schlobohm d4a42e2cab
Language indifferent BinaryFormatter analyzer (#544) 2021-06-03 16:33:45 -05:00
Taylor Southwick 93aca6e65f
Include web typemap in analyzers test (#597) 2021-06-03 12:45:08 -07:00
Taylor Southwick a3016a8537
Separate out web related items into its own extension (#582)
This removes most of the web-specific info to a separate extension so that it can have web-related things co-located with it. The analyzers/codefixers are not self-contained, but that may require a bit more thinking as we distribute them. This is a first step towards organizing extensions by technology areas.

The resulting output looks like this:

```
upgrade-assistant
|- Microsoft.DotNet.UpgradeAssistant.Cli.dll
|- ....
|- extensions
  |- default
    |- [files]
  |- web
    |- [files]
```
2021-06-03 10:21:59 -07:00
Mike Rousos e154e9f519
Update extension samples (#583)
We've had some churn recently in our extension framework. This updates the samples to build and work with the new model and adds them to the solution so that they'll continue to be built by CI in the future.
2021-06-02 17:53:03 -04:00
Johan Benschop e0c17a43f5
Migrate connection strings to appsettings.json (#571)
Added IUpdater<ConfigFile> implementation to connection strings
2021-06-02 14:21:41 -07:00
Taylor Southwick 5acaa8ab44
Add tests for extension options (#581) 2021-06-02 13:26:34 -07:00
Taylor Southwick 796148c9e4
Remove central version management (#573)
This seems to be causing problems with the way we're building our
extensions. Somehow it's detecting that we have a version when no
PackageReferences do. Since this is a preview feature, it appears we may
have hit a bug with that. For now, swapping back to non-centrally
managed versions allows for a more seamless inner dev-loop.
2021-06-02 10:17:58 -07:00
Mike Rousos 55f8e7cf4d
Add a Razor document updater to enabled upgrading @helper functions to local methods (#559)
Fixes #76
2021-06-01 22:50:40 -04:00
Taylor Southwick 6a77f069d4
Use assembly load context for extensions (#558)
If an extension contains multiple assemblies, they will now resolve from within the extension thanks to a private load context. We want to ensure that we don't load a different version of anything the default context loads, so this checks for that as well.
2021-05-29 10:27:42 -07:00
Mike Rousos 550aa94351
Consolidate type upgrade analyzers into a single configurable analyzer (#540)
This consolidates all the analyzers derived from `IdentifierUpgradeAnalyzer` and replaces them with a single analyzer/code fix provider for identifying and updating all cases where a type name needs replaced with a more modern equivalent.

It also updates this new `TypeUpgradeAnalyzer` to read the types to be replaced dynamically from additional texts so that users can easily extend the mapping of types to be replaced (by including a .typemap file in their project, including a .typemap additional file in their extension, or by registering an `AdditionalText` file with in UA's DI container).
2021-05-28 11:09:41 -04:00
Taylor Southwick 1e65fa46b5
Add a codefixer to refactor HttpContext.Current (#536)
This adds an additional codefixe for HttpContext.Current that helps to
refactor its usage to instead use method injection. The codefixe will
update calling methods to pass in HttpContext.Current, which can be
called multiple times to move HttpContext.Current up the stack.
2021-05-24 16:30:10 -07:00
Mike Rousos edbeb01ab2
Refactor IdentifierUpgradeAnalyzer and IdentifierUpgradeCodeFixer (#534)
This updates IdentifierUpgradeAnalyzer and IdentifierUpgradeCodeFixer to work with both C# and VB and consolidates ApiController analyzers and code fixers to use those base classes.

It also expands UA0013 analyzers and code fixers to handle both WebApi and MVC controllers.

We talked about combining all the IdentifierUpgrade analyzers and code fixers into one. I'll make that change in a follow-up PR to keep things manageable.

Fixes #514
2021-05-20 12:47:04 -04:00
Taylor Southwick 981dd02c4f
Ensure analyzer packaging works for CS/VB (#535)
This change removes CSharp from the name of the package as well as ensures the analzyer/codefixers are added for vb projects when added as NuGet packages.
2021-05-19 15:51:15 -07:00
Taylor Southwick acd941fd5a
Require windows TFM if MyType requires that (#529) 2021-05-18 09:11:53 -07:00
Ken Schlobohm 05c627f902
api analyzer roslyn (#515) 2021-05-17 15:19:45 -05:00
Taylor Southwick a9d1857d4d
Ensure restores are run when needed (#525)
This change moves the nuget reference retrieval back to non-async as the only async pathway we need is to ensure the restore is done. That has been moved now behind the the actual properties/methods that require that, which have in turn been turned into async.
2021-05-17 10:26:00 -07:00
David Pine 66a1a2f024
Remove the .upgrade-assistant JSON file when complete, and only create it when needed. (#522)
This should be implicit and based on whether or not it's completed. When completed, delete it - it's only useful between project runs in the context of a solution.
2021-05-17 10:23:45 -07:00
Taylor Southwick ce4801788a
Abstract away extension handling (#517)
This removes the need for extensions to be too aware of the fact that they are themselves extensions. This incorporates a builder pattern to register configuration that can be added to by other extensions and provides simpler access patterns.
2021-05-13 08:52:00 -07:00
Taylor Southwick dcd6e14abe
Move namespace for dependency analyzers (#520) 2021-05-12 16:16:45 -07:00
Taylor Southwick 4598a23e60
Expose PackageReferencesAnalyzer as IDependencyAnalyzer (#518)
This change refactors the package analyzer infrastructure to generalize it to any dependency. As part of this, the state and analyzer types are being moved to the abstractions layer so extensions may add implementations if they want.
2021-05-12 10:03:16 -07:00
Mike Rousos cf64a5bd79
Add RazorSourceUpdater tests (#491)
Fixes #456
2021-05-05 16:09:05 -04:00
Taylor Southwick 10fd0c8d40
Enable LTS/Current/Preview selection (#469)
This change does a couple of things to enable LTS/Current/Preview selection:

- Adds a command line argument to allow selection
- Maps the selected support model to identify the TFM that is needed
- Updates the PackageLoader to limit searches to results that match the TFMs in a project
2021-05-04 13:40:41 -07:00
Ken Schlobohm 16f222c550
Update try-convert (#474) 2021-04-30 17:09:08 -05:00
Mike Rousos aa9fd4e57c
Fix backup step to back up different projects to different sub-dirs (#466)
Fixes #462
2021-04-27 17:40:12 -04:00
Mike Rousos 832a8937a9
Add a RazorUpdater that applies code fixes to Razor docs (#455)
Fixes #367
2021-04-23 17:27:12 -04:00
oteinone 4b7ce32575
Backup path is now persisted in upgrade file (#447)
Path in upgrade file is checked for existing backups

Co-authored-by: Otto Teinonen <otto.teinonen@medixine.com>
2021-04-23 13:10:57 -07:00
Taylor Southwick 33b1767425
Expand TargetFrameworkMoniker record to include parts (#449)
This change replaces a simple record with `Name` to be one that includes
the parts that matter: FrameworkName, Version, Platform, PlatformVersion

This will then be formatted as needed in the property `Name`.
2021-04-22 20:59:27 -07:00
Ken Schlobohm 37febcd712
Mock nuget for integration tests (#421) 2021-04-21 09:36:12 -05:00
Taylor Southwick 2b67588eb2
Replace ITargetTFMSelector with a filter-based pattern (#438)
This change doesn't change too much for callers, but changes how a TFM is selected. Previously, one class held all the knowledge about how to select a TFM for a project. This swaps that out for a filter chain that can attempt to change the final result. Each of the filters can do whatever checks they may want, but the state that is passed through will only update the TFM if it is a higher or more constrained TFM.
2021-04-20 15:14:15 -07:00
Mike Rousos d5bdb602ad
Razor upgrade step (part 1) (#422)
* Rework `IConfigUpdater` to be a more general `IUpdater<T>`
* Add RazorUpdaterStep and RazorUpdateSubStep
* Add RazorUpdaterStep unit tests
2021-04-14 17:51:43 -04:00
Taylor Southwick 7c4a748e9f
Add globbing for entrypoint so arbitrary entrypoints can be combined (#425) 2021-04-14 12:59:49 -07:00
Ken Schlobohm ec2ed0329f
Filter features by language (#417) 2021-04-08 21:19:50 -05:00
Taylor Southwick e39e124701
Add async suffix to a couple of methods (#415) 2021-04-06 12:26:11 -07:00
Taylor Southwick e37682dd51
Restore packages if not already restored when nuget packages are retrieved (#412) 2021-04-06 07:21:50 -07:00
Ken Schlobohm eb5f7c251b
Implemented IsApplicable for PackageReferenceAnalyzers (#390) 2021-04-05 18:19:19 -05:00
Ken Schlobohm 2ebd22d7cf
using newest version of try convert (#403) 2021-04-02 10:57:44 -05:00
Taylor Southwick 30f43d296b
Remove NuGet references from packages library (#395) 2021-04-01 09:32:27 -07:00
Taylor Southwick 121e38909e
Add abstraction for INuGetReferences (#392) 2021-03-31 10:41:59 -07:00
Taylor Southwick c217b25e63
Allow multiple tfms in a project (#383) 2021-03-29 19:14:21 -07:00
Taylor Southwick bdcb0e505a
Consolidate IProject.FilePath and .Directory (#370)
We don't need separate properties for these. This change replaces these two properties with a single `IProject.FileInfo` property.
2021-03-25 12:25:58 -07:00
Ken Schlobohm 9bb5d054c9
using float range and tryParse (#371)
using float range and tryParse
2021-03-23 16:28:08 -05:00
Ken Schlobohm e5955ba8f7
Replace BinaryFormatter.UnsafeDeserialization (#339)
Adds analyzer and code fixer for BinaryFormatter UnsafeDeserialization
2021-03-17 17:53:46 -05:00
Mike Rousos cab79979f6
Update web references in libraries (#354)
This updates Upgrade Assistant to use the latest version of try-convert (which won't remove classic ASP.NET dependencies from libraries that keep a NetFx TFM) and adds additional package update analyzers to replace ASP.NET dependencies with ASP.NET Core ones after the TFM has been updated.

Fixes #347
2021-03-16 17:34:20 -04:00
Taylor Southwick 427088f081
Set an error code if the app terminates unexpectedly (#348) 2021-03-12 07:13:54 -08:00
Sunanda Balasubramanian 73817d22d7
Add a step to update package dependecies before TFM change (#342)
* Add a step to update package dependecies before TFM change

* Fix Tests

* PR Feedback

* Address SA1402

* Fix Tests Again

* Use StepId and fix tests

* Fix PCL tests

* Fix casing for NuGet
2021-03-11 17:14:22 -08:00
Mike Rousos 72c5ce0f7b
Fix broken MSBuild tests (#345) 2021-03-11 16:11:49 -05:00
Taylor Southwick 1e4f4d0a18
Add IComponentIdentifier and ProjectComponents.AspNetCore (#340) 2021-03-11 12:19:04 -08:00
Mike Rousos caef78e1ff
Add a command to select a different current project (#343)
Fixes #338
2021-03-11 14:47:37 -05:00
Mike Rousos ba5273dea2
Add ConfigUpdaterStep unit tests (#332) 2021-03-11 11:34:21 -05:00
Taylor Southwick 3e2918867c
Update try-convert target to honor version (#341)
This change honors the version of try-convert for the dev loop as well
as only downloading it once for whichever projects may need it.
2021-03-11 08:11:04 -08:00