Permalink
Browse files

Split Project2015To2017 into Core and Migrate2017

* Move almost everything to a new Core project
* Move VS15-related transformations to Migrate2017.Library
* Make ProjectConverter.Convert an extension method
* Retain umbrella-project Project2015To2017 to preserve NuGet package
* Move all common properties to Directory.Build.props
* Give Project2015To2017Tests a proper name with dot
* Update external NuGet dependencies
  • Loading branch information...
andrew-boyarshin committed Sep 15, 2018
1 parent 7658e24 commit af07864abe152174d6d676bbc3713e62cd2c95da
Showing with 318 additions and 360 deletions.
  1. +17 −0 Directory.Build.props
  2. +2 −79 Project2015To2017.Console/Program.cs
  3. +1 −12 Project2015To2017.Console/Project2015To2017.Console.csproj
  4. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/AnalysisExtensions.cs
  5. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/AnalysisOptions.cs
  6. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/Analyzer.cs
  7. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/DiagnosticBase.cs
  8. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/DiagnosticLocation.cs
  9. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/DiagnosticResult.cs
  10. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/DiagnosticSet.cs
  11. 0 ...ject2015To2017 → Project2015To2017.Core}/Analysis/Diagnostics/W001IllegalProjectTypeDiagnostic.cs
  12. 0 ...2015To2017 → Project2015To2017.Core}/Analysis/Diagnostics/W010ConfigurationsMismatchDiagnostic.cs
  13. 0 ...2015To2017 → Project2015To2017.Core}/Analysis/Diagnostics/W011UnsupportedConditionalDiagnostic.cs
  14. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/Diagnostics/W020MicrosoftCSharpDiagnostic.cs
  15. 0 ...ect2015To2017 → Project2015To2017.Core}/Analysis/Diagnostics/W021SystemNuGetPackagesDiagnostic.cs
  16. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/Diagnostics/W030LegacyDebugTypesDiagnostic.cs
  17. 0 ...17 → Project2015To2017.Core}/Analysis/Diagnostics/W031MSBuildSdkVersionSpecificationDiagnostic.cs
  18. 0 ...ject2015To2017 → Project2015To2017.Core}/Analysis/Diagnostics/W032OldLanguageVersionDiagnostic.cs
  19. 0 ...17 → Project2015To2017.Core}/Analysis/Diagnostics/W033ObsoletePortableClassLibrariesDiagnostic.cs
  20. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/Diagnostics/W034ReferenceAliasesDiagnostic.cs
  21. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/IDiagnostic.cs
  22. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/IDiagnosticLocation.cs
  23. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/IDiagnosticResult.cs
  24. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/IReporter.cs
  25. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/IReporterOptions.cs
  26. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/IllegalDiagnosticStateException.cs
  27. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/LoggerReporter.cs
  28. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/LoggerReporterOptions.cs
  29. 0 {Project2015To2017 → Project2015To2017.Core}/Analysis/ReporterBase.cs
  30. 0 {Project2015To2017 → Project2015To2017.Core}/Caching/DefaultProjectCache.cs
  31. 0 {Project2015To2017 → Project2015To2017.Core}/Caching/IProjectCache.cs
  32. 0 {Project2015To2017 → Project2015To2017.Core}/Caching/NoProjectCache.cs
  33. 0 {Project2015To2017 → Project2015To2017.Core}/ChainTransformationSet.cs
  34. 0 {Project2015To2017 → Project2015To2017.Core}/ConversionOptions.cs
  35. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/ApplicationType.cs
  36. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/AssemblyAttributes.cs
  37. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/AssemblyReference.cs
  38. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/IReference.cs
  39. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/PackageConfiguration.cs
  40. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/PackageReference.cs
  41. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/Project.cs
  42. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/ProjectExtensions.cs
  43. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/ProjectReference.cs
  44. 0 {Project2015To2017 → Project2015To2017.Core}/Definition/Solution.cs
  45. 0 {Project2015To2017 → Project2015To2017.Core}/Extensions.cs
  46. 0 {Project2015To2017 → Project2015To2017.Core}/ITransformationSet.cs
  47. 0 {Project2015To2017 → Project2015To2017.Core}/NoopLogger.cs
  48. 0 {Project2015To2017 → Project2015To2017.Core}/NoopTransformationSet.cs
  49. +23 −0 Project2015To2017.Core/Project2015To2017.Core.csproj
  50. +2 −77 {Project2015To2017 → Project2015To2017.Core}/ProjectConverter.cs
  51. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/AssemblyInfoReader.cs
  52. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/ConditionEvaluationStateImpl.cs
  53. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/ConditionEvaluator.LegacyCache.cs
  54. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/ConditionEvaluator.ModernCache.cs
  55. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/ConditionEvaluator.cs
  56. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/AndExpressionNode.cs
  57. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/CharacterUtilities.cs
  58. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/ConversionUtilities.cs
  59. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/EqualExpressionNode.cs
  60. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/ErrorUtilities.cs
  61. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/FunctionCallExpressionNode.cs
  62. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/GenericExpressionNode.cs
  63. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/GreaterThanExpressionNode.cs
  64. 0 ...ject2015To2017 → Project2015To2017.Core}/Reading/Conditionals/GreaterThanOrEqualExpressionNode.cs
  65. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/IConditionEvaluationState.cs
  66. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/InternalErrorException.cs
  67. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/LessThanExpressionNode.cs
  68. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/LessThanOrEqualExpressionNode.cs
  69. 0 ...ject2015To2017 → Project2015To2017.Core}/Reading/Conditionals/MultipleComparisonExpressionNode.cs
  70. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/NotEqualExpressionNode.cs
  71. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/NotExpressionNode.cs
  72. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/NumericComparisonExpressionNode.cs
  73. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/NumericExpressionNode.cs
  74. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/OperandExpressionNode.cs
  75. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/OperatorExpressionNode.cs
  76. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/OrExpressionNode.cs
  77. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/Parser.cs
  78. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/Scanner.cs
  79. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/StringExpressionNode.cs
  80. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/Conditionals/Token.cs
  81. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/NuSpecReader.cs
  82. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/ProjectPropertiesReader.cs
  83. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/ProjectReader.cs
  84. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/SolutionReader.cs
  85. 0 {Project2015To2017 → Project2015To2017.Core}/Reading/upstream.md
  86. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/AssemblyAttributeTransformation.cs
  87. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/BasicReadTransformationSet.cs
  88. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/EmptyGroupRemoveTransformation.cs
  89. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/ILegacyOnlyProjectTransformation.cs
  90. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/IModernOnlyProjectTransformation.cs
  91. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/ITransformation.cs
  92. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/ITransformationWithDependencies.cs
  93. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/ITransformationWithTargetMoment.cs
  94. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/NuGetPackageTransformation.cs
  95. 0 ...ct2015To2017 → Project2015To2017.Core}/Transforms/PrimaryProjectPropertiesUpdateTransformation.cs
  96. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/PropertyDeduplicationTransformation.cs
  97. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/PropertySimplificationTransformation.cs
  98. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/TargetFrameworkReplaceTransformation.cs
  99. 0 {Project2015To2017 → Project2015To2017.Core}/Transforms/TargetTransformationExecutionMoment.cs
  100. 0 {Project2015To2017 → Project2015To2017.Core}/UnsupportedProjectTypes.cs
  101. 0 {Project2015To2017 → Project2015To2017.Core}/Writing/ProjectWriter.cs
  102. +12 −0 Project2015To2017.Migrate2017.Library/Project2015To2017.Migrate2017.Library.csproj
  103. +2 −1 ...To2017 → Project2015To2017.Migrate2017.Library}/Transforms/AssemblyFilterDefaultTransformation.cs
  104. +2 −1 ...2015To2017.Migrate2017.Library}/Transforms/AssemblyFilterHintedPackageReferencesTransformation.cs
  105. +2 −1 ...roject2015To2017.Migrate2017.Library}/Transforms/AssemblyFilterPackageReferencesTransformation.cs
  106. +2 −2 {Project2015To2017 → Project2015To2017.Migrate2017.Library}/Transforms/FileTransformation.cs
  107. +2 −1 ...2015To2017.Migrate2017.Library}/Transforms/ImportsTargetsFilterPackageReferencesTransformation.cs
  108. +2 −1 ... → Project2015To2017.Migrate2017.Library}/Transforms/TestProjectPackageReferenceTransformation.cs
  109. +4 −3 {Project2015To2017 → Project2015To2017.Migrate2017.Library}/Transforms/XamlPagesTransformation.cs
  110. +3 −1 {Project2015To2017/Transforms → Project2015To2017.Migrate2017.Library}/Vs15TransformationSet.cs
  111. +3 −12 Project2015To2017.Migrate2017.Tool/Project2015To2017.Migrate2017.Tool.csproj
  112. +0 −1 {Project2015To2017Tests → Project2015To2017.Tests}/AssemblyAttributeTransformationTest.cs
  113. +1 −1 {Project2015To2017Tests → Project2015To2017.Tests}/AssemblyFilterDefaultTransformationTest.cs
  114. +1 −1 ...To2017Tests → Project2015To2017.Tests}/AssemblyFilterHintedPackageReferencesTransformationTest.cs
  115. +1 −1 ...ct2015To2017Tests → Project2015To2017.Tests}/AssemblyFilterPackageReferencesTransformationTest.cs
  116. 0 {Project2015To2017Tests → Project2015To2017.Tests}/AssemblyInfoReadTest.cs
  117. 0 {Project2015To2017Tests → Project2015To2017.Tests}/DummyLogger.cs
  118. +1 −2 {Project2015To2017Tests → Project2015To2017.Tests}/FileTransformationTest.cs
  119. +1 −1 ...To2017Tests → Project2015To2017.Tests}/ImportsTargetsFilterPackageReferencesTransformationTest.cs
  120. +0 −2 {Project2015To2017Tests → Project2015To2017.Tests}/NuGetPackageTransformationTest.cs
  121. +0 −1 {Project2015To2017Tests → Project2015To2017.Tests}/NuSpecReaderTest.cs
  122. 0 {Project2015To2017Tests → Project2015To2017.Tests}/OtherPackagesConfig/net46console.testcsproj
  123. 0 {Project2015To2017Tests → Project2015To2017.Tests}/OtherPackagesConfig/packages.config
  124. 0 ...ect2015To2017Tests → Project2015To2017.Tests}/PrimaryProjectPropertiesUpdateTransformationTest.cs
  125. 0 {Project2015To2017Tests → Project2015To2017.Tests}/ProgramTest.cs
  126. +111 −112 ...o2017Tests/Project2015To2017Tests.csproj → Project2015To2017.Tests/Project2015To2017.Tests.csproj
  127. 0 ...2017Tests.csproj.DotSettings → Project2015To2017.Tests/Project2015To2017.Tests.csproj.DotSettings
  128. 0 {Project2015To2017Tests → Project2015To2017.Tests}/ProjectPropertiesReadTest.cs
  129. 0 {Project2015To2017Tests → Project2015To2017.Tests}/ProjectReferenceReadTest.cs
  130. 0 {Project2015To2017Tests → Project2015To2017.Tests}/ProjectWriterTest.cs
  131. +0 −2 {Project2015To2017Tests → Project2015To2017.Tests}/PropertySimplificationTransformationTest.cs
  132. 0 {Project2015To2017Tests → Project2015To2017.Tests}/SolutionReaderTests.cs
  133. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TargetFrameworkReplaceTransformationTest.cs
  134. 0 ...17Tests → Project2015To2017.Tests}/TestFiles/AltNugetConfig/ProjectFolder/net46console.testcsproj
  135. 0 ...2015To2017Tests → Project2015To2017.Tests}/TestFiles/AltNugetConfig/ProjectFolder/packages.config
  136. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/AltNugetConfig/nuget.config
  137. 0 ... Project2015To2017.Tests}/TestFiles/AssemblyInfoHandling/ClassDataLeft/Properties/AssemblyInfo.cs
  138. 0 ...7Tests → Project2015To2017.Tests}/TestFiles/AssemblyInfoHandling/Empty/Properties/AssemblyInfo.cs
  139. 0 ...ts → Project2015To2017.Tests}/TestFiles/AssemblyInfoHandling/Redundant/Properties/AssemblyInfo.cs
  140. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/AssemblyInfo.txt
  141. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/EmptyFolder/a.txt
  142. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/NonEmptyFolder/a.txt
  143. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/NonEmptyFolder2/a.txt
  144. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/Test1.csproj
  145. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/Test2.csproj
  146. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/Test3.csproj
  147. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/Test4.csproj
  148. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Deletions/a.txt
  149. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/AnotherFile.cs
  150. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Class1.cs
  151. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Folder/FileInFolder.cs
  152. 0 ...15To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Folder/FileIncludedByWildcard.cs
  153. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/IncludedFile.cs
  154. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Program.cs
  155. 0 ...ject2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Properties/AssemblyInfo.cs
  156. 0 ...15To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Properties/Resources.Designer.cs
  157. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Properties/Resources.resx
  158. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Resources.Designer.cs
  159. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/Resources.resx
  160. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/SourceFileAsResource.cs
  161. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/SourceFileSubTypeCode.cs
  162. 0 ...To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/SourceFileWithDesigner.Designer.cs
  163. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/SourceFileWithDesigner.cs
  164. 0 ...15To2017.Tests}/TestFiles/FileInclusion/WildcardFolder/WildcardSubFolder/SubFolderWildcardFile.cs
  165. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/app.config
  166. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/fileExclusion.testcsproj
  167. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/fileinclusion.testcsproj
  168. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/FileInclusion/packages.config
  169. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/OtherTestProjects/AssemblyInfo.cs
  170. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/OtherTestProjects/OtherTestClass.cs
  171. 0 ...2015To2017Tests → Project2015To2017.Tests}/TestFiles/OtherTestProjects/containsTestSDK.testcsproj
  172. 0 ...ect2015To2017Tests → Project2015To2017.Tests}/TestFiles/OtherTestProjects/net46console.testcsproj
  173. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/OtherTestProjects/packages.config
  174. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/OtherTestProjects/readonly.testcsproj
  175. BIN {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/OtherTestProjects/test.nuspec
  176. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/OtherTestProjects/unittest.testcsproj
  177. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Solutions/ClassLibrary/Class1.cs
  178. 0 ...ct2015To2017Tests → Project2015To2017.Tests}/TestFiles/Solutions/ClassLibrary/ClassLibrary.csproj
  179. 0 ...o2017Tests → Project2015To2017.Tests}/TestFiles/Solutions/ClassLibrary/Properties/AssemblyInfo.cs
  180. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Solutions/TextFile.txt
  181. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/Solutions/sampleSolution.testsln
  182. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/app.iOS.testcsproj
  183. 0 {Project2015To2017Tests → Project2015To2017.Tests}/TestFiles/nuSpecs/noNamespace.nuspec
  184. +1 −3 {Project2015To2017Tests → Project2015To2017.Tests}/TestProjectPackageReferenceTransformationTest.cs
  185. 0 {Project2015To2017Tests → Project2015To2017.Tests}/UnsupportedProjectTypesTest.cs
  186. 0 {Project2015To2017Tests → Project2015To2017.Tests}/W001IllegalProjectTypeDiagnosticTest.cs
  187. +1 −3 {Project2015To2017Tests → Project2015To2017.Tests}/XamlTransformationTest.cs
  188. +14 −1 Project2015To2017.sln
  189. +15 −31 Project2015To2017/Project2015To2017.csproj
  190. +90 −0 Project2015To2017/ProjectConverterExtensions.cs
  191. +2 −7 appveyor.yml
