diff --git a/Readme.md b/Readme.md index 775b071..fad6496 100644 --- a/Readme.md +++ b/Readme.md @@ -2,9 +2,7 @@ [![](https://raw.githubusercontent.com/3F/MvsSln/master/MvsSln/Resources/MvsSln_v1_96px.png)](https://github.com/3F/MvsSln) -MvsSln provides complex support (sln parser, r/w handlers, ...) of the Visual Studio .sln files and its projects (.vcxproj, .csproj., ...). - -It was part of the [vsSolutionBuildEvent](https://github.com/3F/vsSolutionBuildEvent) projects, but now it extracted into the new (specially for [DllExport](https://github.com/3F/DllExport) and for others). +🧩 Customizable VisualStudio .sln parser, complex support of the projects (.vcxproj, .csproj., …), lightweight r/w handlers at runtime, and more. [![Build status](https://ci.appveyor.com/api/projects/status/if1t4rhhntpf6ut3/branch/master?svg=true)](https://ci.appveyor.com/project/3Fs/mvssln/branch/master) [![release-src](https://img.shields.io/github/release/3F/MvsSln.svg)](https://github.com/3F/MvsSln/releases/latest) @@ -26,20 +24,28 @@ The [MIT License (MIT)](https://github.com/3F/MvsSln/blob/master/License.txt) ``` Copyright (c) 2013-2019 Denis Kuzmin < entry.reg@gmail.com > GitHub/3F ``` -MvsSln contributors: https://github.com/3F/MvsSln/graphs/contributors [ [ ☕ Donate ](https://3F.github.com/Donation/) ] +MvsSln contributors: https://github.com/3F/MvsSln/graphs/contributors + +We're waiting for your awesome contributions! + ## Why MvsSln ? -Because today it still is the most easy way for complex work with Visual Studio .sln files and its projects (.vcxproj, .csproj., ...). Because it's free, because it's open. +Because today it still is the most easy way for complex work with Visual Studio .sln files and their projects (.vcxproj, .csproj., ...). Because it's free, because it's open. + +1. 🌌 We're providing most convenient work with projects, their dependencies, their lazy loading, any folders, any items, references, and lot of other important things. +2. 💡 We're customizable and extensible library at runtime. Make **your custom** .sln for everything! +3. 🚀 We were born from other popular project to be more loyal for your preferences on the fly. Hello from 2013. Even if you just need the basic access to information or more complex work through our readers and writers. -* You can also easily control all your projects data (Reference, ProjectReference, Properties, Import sections, ...). -* Or even create your **custom sln parsing** of anything **in a few steps.** +Easily control all your projects data (Reference, ProjectReference, Properties, Import sections, ...). Or even create your **custom sln parsing** of anything in a few steps. -Moreover, it has been re-licensed from vsSolutionBuildEvent projects (LGPLv3 -> MIT), so, enjoy with us. +Specially extracted and re-licensed from vsSolutionBuildEvent projects (LGPLv3 -> MIT) for https://github.com/3F/DllExport and others! + +Enjoy with us. 🎈 ```csharp using(var sln = new Sln(@"D:\projects\Conari\Conari.sln", SlnItems.All &~ SlnItems.ProjectDependencies)) @@ -49,6 +55,10 @@ using(var sln = new Sln(@"D:\projects\Conari\Conari.sln", SlnItems.All &~ SlnIte // new ConfigItem("Debug", "Any CPU") //); + var p = slnEnv.GetOrLoadProject( + sln.ProjectItems.FirstOrDefault(p => p.name == name) + ); + var paths = sln.Result.ProjectItems .Select(p => new { p.pGuid, p.fullPath }) .ToDictionary(p => p.pGuid, p => p.fullPath); @@ -96,7 +106,7 @@ if((RawText)"data" == (RawText)"data") { ... } ```` -Use Subdirectories: +Use 📂 Subdirectories: ```csharp new SolutionFolder("dir1", @@ -125,9 +135,11 @@ By the way, the any new solution handler (reader or writer) can be easily added Control anything and have fun ! -## Examples of using +## How or Where is used -### DllExport Manager +Let's consider examples of use in real projects below. + +### .NET DllExport DllExport project finally changed distribution of the packages starting with v1.6 release. The final manager now fully works via MvsSln: @@ -135,8 +147,20 @@ DllExport project finally changed distribution of the packages starting with v1. ![](https://raw.githubusercontent.com/3F/MvsSln/master/resources/MvsSln_DllExport_example.png) +### vsSolutionBuildEvent + +vsSolutionBuildEvent now is completely integrated with MvsSln [[?](https://github.com/3F/vsSolutionBuildEvent/pull/53)] + +Fully removed original parser and replaced related processing from Environment/IsolatedEnv/MSBuild/CIM. Now it just contains lightweight invoking of relevant methods. + +https://github.com/3F/vsSolutionBuildEvent -### Map of .sln & Writers +![](resources/vsSBE_and_MvsSln.png) + +![](resources/vsSBE_and_MvsSln_VS.png) + + +## Map of .sln & Writers v2+ now also may provide map of analyzed data. To enable this, define a bit **0x0080** for type of operations to parser. @@ -197,22 +221,16 @@ Second instance of project {4F8BB8CD-1116-4F07-9B8F-06D69FB8589B} with configura ... ``` -For example, the [vsSolutionBuildEvent](https://github.com/3F/vsSolutionBuildEvent) contains 8 projects and 8 solution configurations: +For example, the [vsSolutionBuildEvent](https://github.com/3F/vsSolutionBuildEvent) contains 10 projects and 8 solution configurations: ``` -CI_Debug_net45|Any CPU -CI_Debug|Any CPU -CI_Release_net45|Any CPU -CI_Release|Any CPU -Debug_net45|Any CPU -Debug|Any CPU -Release_net45|Any CPU -Release|Any CPU +DBG_SDK10; DBG_SDK15; DCI_SDK10; DCI_SDK15; REL_SDK10; REL_SDK15; RCI_SDK10; RCI_SDK15 ``` -Maximum possible configurations for each projects above should be calculated as 8 * 8 = 64, ie. 64 instances that *can be* loaded as each different project. `EnvWithProjects` will try load all available, but in fact, mostly 2 or more project-configuration can be related to the same 1 solution-configuration, therefore it can be just 30 or even 20 in reality, and so on. +Maximum **possible** configurations for each projects above should be calculated as 10 * 8 = 80, ie. 80 instances that *can be* loaded as each different project. `EnvWithProjects` will try load all available, but in fact, mostly 2 or more project-configuration can be related to the same 1 solution-configuration, therefore it can be just 30 or even 20 in reality, and so on. -However, if you only need to work with common data of selected project: you just need to use any available configuration. To load projects only with specific configuration, use for example `IEnvironment.LoadProjects`: +However, **if you need** to work only with common data of specified project: +* Just use any available configuration. That is, to load projects only with specific configuration, use for example `IEnvironment.LoadProjects`. ```csharp // SlnItems.Env will initialize environment without loading projects. @@ -228,7 +246,7 @@ using(var sln = new Sln(@"vsSolutionBuildEvent.sln", SlnItems.Env)) } ``` -**With latest version** should be also available `IEnvironment.LoadMinimalProjects` or `EnvWithMinimalProjects` flag. +**For modern versions** also available `IEnvironment.LoadMinimalProjects` or `EnvWithMinimalProjects` flag. ### Adding Reference & Assembly name @@ -237,8 +255,8 @@ XProject.AddReference(lib, false); ``` ```xml - - ..\packages\DllExport.1.5.2\gcache\metalib\DllExport.dll + + ..\packages\DllExport.1.6.4\gcache\metalib\DllExport.dll False ``` @@ -249,7 +267,7 @@ XProject.AddReference("DllExport", lib, false); ```xml - ..\packages\DllExport.1.5.2\gcache\metalib\DllExport.dll + ..\packages\DllExport.1.6.4\gcache\metalib\DllExport.dll False ``` @@ -319,8 +337,6 @@ public class WSolutionConfigurationPlatforms: WAbstract, IObjHandler ## How to get MvsSln -Available variants: - * [GetNuTool](https://github.com/3F/GetNuTool): `msbuild gnt.core /p:ngpackages="MvsSln"` or **[gnt](https://3f.github.io/GetNuTool/releases/latest/gnt/)** /p:ngpackages="MvsSln" * NuGet PM: `Install-Package MvsSln` * NuGet Commandline: `nuget install MvsSln` diff --git a/changelog.txt b/changelog.txt index 3b5fd0f..8b86e5e 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,6 +15,9 @@ _ _ _ _ * FIXED: [Broken in 2.2] Processing solution breaks when solution contains some unsupported/unknown project type. Issue #14. (Thanks @wouterroos). + * FIXED: Possible InvalidOperationException "Sequence contains no elements". + Issue #20. + * NEW: An `Deploy` flag support. PR #16 (Thanks @wouterroos). +IConfPlatformPrj.IncludeInDeploy @@ -222,5 +225,7 @@ _ _ _ _ [v1.0] 2017.07.07 - * Initial public release. - A tool for complex support of the Visual Studio .sln files and its projects. \ No newline at end of file + * Initial public release. Extracted from vsSolutionBuildEvent project: + https://github.com/3F/vsSolutionBuildEvent + + A new independent tool for complex support of the Visual Studio .sln files and its projects. \ No newline at end of file diff --git a/resources/vsSBE_and_MvsSln.png b/resources/vsSBE_and_MvsSln.png new file mode 100644 index 0000000..caea99f Binary files /dev/null and b/resources/vsSBE_and_MvsSln.png differ diff --git a/resources/vsSBE_and_MvsSln_VS.png b/resources/vsSBE_and_MvsSln_VS.png new file mode 100644 index 0000000..743d4e5 Binary files /dev/null and b/resources/vsSBE_and_MvsSln_VS.png differ diff --git a/tools/MvsSln.nuspec b/tools/MvsSln.nuspec index 44b382b..d98dd88 100644 --- a/tools/MvsSln.nuspec +++ b/tools/MvsSln.nuspec @@ -3,7 +3,7 @@ MvsSln 2.3.0 - [ MvsSln ] VisualStudio .sln files and its projects + [ MvsSln ] Customizable VisualStudio .sln parser, projects, r/w handlers at runtime github.com/3F/MvsSln License.txt reg @@ -14,14 +14,19 @@ false - MvsSln provides complex support (sln parser, r/w handlers, ...) of the Visual Studio .sln files and its projects (.vcxproj, .csproj., ...). + Customizable VisualStudio .sln parser, complex support of the projects (.vcxproj, .csproj., …), lightweight r/w handlers at runtime, and more. - Even if you just need the basic access to information or more complex work through our readers and writers. + 1. 🌌 We're providing most convenient work with projects, their dependencies, their lazy loading, any folders, any items, references, and lot of other important things. + 2. 💡 We're customizable and extensible library at runtime. Make [your custom] .sln for everything! + 3. 🚀 We were born from other popular project to be more loyal for your preferences on the fly. Hello from 2013. - * You can also easily control all your projects data (Reference, ProjectReference, Properties, Import sections, ...). - * Or even create your custom sln parsing of anything in a few steps. + Easily control all your projects data (Reference, ProjectReference, Properties, Import sections, ...). + Or even create your custom sln parsing of anything in a few steps. - It was part of the https://github.com/3F/vsSolutionBuildEvent projects, but now it extracted into the new (specially for https://github.com/3F/DllExport and for others). + Specially extracted and re-licensed from vsSolutionBuildEvent projects (LGPLv3 -> MIT) + for https://github.com/3F/DllExport and others! + + Enjoy with us. 🎈 _ _ _ _ _ _ Source code and all details here: https://github.com/3F/MvsSln @@ -36,7 +41,7 @@ {build_info} - Complex support (sln parser, r/w handlers, ...) of the Visual Studio .sln files and its projects (.vcxproj, .csproj, ...) - https://github.com/3F/MvsSln + Customizable VisualStudio .sln parser, complex support of the projects (.vcxproj, .csproj., …), lightweight r/w handlers at runtime, and more. - https://github.com/3F/MvsSln sln visualstudio parser sln-parser projects sln-files csproj vcxproj visual-studio VS2019 VS2017 VS2015 VS2013 VS2012 VS2010 msbuild GetNuTool hMSBuild MvsSln changelog: https://github.com/3F/MvsSln/blob/master/changelog.txt Copyright (c) 2013-2019 Denis Kuzmin [entry.reg@gmail.com] GitHub/3F diff --git a/tools/hMSBuild.bat b/tools/hMSBuild.bat index 228f191..e99dcae 100644 --- a/tools/hMSBuild.bat +++ b/tools/hMSBuild.bat @@ -1,5 +1,5 @@ @echo off -:: hMSBuild - 2.1.0.26714 [ 4b368c9 ] +:: hMSBuild - 2.2.0.39906+2465d90 :: Copyright (c) 2017-2019 Denis Kuzmin [ entry.reg@gmail.com ] GitHub/3F :: Copyright (c) the hMSBuild contributors set "aa=%~dp0" @@ -34,7 +34,7 @@ call :bu bn ac bo goto bv :bw echo. -@echo hMSBuild - 2.1.0.26714 [ 4b368c9 ] +@echo hMSBuild - 2.2.0.39906+2465d90 @echo Copyright (c) 2017-2019 Denis Kuzmin [ entry.reg@gmail.com ] GitHub/3F @echo Copyright (c) the hMSBuild contributors echo. @@ -162,7 +162,7 @@ call :b2 "selected vswhere version:" v set ao=1 goto b1 ) else if [!av!]==[-version] ( -@echo 2.1.0.26714 [ 4b368c9 ] +@echo 2.2.0.39906+2465d90 goto by ) else if [!av!]==[-vsw-priority] ( set /a "au+=1" & call :b4 bn[!au!] v set ap=!v! @@ -289,7 +289,7 @@ set a8=!ap! :cd call :b2 "attempts with filter: " a8 a6 set "a9=" & set "a_=" -for /F "usebackq tokens=1* delims=: " %%a in (`"!a4!" -nologo !a6! -requires !a8! Microsoft.Component.MSBuild`) do ( +for /F "usebackq tokens=1* delims=: " %%a in (`"!a4!" -nologo !a6! -products * -requires !a8! Microsoft.Component.MSBuild`) do ( if /I "%%~a"=="installationPath" set a9=%%~b if /I "%%~a"=="installationVersion" set a_=%%~b if defined a9 if defined a_ ( @@ -510,5 +510,5 @@ set a=PropertyGroup&set b=Condition&set c=ngpackages&set d=Target&set e=DependsO ^