Skip to content

Commit

Permalink
feat: support vbproj (#69)
Browse files Browse the repository at this point in the history
* Added support for .vbproj

* Add test method to create vb project
  • Loading branch information
ntulip-qpac committed Mar 13, 2022
1 parent 40ec712 commit 7e54235
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Versionize.Tests/ProjectsTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ public void ShouldDiscoverAllProjects()
var tempDir = TempDir.Create();
TempProject.CreateCsharpProject(Path.Join(tempDir, "project1"));
TempProject.CreateCsharpProject(Path.Join(tempDir, "project2"));
TempProject.CreateVBProject(Path.Join(tempDir, "project3"));

var projects = Projects.Discover(tempDir);
projects.GetProjectFiles().Count().ShouldBe(2);
projects.GetProjectFiles().Count().ShouldBe(3);
}

[Fact]
Expand Down
5 changes: 5 additions & 0 deletions Versionize.Tests/TestSupport/TempProject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public static string CreateCsharpProject(string tempDir, string version = "1.0.0
return Create(tempDir, "csproj", version);
}

public static string CreateVBProject(string tempDir, string version = "1.0.0")
{
return Create(tempDir, "vbproj", version);
}

public static string Create(string tempDir, string extension, string version = "1.0.0")
{
var projectFileContents =
Expand Down
2 changes: 1 addition & 1 deletion Versionize/Projects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public bool HasInconsistentVersioning()

public static Projects Discover(string workingDirectory)
{
var filters = new[] { "*.csproj", "*.fsproj" };
var filters = new[] { "*.vbproj", "*.csproj", "*.fsproj" };

var projects = filters.SelectMany(filter => Directory
.GetFiles(workingDirectory, filter, SearchOption.AllDirectories)
Expand Down
2 changes: 1 addition & 1 deletion Versionize/Versionize.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="0.27.0-preview-0175" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.0.0" />
<PackageReference Include="NuGet.Versioning" Version="6.0.0" />
<PackageReference Include="NuGet.Versioning" Version="6.1.0" />
<PackageReference Include="System.Text.Json" Version="6.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>
Expand Down

0 comments on commit 7e54235

Please sign in to comment.