Skip to content
Compare
Choose a tag to compare
@3F 3F released this 29 Apr 21:02
a00e3b3

MvsSln 2.7

NuGet 📦.nupkg
📑 What's new in 2.7 ...
  • NEW: Added default skeleton for SlnWriter in an attempt to make it easier to create from scratch.
    Empty .Write() methods will use it by default or merge it with the actual Map.

  • NEW: Added asynchronous metods* for SlnWriter
    *Both implementations including legacy netfx4.0 target platform, and async/await for modern.

  • NEW: Added SMap implementation to wrap ISlnResult.Map. More control over ISection and its handler.

  • NEW: Added LhDataHelper as an additional way to prepare default handlers from data (ISlnWhData).

LhDataHelper hdata = new();
hdata.SetHeader(SlnHeader.MakeDefault())
        .SetProjects(projects)
        .SetProjectConfigs(prjConfs)
        .SetSolutionConfigs(slnConf);

using SlnWriter w = new(solutionFile, hdata);

See related issue #61 for details.

  • NEW: Implemented CreateProjectsIfNotExist option for SlnWriter.
using SlnWriter w = new(solutionFile, hdata);
w.Options = SlnWriterOptions.CreateProjectsIfNotExist;
// it will write according ProjectType information (both legacy or sdk-style)
w.Write();

Use +IProjectsToucher to override implementation.
You can find complete example in #61

  • NEW: New modern LineBuilder to make creating new handlers easier or control EOL. Related issue #57.

  • NEW: Added DefaultHandlers wrapper to prepare all default according to ISlnResult(ISlnWhData).

  • NEW: SlnWriter: + WriteAsString() & WriteAsStringAsync() to save the result as string instead of file.

using SlnWriter w = new(handlers);
string data = await w.WriteAsStringAsync(sln.Result.Map);
  • NEW: Added platform independent IObjHandler.NewLine to specify the EOL for used w\handlers.
    +.UpdateNewLine() extension for a collection of handlers.

  • NEW: New modern IXProject.AddReference(.., AddReferenceOptions) to control everything for Reference nodes.
    Old signatures has been marked as obsolete and scheduled to be removed in future versions.

Default = HideEmbedInteropTypes | HideSpecificVersion,
DefaultResolve = Default | ResolveAssemblyName | OmitArchitecture | OmitCultureNeutral | ...
Mini = Default | HidePrivate,
MiniResolve = Mini | DefaultResolve | OmitCulture,

See related issue #61 for details.

  • NEW: SlnWriter now supports ISlnResult -> +ISlnWhData data to preapre default handlers itself.

  • NEW: Implemented overriding of GetHashCode/Equals for ImportElement, RoProperties, Projects.Item.

  • NEW: +IConfPlatform.IsEqualPair(IConfPlatform)

  • NEW: ProjectItem adds ability to generate a project name from a specified input path:
    slnDir\ProjectName\src.csproj -> ProjectName
    slnDir\ProjectName.csproj -> ProjectName

new ProjectItem(ProjectType.CsSdk, @$"{projName}\src.csproj", slnDir: baseDir)
  • FIXED: Fixed bug with a disappearing EndProject. See related #56

  • FIXED: Fixed duplicated lines when disabling some features through SlnItems.

  • FIXED: Fixed lines being ignored when handlers are not prepared.

  • FIXED: If the handler is not initialized as object, the corresponding entry is lost.

  • FIXED: Fixed PackageInfo == Equals for null.

  • CHANGED: SlnParser has been switched to UTF8 by default.

  • CHANGED: SlnWriter now will ignore W\handler that will return null value at IObjHandler.Extract().

  • CHANGED: Removed comparing of parent project and origin item in PropertyItem.Equals.

  • CHANGED: SlnHeader is sealed now with new ctors and added SlnHeader.MakeDefault().

  • CHANGED: ConfigPrj: new ctors +protected internal set for IncludeInBuild and IncludeInDeploy properties.

  • CHANGED: Projects.Item and PropertyItem:
    new ctors & renamed evaluatedValue, evaluatedInclude, unevaluatedValue, unevaluatedInclude
    Old access still is available but marked as obsolete and scheduled to be removed in future versions.

  • CHANGED: Updated path \ / logic between Windows and unix-like systems.