Skip to content

Commit 8437e5b

Browse files
Merge pull request #93 from petabridge/dev
v0.2.1 Release
2 parents 417390b + bb66167 commit 8437e5b

File tree

5 files changed

+19
-27
lines changed

5 files changed

+19
-27
lines changed

RELEASE_NOTES.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
#### 0.2.0 October 28 2019 ####
2-
Feature release: Incrementalist v0.2.0
1+
#### 0.2.1 November 18 2019 ####
2+
Maintenance release: Incrementalist v0.2.1
33

4-
* [Added .NET Core 3.0 global tool support](https://github.com/petabridge/Incrementalist/issues/70)
5-
* [Added F# project support](https://github.com/petabridge/Incrementalist/issues/69)
6-
* [Bugfix: Need to be able to detect changes in `.props` files referenced by projects](https://github.com/petabridge/Incrementalist/issues/68)
7-
* [Added configurable timeout to commandline options](https://github.com/petabridge/Incrementalist/pull/86)
4+
* [Fixed: NRE during Incrementalist.ProjectSystem.Cmds.FilterAffectedProjectFilesCmd](https://github.com/petabridge/Incrementalist/issues/70)

src/Incrementalist.Tests/Dependencies/ProjectImportsTrackingSpecs.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Collections.Immutable;
34
using System.IO;
45
using System.Linq;
56
using System.Threading;
@@ -45,7 +46,7 @@ public void ImportedFilePathIsFound()
4546
var projectFile = new SlnFileWithPath(projectFilePath, new SlnFile(FileType.Project, ProjectId.CreateNewId())) ;
4647
var imports = ProjectImportsFinder.FindProjectImports(new[] { projectFile });
4748

48-
imports.Values.Should().BeEquivalentTo(new ImportedFile(importedPropsFilePath, new[] { projectFile }.ToList()));
49+
imports.Values.Should().BeEquivalentTo(new ImportedFile(importedPropsFilePath, new[] { projectFile }.ToImmutableList()));
4950
}
5051

5152
[Fact(DisplayName = "When project imported file is changed, the project should be marked as affected")]

src/Incrementalist/ProjectSystem/Cmds/FilterAffectedProjectFilesCmd.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ protected override async Task<Dictionary<string, SlnFile>> ProcessImpl(
9292
if (projectImports.ContainsKey(file))
9393
{
9494
// Mark all dependant as affected
95-
projectImports[file].DependantProjects.ForEach(dependentProject => newDict[dependentProject.Path] = dependentProject.File);
95+
foreach (var dependentProject in projectImports[file].DependantProjects)
96+
{
97+
newDict[dependentProject.Path] = dependentProject.File;
98+
}
9699
}
97100
}
98101

src/Incrementalist/ProjectSystem/ProjectImportsFinder.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public SlnFileWithPath(string path, SlnFile file)
2323

2424
public sealed class ImportedFile
2525
{
26-
public ImportedFile(string path, List<SlnFileWithPath> dependantProjects)
26+
public ImportedFile(string path, IImmutableList<SlnFileWithPath> dependantProjects)
2727
{
2828
DependantProjects = dependantProjects;
2929
Path = path;
@@ -32,7 +32,7 @@ public ImportedFile(string path, List<SlnFileWithPath> dependantProjects)
3232
/// <summary>
3333
/// List of project files that are importing this file
3434
/// </summary>
35-
public List<SlnFileWithPath> DependantProjects { get; }
35+
public IImmutableList<SlnFileWithPath> DependantProjects { get; }
3636
/// <summary>
3737
/// File path
3838
/// </summary>
@@ -51,7 +51,7 @@ public static class ProjectImportsFinder
5151
/// <returns>Doctionary of imported files with their paths</returns>
5252
public static Dictionary<string, ImportedFile> FindProjectImports(IEnumerable<SlnFileWithPath> projectFiles)
5353
{
54-
var imports = new ConcurrentDictionary<string, HashSet<SlnFileWithPath>>();
54+
var imports = new ConcurrentDictionary<string, IImmutableList<SlnFileWithPath>>();
5555

5656
Parallel.ForEach(projectFiles, projectFile =>
5757
{
@@ -71,19 +71,13 @@ public static Dictionary<string, ImportedFile> FindProjectImports(IEnumerable<Sl
7171
continue;
7272

7373
var importedFileFillPath = Path.GetFullPath(Path.Combine(projectDir, importedFilePath));
74-
var dependentProjectId = projectFile.File.ProjectId;
75-
7674
imports.AddOrUpdate(importedFileFillPath,
77-
addValue: new HashSet<SlnFileWithPath>() { projectFile },
78-
updateValueFactory: (_, dependentProjects) =>
79-
{
80-
dependentProjects.Add(projectFile);
81-
return dependentProjects;
82-
});
75+
addValue: ImmutableList<SlnFileWithPath>.Empty.Add(projectFile),
76+
updateValueFactory: (_, dependentProjects) => dependentProjects.Add(projectFile));
8377
}
8478
});
8579

86-
return imports.ToDictionary(pair => pair.Key, pair => new ImportedFile(pair.Key, pair.Value.ToList()));
80+
return imports.ToDictionary(pair => pair.Key, pair => new ImportedFile(pair.Key, pair.Value));
8781
}
8882

8983
private static XmlDocument ParseXmlDocument(string projectFilePath)

src/common.props

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
<PropertyGroup>
33
<Copyright>Copyright © 2015-2019 Petabridge</Copyright>
44
<Authors>Petabridge</Authors>
5-
<VersionPrefix>0.2.0</VersionPrefix>
6-
<PackageReleaseNotes>Feature release: Incrementalist v0.2.0
7-
[Added .NET Core 3.0 global tool support](https://github.com/petabridge/Incrementalist/issues/70)
8-
[Added F# project support](https://github.com/petabridge/Incrementalist/issues/69)
9-
[Bugfix: Need to be able to detect changes in `.props` files referenced by projects](https://github.com/petabridge/Incrementalist/issues/68)
10-
[Added configurable timeout to commandline options](https://github.com/petabridge/Incrementalist/pull/86)</PackageReleaseNotes>
5+
<VersionPrefix>0.2.1</VersionPrefix>
6+
<PackageReleaseNotes>Maintenance release: Incrementalist v0.2.1
7+
[Fixed: NRE during Incrementalist.ProjectSystem.Cmds.FilterAffectedProjectFilesCmd](https://github.com/petabridge/Incrementalist/issues/70)</PackageReleaseNotes>
118
<tags>build, msbuild, incremental build, roslyn, git</tags>
129
<PackageIconUrl>
1310
https://petabridge.com/images/logo.png
@@ -224,7 +221,7 @@
224221
<PropertyGroup>
225222
<NBenchVersion>1.2.2</NBenchVersion>
226223
<XunitVersion>2.4.1</XunitVersion>
227-
<TestSdkVersion>16.3.0</TestSdkVersion>
224+
<TestSdkVersion>16.4.0</TestSdkVersion>
228225
<RoslynVersion>3.3.1</RoslynVersion>
229226
</PropertyGroup>
230227
</Project>

0 commit comments

Comments
 (0)