Skip to content

Commit

Permalink
Public release of the MvsSln - v2.0
Browse files Browse the repository at this point in the history
* NEW: Updated architecture now provides 2 types of handlers - readers (ISlnHandler) and writers (IObjHandler).
        You also can use your custom reader or writer, just implement an `ISlnHandler` or `IObjHandler`:

        ```
          class MyReader: LAbstract, ISlnHandler { ... }
          class MyWriter: WAbstract, IObjHandler { ... }
        ```

        Read the documentation for details.

* NEW: MvsSln now also may provide map of analyzed data. Parser will expose map through list of `ISection` for each line.
       To enable this, define a bit 0x0080 for type of operations to parser.
       This helps to get flexible control between readers and any writers.

       Example of using writer `WSolutionConfigurationPlatforms` together with calculated map:

        ```
          var data = new List<IConfPlatform>() {
              new ConfigSln("Debug", "Any CPU"),
              new ConfigSln("Release_net45", "x64"),
              new ConfigSln("Release", "Any CPU"),
          };

          var whandlers = new Dictionary<Type, HandlerValue>() {
              [typeof(LSolutionConfigurationPlatforms)] = new HandlerValue(new WSolutionConfigurationPlatforms(data)),
          };

          using(var w = new SlnWriter("<path_to>.sln", whandlers)) {
              w.Write(map);
          }
        ```

        Read the documentation for details.

* NEW: Implemented new writer `WProject`.
* NEW: Implemented new writer `WProjectConfigurationPlatforms`.
* NEW: Implemented new writer `WSolutionConfigurationPlatforms`.
* NEW: Implemented new writer `WVisualStudioVersion`.
* NEW: Implemented new writer `WProjectSolutionItems`.
* NEW: Implemented new reader `LVisualStudioVersion`.
* NEW: Implemented new reader `LProjectSolutionItems`.
* FIXED: Fixed possible bug when SlnItems.All &~ SlnItems.Projects.
* FIXED: Fixed possible null with PropertyItem.evaluatedValue:
           MS describes this as 'the evaluated property value, which is never null'
           But, this is not true: .NETFramework\v4.0\Microsoft.Build.dll - Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a

* FIXED: Fixed possible null for `IXProject.ProjectName` when project does not contain this property.
* CHANGED: `IXProject.ProjectGuid` now will return value from ProjectItem.pGuid if project file does not contain an Guid at all.
            It's actual for SDK-based projects.

* CHANGED: SlnParser now can be initialized without handlers at all.
            ```
              ISlnContainer sln = new SlnParser(false);
              sln.SlnHandlers.Register(new LMySpec());
              ...

              // to reset and register all default:
              sln.SetDefaultHandlers();
            ```

* CHANGED: Updated SlnItems: added `Map` item to create map when processing sln data.
* CHANGED: `IsolatedEnv.Load(...)` splitted and marked as virtual to leave the final implementation for user,
            to avoid problems like in Issue #1 etc.

* CHANGED: Updated abstract layer with some types from ISlnResult & ISlnResultSvc.
* CHANGED: Updated GetNuTool v1.6.1.10480_bde3e50 & hMSBuild v1.2.2.62992_3ee58c3.
* KNOWN_PROBLEM: C++ projects and their initialization for Visual Studio 2017. Issue #1.
  • Loading branch information
3F committed Oct 5, 2017
1 parent a84f0f2 commit edc72b3
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
2.0.0
8 changes: 4 additions & 4 deletions MvsSln/MvsSlnVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ public struct MvsSlnVersion
{
public static readonly Version number = new Version(S_NUM_REV);

public const string S_NUM = "1.0.1";
public const string S_REV = "43412";
public const string S_NUM = "2.0.0";
public const string S_REV = "23904";

public const string S_NUM_REV = S_NUM + "." + S_REV;

public const string BRANCH_SHA1 = "92d1be7";
public const string BRANCH_SHA1 = "a84f0f2";
public const string BRANCH_NAME = "master";
public const string BRANCH_REVC = "16";
public const string BRANCH_REVC = "37";

internal const string S_INFO = S_NUM_REV + " [ " + BRANCH_SHA1 + " ]";
internal const string S_INFO_FULL = S_INFO + " /'" + BRANCH_NAME + "':" + BRANCH_REVC;
Expand Down
16 changes: 10 additions & 6 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

MvsSln provides logic for complex support of the Visual Studio .sln files and its projects (.vcxproj, .csproj., ...).

It was as a 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/issues/38) and for others.
It was as a 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/issues/38) and for others).

