Skip to content

Commit

Permalink
moved to use Microsoft.Build pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
Chase-William committed Feb 14, 2024
1 parent c6c1756 commit dffd39f
Show file tree
Hide file tree
Showing 74 changed files with 2,864 additions and 1,315 deletions.
42 changes: 6 additions & 36 deletions DotDocs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,24 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.2.32314.265
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.DotDocs.Run", "tests\Test.DotDocs.Run\Test.DotDocs.Run.csproj", "{EF56C0EE-5E93-4AB0-93B8-B77BD202A0D6}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotDocs", "src\DotDocs\DotDocs.csproj", "{0F6D424C-B7FE-4C33-B55D-6F28C6419469}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotDocs.Build", "src\DotDocs.Build\DotDocs.Build.csproj", "{268FFBE4-67F4-4A7C-A837-F1672B88DB50}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotDocs.Models", "src\DotDocs.Models\DotDocs.Models.csproj", "{32499EAE-B691-4408-8999-2904B3C6E26F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotDocs.Render", "src\DotDocs.Document\DotDocs.Render.csproj", "{420304AA-FF90-425D-A9A7-31DF3B7A3FFD}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotDocs.IO", "src\DotDocs.IO\DotDocs.IO.csproj", "{6F411A23-1F31-4DAE-8550-62DB6316485D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotDocs.Markdown", "src\DotDocs.Markdown\DotDocs.Markdown.csproj", "{E5FA2E29-6812-4990-A764-3C54186A5C38}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.DotDocs", "tests\Test.DotDocs\Test.DotDocs.csproj", "{C5E55D49-53D3-49E5-A2EE-27BCA9FFB8AB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.DotDocs.Source.One", "tests\Data\src\Test.DotDocs.Source.One\Test.DotDocs.Source.One.csproj", "{22D250A0-0756-47CF-9F2D-B11EF11B1FAF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Test.DotDocs.Run", "tests\Test.DotDocs.Run\Test.DotDocs.Run.csproj", "{11972A3D-60F4-4BE4-83A1-4E1390D2E33E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EF56C0EE-5E93-4AB0-93B8-B77BD202A0D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF56C0EE-5E93-4AB0-93B8-B77BD202A0D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF56C0EE-5E93-4AB0-93B8-B77BD202A0D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF56C0EE-5E93-4AB0-93B8-B77BD202A0D6}.Release|Any CPU.Build.0 = Release|Any CPU
{0F6D424C-B7FE-4C33-B55D-6F28C6419469}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0F6D424C-B7FE-4C33-B55D-6F28C6419469}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0F6D424C-B7FE-4C33-B55D-6F28C6419469}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0F6D424C-B7FE-4C33-B55D-6F28C6419469}.Release|Any CPU.Build.0 = Release|Any CPU
{268FFBE4-67F4-4A7C-A837-F1672B88DB50}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{268FFBE4-67F4-4A7C-A837-F1672B88DB50}.Debug|Any CPU.Build.0 = Debug|Any CPU
{268FFBE4-67F4-4A7C-A837-F1672B88DB50}.Release|Any CPU.ActiveCfg = Release|Any CPU
{268FFBE4-67F4-4A7C-A837-F1672B88DB50}.Release|Any CPU.Build.0 = Release|Any CPU
{32499EAE-B691-4408-8999-2904B3C6E26F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{32499EAE-B691-4408-8999-2904B3C6E26F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{32499EAE-B691-4408-8999-2904B3C6E26F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{32499EAE-B691-4408-8999-2904B3C6E26F}.Release|Any CPU.Build.0 = Release|Any CPU
{420304AA-FF90-425D-A9A7-31DF3B7A3FFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{420304AA-FF90-425D-A9A7-31DF3B7A3FFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{420304AA-FF90-425D-A9A7-31DF3B7A3FFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{420304AA-FF90-425D-A9A7-31DF3B7A3FFD}.Release|Any CPU.Build.0 = Release|Any CPU
{6F411A23-1F31-4DAE-8550-62DB6316485D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6F411A23-1F31-4DAE-8550-62DB6316485D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6F411A23-1F31-4DAE-8550-62DB6316485D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6F411A23-1F31-4DAE-8550-62DB6316485D}.Release|Any CPU.Build.0 = Release|Any CPU
{E5FA2E29-6812-4990-A764-3C54186A5C38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E5FA2E29-6812-4990-A764-3C54186A5C38}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E5FA2E29-6812-4990-A764-3C54186A5C38}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E5FA2E29-6812-4990-A764-3C54186A5C38}.Release|Any CPU.Build.0 = Release|Any CPU
{C5E55D49-53D3-49E5-A2EE-27BCA9FFB8AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C5E55D49-53D3-49E5-A2EE-27BCA9FFB8AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C5E55D49-53D3-49E5-A2EE-27BCA9FFB8AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -63,6 +29,10 @@ Global
{22D250A0-0756-47CF-9F2D-B11EF11B1FAF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22D250A0-0756-47CF-9F2D-B11EF11B1FAF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22D250A0-0756-47CF-9F2D-B11EF11B1FAF}.Release|Any CPU.Build.0 = Release|Any CPU
{11972A3D-60F4-4BE4-83A1-4E1390D2E33E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11972A3D-60F4-4BE4-83A1-4E1390D2E33E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11972A3D-60F4-4BE4-83A1-4E1390D2E33E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11972A3D-60F4-4BE4-83A1-4E1390D2E33E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
58 changes: 56 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,60 @@ This setup has proven to be flexible, yet provides appropriate structure and cod

> If the query result return an empty collection, rendering is skipped *i.e. (before, each, and after callbacks).*
### Tasks
## Creating Project Dependency Graph

- Should we use inheritance to remove redundent logic for handling optional params in *Member* based renderers?
- The starting project can be anywhere in the graph
- The graph can contain multiple isolated clusters
- There can be multiple parent project nodes
- There can be multiple child project nodes
- Each project file is represented by a single shared instance of a node
- Friendly API method must take a collection *(data set)* of project file paths assuming each item is unique
- Friendly API method must return a collection of root project files nodes

### Impl

- Use a dictionary to keep track of all `ProjectDocument`



- Iterate over *projectFiles*
- Check if current project file has children, if so process them and adjust, otherwise next
- When a new project adds another project as a dep, ensure the dep has that project added as a parent

```cs
// Public API
public static IEnumerable<ProjectDocument> GetProjects(IEnumerable<string> projectFiles) {
var projects = new Dictionary<string, ProjectDocument>();
var roots = new List<ProjectDocument>();
foreach (var location in projectFiles) {
// If a ProjectDocument and it's dependency tree hasnt been created, create it
if (!projects.ContainsKey(location)) {
// Add each level 0 node returned to the list as a possible root project
roots.Add(CreateProjectAndDependencies(location, projects));
}
}
// Return all the root projects
return roots;
}

static CreateProjectAndDependencies(string location, Dictionary<string, ProjectDocument> projects) {
// If a ProjectDocument already exists for the current project, return it, otherwise create it and return it
// When called recursively, this allows us to add an existing dependency tree to a newly created root node
if (projects.TryGetValue(location, out ProjectDocument proj)) {
return proj;
}
// Create ProjectDocument
// ..
// If this project has project dependencies, iterate over them and call this function recursively to handle them
foreach (var depLocation in @dependencies) {
// Get the dependency project tree using this function
var dep = CreateProjectAndDependencies(depLocation, projects);
// Add it to the current project's deps
proj.Dependencies.Add(dep);
} // Do this for all of this projects deps
return proj; // Return once this project tree and it's dependency tree is created
}
```
185 changes: 0 additions & 185 deletions src/DotDocs.Build/Build/BuildInstance.cs

This file was deleted.

Loading

0 comments on commit dffd39f

Please sign in to comment.