Coder Social home page Coder Social logo

csprojsorter's People

Contributors

robcthegeek avatar

Stargazers

 avatar  avatar

Forkers

calanorlabs

csprojsorter's Issues

Sort Nodes by Element Values within "ItemGroup" Nodes

Given an ItemGroup like the following:

<ItemGroup>
    <Reference Include="ReferenceB" />
    <Reference Include="ReferenceA" />
    <Reference Include="ReferenceD" />
    <Reference Include="ReferenceE" />
    <Reference Include="ReferenceC" />
</ItemGroup>

We need to have this alpha-sorted based on it's value (in this case "Include"). Like so:

<ItemGroup>
    <Reference Include="ReferenceA" />
    <Reference Include="ReferenceB" />
    <Reference Include="ReferenceC" />
    <Reference Include="ReferenceD" />
    <Reference Include="ReferenceE" />
</ItemGroup>

Keep in mind that some elements might determine their "value" by a different attribute (such as "Name").

Remove Duplicate "ItemGroup" Nodes

When merging - we often find that multiple ItemGroup elements are created, that each contain the same sub-elements like so:

<ItemGroup>
    <Reference Include="ReferenceB" />
    <Reference Include="ReferenceA" />
</ItemGroup>
<ItemGroup>
    <Reference Include="ReferenceD" />
    <Reference Include="ReferenceE" />
    <Reference Include="ReferenceC" />
</ItemGroup>

To make everything else (such as sorting the elements) easier, it would make sense to collapse these nodes down into a single element first. So its more like:

<ItemGroup>
    <Reference Include="ReferenceB" />
    <Reference Include="ReferenceA" />
    <Reference Include="ReferenceD" />
    <Reference Include="ReferenceE" />
    <Reference Include="ReferenceC" />
</ItemGroup>
<ItemGroup>
    <EmbeddedResource Include="Areas\EmbeddedResourceC\Resources.resx" />
    <EmbeddedResource Include="Areas\EmbeddedResourceB\Resources.resx" />
    <EmbeddedResource Include="Areas\EmbeddedResourceA\Resources.resx" />
</ItemGroup>

Create CLI to Sort CSPROJ Files

As a user that wants to consolidate/sort their CSPROJ file
I want a CLI app to run the application
So that I can integrate into my development/deploy process.

For this first version, I think we should just KISS:

  • Take the path of the CSPROJ file as the only argument.
  • Copy that file to a backup.
  • Overwrite the original.

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.