[![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)
Expand All @@ -27,9 +27,9 @@ Copyright (c) 2013-2017 Denis Kuzmin < [email protected] > :: github.com/3F

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.

Even if you just need the basic access to information from the solution data, like: project Guids, paths, solution & projects configurations, calculating map of projects via build-order through our ProjectDependencies helpers, etc.
Even if you just need the basic access to information or more complex work through our readers and writers.

You can also control easily all your projects: Reference, ProjectReference, Properties, Import sections, and others.
You can also easily control all your projects data (Reference, ProjectReference, Properties, Import sections, and others).

Moreover, it has been re-licensed now (LGPLv3 -> MIT) from the vsSolutionBuildEvent projects, so, enjoy with us now.

Expand Down Expand Up @@ -75,7 +75,9 @@ using(var sln = new Sln(@"D:\projects\Conari\Conari.sln", SlnItems.All & ~SlnIte
} // release all loaded projects
```

By the way, the any new solution handler can be easily added by our flexible architecture. Example of `LProject` handler (**reader**):
By the way, the any new solution handler (reader or writer) can be easily added by our flexible architecture.

Example of `LProject` handler (**reader**):

```csharp
public class LProject: LAbstract, ISlnHandler
Expand Down Expand Up @@ -134,6 +136,8 @@ public class WSolutionConfigurationPlatforms: WAbstract, IObjHandler
}
```

Control anything and have fun !

## Examples of using

### DllExport configurator
Expand All @@ -146,7 +150,7 @@ The final draft-version of the new configurator for DllExport now fully works vi

### Map of .sln & Writers

v2+ also provides map of analyzed data. To enable this, define a bit **0x0080** for type of operations to parser.
v2+ now also may provide map of analyzed data. To enable this, define a bit **0x0080** for type of operations to parser.

Parser will expose map through list of `ISection` for each line. For example:

Expand Down Expand Up @@ -272,7 +276,7 @@ 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`
* [GitHub Releases](https://github.com/3F/MvsSln/releases) ( [latest](https://github.com/3F/MvsSln/releases/latest) )
* [GitHub Releases](https://github.com/3F/MvsSln/releases) [ [latest](https://github.com/3F/MvsSln/releases/latest) ]
* [Nightly builds](https://ci.appveyor.com/project/3Fs/mvssln/history) (`/artifacts` page). But remember: It can be unstable or not work at all. Use this for tests of latest changes.


Expand Down
71 changes: 71 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,77 @@ MvsSln :: https://github.com/3F/MvsSln
_ _ _ _


[v2.0] 2017.10.05

* NEW: Updated architecture now provides 2 types of handlers - readers (ISlnHandler) and writers (IObjHandler).
You also can use your custom reader or writer, just implement an `ISlnHandler` or `IObjHandler`:

```
class MyReader: LAbstract, ISlnHandler { ... }
class MyWriter: WAbstract, IObjHandler { ... }
```

Read the documentation for details.

* NEW: MvsSln now also may provide map of analyzed data. Parser will expose map through list of `ISection` for each line.
To enable this, define a bit 0x0080 for type of operations to parser.
This helps to get flexible control between readers and any writers.

Example of using writer `WSolutionConfigurationPlatforms` together with calculated map:

```
var data = new List<IConfPlatform>() {
new ConfigSln("Debug", "Any CPU"),
new ConfigSln("Release_net45", "x64"),
new ConfigSln("Release", "Any CPU"),
};

var whandlers = new Dictionary<Type, HandlerValue>() {
[typeof(LSolutionConfigurationPlatforms)] = new HandlerValue(new WSolutionConfigurationPlatforms(data)),
};

using(var w = new SlnWriter("<path_to>.sln", whandlers)) {
w.Write(map);
}
```

Read the documentation for details.

* NEW: Implemented new writer `WProject`.
* NEW: Implemented new writer `WProjectConfigurationPlatforms`.
* NEW: Implemented new writer `WSolutionConfigurationPlatforms`.
* NEW: Implemented new writer `WVisualStudioVersion`.
* NEW: Implemented new writer `WProjectSolutionItems`.
* NEW: Implemented new reader `LVisualStudioVersion`.
* NEW: Implemented new reader `LProjectSolutionItems`.
* FIXED: Fixed possible bug when SlnItems.All &~ SlnItems.Projects.
* FIXED: Fixed possible null with PropertyItem.evaluatedValue:
MS describes this as 'the evaluated property value, which is never null'
But, this is not true: .NETFramework\v4.0\Microsoft.Build.dll - Version=4.0.0.0, PublicKeyToken=b03f5f7f11d50a3a

* FIXED: Fixed possible null for `IXProject.ProjectName` when project does not contain this property.
* CHANGED: `IXProject.ProjectGuid` now will return value from ProjectItem.pGuid if project file does not contain an Guid at all.
It's actual for SDK-based projects.

* CHANGED: SlnParser now can be initialized without handlers at all.
```
ISlnContainer sln = new SlnParser(false);
sln.SlnHandlers.Register(new LMySpec());
...

// to reset and register all default:
sln.SetDefaultHandlers();
```

* CHANGED: Updated SlnItems: added `Map` item to create map when processing sln data.
* CHANGED: `IsolatedEnv.Load(...)` splitted and marked as virtual to leave the final implementation for user,
to avoid problems like in Issue #1 etc.

* CHANGED: Updated abstract layer with some types from ISlnResult & ISlnResultSvc.
* CHANGED: Updated GetNuTool v1.6.1.10480_bde3e50 & hMSBuild v1.2.2.62992_3ee58c3.
* KNOWN_PROBLEM: C++ projects and their initialization for Visual Studio 2017. Issue #1.


[v1.0.1] 2017.07.21

* FIXED: Fixed possible bug with already loaded project in collection when initializing new instance of Sln.
Expand Down
4 changes: 2 additions & 2 deletions tools/MvsSln.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata>
<id>MvsSln</id>
<version>1.0.1</version>
<version>2.0.0</version>
<title>[ MvsSln ] VisualStudio .sln files and its projects</title>
<authors>github.com/3F/MvsSln</authors>
<owners>reg</owners>
Expand All @@ -21,7 +21,7 @@
~~~~~~~~
Get it via GetNuTool:
==========================================
gnt /p:ngpackages="MvsSln/1.0.1"
gnt /p:ngpackages="MvsSln/2.0.0"
==========================================
* https://github.com/3F/GetNuTool

Expand Down

0 comments on commit edc72b3

Please sign in to comment.