View
@@ -0,0 +1,17 @@
<Project>
<PropertyGroup>
<LangVersion>7.3</LangVersion>
<Authors>hvanbakel et. al.</Authors>
<Product>Project2015To2017</Product>
<PackageProjectUrl>https://github.com/hvanbakel/CsprojToVs2017</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/hvanbakel/CsprojToVs2017/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/hvanbakel/CsprojToVs2017</RepositoryUrl>
<Copyright>Copyright Hans van Bakel</Copyright>
<Description>Tool for converting a MSBuild project file to VS2017 format and beyond.</Description>
<PackageTags>dotnet csproj fsproj vbproj msbuild conversion vs2015 vs14 vs15 vs2017</PackageTags>
<Version>3.0.2</Version>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
</PropertyGroup>
</Project>
@@ -1,12 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using CommandLine;
using Microsoft.Extensions.Logging;
using Project2015To2017.Analysis;
using Project2015To2017.Definition;
using Project2015To2017.Reading;
using Project2015To2017.Migrate2017;
using Project2015To2017.Transforms;
namespace Project2015To2017.Console
@@ -27,7 +25,7 @@ private static void ConvertProject(Options options)
ILogger logger = new ConsoleLogger("console", (s, l) => l >= LogLevel.Information, true);
logger.LogWarning("csproj-to-2017 is deprecated and will be removed soon. Consider migrating to Project2015To2017.Migrate2017.Tool (dotnet migrate-2017)");
logger.LogError("csproj-to-2017 is obsolete and will be removed very soon. Migrate to Project2015To2017.Migrate2017.Tool (dotnet migrate-2017) as soon as possible.");
foreach (var file in options.Files)
{
@@ -83,80 +81,5 @@ private static void ConvertProject(Options options)
analyzer.Analyze(project);
}
}
private static IEnumerable<Project> Convert(this ProjectConverter self, string target, ILogger logger)
{
var extension = Path.GetExtension(target) ?? throw new ArgumentNullException(nameof(target));
if (extension.Length > 0)
{
var file = new FileInfo(target);
switch (extension)
{
case ".sln":
{
var solution = SolutionReader.Instance.Read(file, logger);
foreach (var project in self.ProcessSolutionFile(solution))
{
yield return project;
}
break;
}
case string s when ProjectConverter.ProjectFileMappings.ContainsKey(extension):
{
yield return self.ProcessProjectFile(file, null);
break;
}
default:
logger.LogCritical("Please specify a project or solution file.");
break;
}
yield break;
}
// Process the only solution in given directory
var solutionFiles = Directory.EnumerateFiles(target, "*.sln", SearchOption.TopDirectoryOnly).ToArray();
if (solutionFiles.Length == 1)
{
var solution = SolutionReader.Instance.Read(solutionFiles[0], logger);
foreach (var project in self.ProcessSolutionFile(solution))
{
yield return project;
}
yield break;
}
var projectsProcessed = 0;
// Process all csprojs found in given directory
foreach (var fileExtension in ProjectConverter.ProjectFileMappings.Keys)
{
var projectFiles = Directory.EnumerateFiles(target, "*" + fileExtension, SearchOption.AllDirectories).ToArray();
if (projectFiles.Length == 0)
{
continue;
}
if (projectFiles.Length > 1)
{
logger.LogInformation($"Multiple project files found under directory {target}:");
}
logger.LogInformation(string.Join(Environment.NewLine, projectFiles));
foreach (var projectFile in projectFiles)
{
// todo: rewrite both directory enumerations to use FileInfo instead of raw strings
yield return self.ProcessProjectFile(new FileInfo(projectFile), null);
projectsProcessed++;
}
}
if (projectsProcessed == 0)
{
logger.LogCritical("Please specify a project file.");
}
}
}
}
@@ -1,20 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<RootNamespace>Project2015To2017.Console</RootNamespace>
<AssemblyName>Project2015To2017.Console</AssemblyName>
<PackageId>Project2015To2017.Cli</PackageId>
<Authors>hvanbakel et. al.</Authors>
<Product>Project2015To2017.Cli</Product>
<Description>Tool for converting a MSBuild project file to VS2017 format and beyond.</Description>
<PackageProjectUrl>https://github.com/hvanbakel/CsprojToVs2017</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/hvanbakel/CsprojToVs2017/blob/master/LICENSE</PackageLicenseUrl>
<RepositoryUrl>https://github.com/hvanbakel/CsprojToVs2017</RepositoryUrl>
<Copyright>Copyright Hans van Bakel</Copyright>
<PackageTags>dotnet csproj conversion vs2015 vs2017</PackageTags>
<Version>3.0.2</Version>
<OutputType>Exe</OutputType>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition="$(Pack) != 'true'">
@@ -29,7 +18,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.2.1" />
<PackageReference Include="CommandLineParser" Version="2.3.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
</ItemGroup>
@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
<RootNamespace>Project2015To2017</RootNamespace>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.9.0" />
<PackageReference Include="NuGet.Configuration" Version="4.6.2" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="1.1.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkVersion)' == 'v2.0'">
<PackageReference Include="System.Runtime.Caching" Version="4.5.0" />
<Compile Remove="Reading/ConditionEvaluator.LegacyCache.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkVersion)' == 'v1.3'">
<Compile Remove="Reading/ConditionEvaluator.ModernCache.cs" />
</ItemGroup>
</Project>
@@ -8,7 +8,7 @@
using System.Linq;
using System.Runtime.CompilerServices;
[assembly: InternalsVisibleTo("Project2015To2017Tests")]
[assembly: InternalsVisibleTo("Project2015To2017.Tests")]
namespace Project2015To2017
{
@@ -36,82 +36,7 @@ public sealed class ProjectConverter
this.transformationSet = transformationSet ?? BasicReadTransformationSet.Instance;
this.projectReader = new ProjectReader(logger, this.conversionOptions);
}
public IEnumerable<Project> Convert(string target)
{
var extension = Path.GetExtension(target) ?? throw new ArgumentNullException(nameof(target));
if (extension.Length > 0)
{
var file = new FileInfo(target);
switch (extension)
{
case ".sln":
{
var solution = SolutionReader.Instance.Read(file, this.logger);
foreach (var project in ProcessSolutionFile(solution))
{
yield return project;
}
break;
}
case string s when ProjectFileMappings.ContainsKey(extension):
{
yield return this.ProcessProjectFile(file, null);
break;
}
default:
{
this.logger.LogCritical("Please specify a project or solution file.");
break;
}
}
yield break;
}
// Process the only solution in given directory
var solutionFiles = Directory.EnumerateFiles(target, "*.sln", SearchOption.TopDirectoryOnly).ToArray();
if (solutionFiles.Length == 1)
{
var solution = SolutionReader.Instance.Read(solutionFiles[0], this.logger);
foreach (var project in this.ProcessSolutionFile(solution))
{
yield return project;
}
yield break;
}
var projectsProcessed = 0;
// Process all csprojs found in given directory
foreach (var mapping in ProjectFileMappings)
{
var projectFiles = Directory.EnumerateFiles(target, "*" + mapping.Key, SearchOption.AllDirectories).ToArray();
if (projectFiles.Length == 0)
{
continue;
}
if (projectFiles.Length > 1)
{
this.logger.LogInformation($"Multiple project files found under directory {target}:");
}
this.logger.LogInformation(string.Join(Environment.NewLine, projectFiles));
foreach (var projectFile in projectFiles)
{
yield return this.ProcessProjectFile(new FileInfo(projectFile), null);
projectsProcessed++;
}
}
if (projectsProcessed == 0)
{
this.logger.LogCritical("Please specify a project file.");
}
}
public IEnumerable<Project> ProcessSolutionFile(Solution solution)
{
this.logger.LogTrace("Solution parsing started.");
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
<RootNamespace>Project2015To2017.Migrate2017</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Project2015To2017.Core\Project2015To2017.Core.csproj" />
</ItemGroup>
</Project>
@@ -1,8 +1,9 @@
using System.Collections.Immutable;
using System.Linq;
using Project2015To2017.Definition;
using Project2015To2017.Transforms;
namespace Project2015To2017.Transforms
namespace Project2015To2017.Migrate2017.Transforms
{
public sealed class AssemblyFilterDefaultTransformation : ILegacyOnlyProjectTransformation
{
@@ -1,8 +1,9 @@
using System.IO;
using System.Linq;
using Project2015To2017.Definition;
using Project2015To2017.Transforms;
namespace Project2015To2017.Transforms
namespace Project2015To2017.Migrate2017.Transforms
{
public sealed class AssemblyFilterHintedPackageReferencesTransformation : ILegacyOnlyProjectTransformation
{
@@ -1,8 +1,9 @@
using System.Collections.Generic;
using System.Linq;
using Project2015To2017.Definition;
using Project2015To2017.Transforms;
namespace Project2015To2017.Transforms
namespace Project2015To2017.Migrate2017.Transforms
{
public sealed class AssemblyFilterPackageReferencesTransformation : ILegacyOnlyProjectTransformation
{
@@ -1,13 +1,13 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Microsoft.Extensions.Logging;
using Project2015To2017.Definition;
using Project2015To2017.Transforms;
namespace Project2015To2017.Transforms
namespace Project2015To2017.Migrate2017.Transforms
{
public sealed class FileTransformation : ILegacyOnlyProjectTransformation
{
@@ -3,8 +3,9 @@
using System.Linq;
using System.Xml.Linq;
using Project2015To2017.Definition;
using Project2015To2017.Transforms;
namespace Project2015To2017.Transforms
namespace Project2015To2017.Migrate2017.Transforms
{
public sealed class ImportsTargetsFilterPackageReferencesTransformation : ILegacyOnlyProjectTransformation
{
@@ -1,8 +1,9 @@
using System.Linq;
using Microsoft.Extensions.Logging;
using Project2015To2017.Definition;
using Project2015To2017.Transforms;
namespace Project2015To2017.Transforms
namespace Project2015To2017.Migrate2017.Transforms
{
public sealed class TestProjectPackageReferenceTransformation : ILegacyOnlyProjectTransformation
{
@@ -1,12 +1,13 @@
using Microsoft.Extensions.Logging;
using Project2015To2017.Definition;
using System;
using System.Collections.Immutable;
using System.IO;
using System.Linq;
using System.Xml.Linq;
using Microsoft.Extensions.Logging;
using Project2015To2017.Definition;
using Project2015To2017.Transforms;
namespace Project2015To2017.Transforms
namespace Project2015To2017.Migrate2017.Transforms
{
public sealed class XamlPagesTransformation : ILegacyOnlyProjectTransformation
{
@@ -1,7 +1,9 @@
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using Project2015To2017.Migrate2017.Transforms;
using Project2015To2017.Transforms;
namespace Project2015To2017.Transforms
namespace Project2015To2017.Migrate2017
{
public class Vs15TransformationSet : ITransformationSet
{
Oops, something went wrong.

0 comments on commit af07864

Please sign in to comment.