Giter Site home page Giter Site logo

rebuildanalyzer's Introduction

Rebuild Analyzer

An utility which analyzes your slnf/sln/csproj/shproj against a files changeset to determine what you need to rebuild.

Status

Prerelease version.

I guess there are a lot of misses. Issues with repro will be appreciated.

How it works

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
                        ),
                };
            }
        }

Notes

  1. Changeset MUST be something that comes from a programmer: it MUST NOT include changes in autogenerated files or other "non-permanent files".
  2. Changes in props files itself threats as everything has changed without further analyze.
  3. Changes in sln/csproj/shproj files itself threats as everything which includes these changed sln/csproj without further analyze.

rebuildanalyzer's People

Contributors

lsoft avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.