An utility which analyzes your slnf/sln/csproj/shproj against a files changeset to determine what you need to rebuild.
Prerelease version.
I guess there are a lot of misses. Issues with repro will be appreciated.
This utility parse your slnf
/sln
/csproj
files to discover all included items and check it against an incoming changeset to determine if this slnf/sln/csproj has changed.
Parsing is powered by Microsoft.Build
nuget.
Example:
//test this repository
var ra = new TestRepositoryAnalyzer();
//determine which slnf/sln/csproj has changed
var affs = ra.DetermineAffectedSubjects(changeset);
//log the results:
Console.WriteLine("Changed: " + string.Join(",", affs.Select(a => a.RelativeFilePath)));
/// <summary>
/// Test this repository.
/// </summary>
public sealed class TestRepositoryAnalyzer : RepositoryAnalyzer
{
/// <summary>
/// Test against multitarget csproj RebuildAnalyzer.Test.Subject.Console1
/// </summary>
public static Changeset TestChangeset1 = new Changeset(
new[]
{
"RebuildAnalyzer.Test.Subject.Console1\\DotNet7File.cs"
}.ToHashSet()
);
protected override IReadOnlyList<string> GetSkippedProjects()
{
return new List<string>
{
};
}
protected override IReadOnlyList<AnalyzeSubject> ScanForSubjects()
{
return new List<AnalyzeSubject>
{
new AnalyzeSubject(
Path.GetFullPath(@"..\\..\\..\\..\\"),
@"RebuildAnalyzer.Test.Subject.Console1.sln",
AnalyzeSubjectKindEnum.Sln
),
};
}
}
- Changeset MUST be something that comes from a programmer: it MUST NOT include changes in autogenerated files or other "non-permanent files".
- Changes in
props
files itself threats aseverything has changed
without further analyze. - Changes in
sln
/csproj
/shproj
files itself threats aseverything which includes these changed sln/csproj
without further analyze.