This repository has been archived by the owner on Apr 2, 2020. It is now read-only.
forked from Protobuild/Protobuild
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Duplicate package references in the module hierarchy are now unified
Protobuild will now unify working copies of packages inside the module hierarchy. This means that if a parent module depends on a package, and a submodule depends on the same package, only one instance of that package will reside in the directory tree, and both modules will refer to the same copy. This works for any tree of modules / submodules, including submodules nested multiple times.
- Loading branch information
Showing
343 changed files
with
1,214 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"unit.engine": "XUnit2TestEngine", | ||
"unit.csharp.xunit.binary": "xunit/src/xunit.console/bin/Linux/AnyCPU/Release/xunit.console.exe", | ||
"unit.csharp.discovery": { | ||
"(.*?)\\.cs": [ | ||
[ "Protobuild.UnitTests/Protobuild.UnitTests.Linux.csproj", "Protobuild.UnitTests/bin/Linux/AnyCPU/Debug/Protobuild.UnitTests.dll" ], | ||
[ "Protobuild.UnitTests/Protobuild.UnitTests.Windows.csproj", "Protobuild.UnitTests/bin/Windows/AnyCPU/Debug/Protobuild.UnitTests.dll" ], | ||
[ "Protobuild.FunctionalTests/Protobuild.FunctionalTests.Linux.csproj", "Protobuild.FunctionalTests/bin/Linux/AnyCPU/Debug/Protobuild.FunctionalTests.dll" ], | ||
[ "Protobuild.FunctionalTests/Protobuild.FunctionalTests.Windows.csproj", "Protobuild.FunctionalTests/bin/Windows/AnyCPU/Debug/Protobuild.FunctionalTests.dll" ] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Name="Protobuild.UnitTests" Path="Protobuild.UnitTests" Type="Library"> | ||
<Properties> | ||
<FrameworkVersions> | ||
<Platform Name="Windows"> | ||
<Version>v4.5</Version> | ||
</Platform> | ||
<Platform Name="MacOS"> | ||
<Version>v4.5</Version> | ||
</Platform> | ||
<Platform Name="Linux"> | ||
<Version>v4.5</Version> | ||
</Platform> | ||
</FrameworkVersions> | ||
</Properties> | ||
<References> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="Protobuild.Internal" /> | ||
<Reference Include="xunit" /> | ||
</References> | ||
<Files> | ||
<Compile Include="PathUtilsTests.cs" /> | ||
</Files> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
39 changes: 39 additions & 0 deletions
39
Protobuild.FunctionalTests/PackageLocationParentAndSubmoduleSamePackageTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
namespace Protobuild.Tests | ||
{ | ||
using System.IO; | ||
using Xunit; | ||
|
||
public class PackageLocationParentAndSubmoduleSamePackageTest : ProtobuildTest | ||
{ | ||
[Fact] | ||
public void GenerationIsCorrect() | ||
{ | ||
this.SetupTest("PackageLocationParentAndSubmoduleSamePackage"); | ||
|
||
var src = this.SetupSrcPackage(); | ||
|
||
// Make sure the Package directory is removed so we have a clean test every time. | ||
if (Directory.Exists(this.GetPath("Package"))) | ||
{ | ||
Directory.Delete(this.GetPath("Package"), true); | ||
} | ||
|
||
this.Generate(args: "--redirect http://protobuild.org/hach-que/TestEmptyPackage local-git://" + src); | ||
|
||
Assert.True(File.Exists(this.GetPath("Package\\PackageLibrary\\PackageLibrary.Windows.csproj"))); | ||
Assert.True(File.Exists(this.GetPath("Submodule\\Package\\.redirect"))); | ||
Assert.True(File.Exists(this.GetPath("Submodule\\Library\\Library.Windows.csproj"))); | ||
Assert.True(File.Exists(this.GetPath("Console\\Console.Windows.csproj"))); | ||
|
||
var consoleContents = this.ReadFile("Console\\Console.Windows.csproj"); | ||
var libraryContents = this.ReadFile("Submodule\\Library\\Library.Windows.csproj"); | ||
|
||
Assert.Contains( | ||
@"Include=""..\Package\PackageLibrary\PackageLibrary.Windows.csproj""", | ||
consoleContents); | ||
Assert.Contains( | ||
@"Include=""..\..\Package\PackageLibrary\PackageLibrary.Windows.csproj""", | ||
libraryContents); | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
Protobuild.FunctionalTests/PackageLocationParentAndTwoSubmoduleSamePackageTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
namespace Protobuild.Tests | ||
{ | ||
using System.IO; | ||
using Xunit; | ||
|
||
public class PackageLocationParentAndTwoSubmoduleSamePackageTest : ProtobuildTest | ||
{ | ||
[Fact] | ||
public void GenerationIsCorrect() | ||
{ | ||
this.SetupTest("PackageLocationParentAndTwoSubmoduleSamePackage"); | ||
|
||
var src = this.SetupSrcPackage(); | ||
|
||
// Make sure the Package directory is removed so we have a clean test every time. | ||
if (Directory.Exists(this.GetPath("Package"))) | ||
{ | ||
Directory.Delete(this.GetPath("Package"), true); | ||
} | ||
if (Directory.Exists(this.GetPath("SubmoduleA\\Package"))) | ||
{ | ||
Directory.Delete(this.GetPath("SubmoduleA\\Package"), true); | ||
} | ||
if (Directory.Exists(this.GetPath("SubmoduleB\\Package"))) | ||
{ | ||
Directory.Delete(this.GetPath("SubmoduleB\\Package"), true); | ||
} | ||
|
||
this.Generate(args: "--redirect http://protobuild.org/hach-que/TestEmptyPackage local-git://" + src); | ||
|
||
Assert.True(File.Exists(this.GetPath("Package\\PackageLibrary\\PackageLibrary.Windows.csproj"))); | ||
Assert.False(File.Exists(this.GetPath("SubmoduleA\\Package\\PackageLibrary\\PackageLibrary.Windows.csproj"))); | ||
Assert.False(File.Exists(this.GetPath("SubmoduleB\\Package\\PackageLibrary\\PackageLibrary.Windows.csproj"))); | ||
Assert.True(File.Exists(this.GetPath("SubmoduleA\\Package\\.redirect"))); | ||
Assert.True(File.Exists(this.GetPath("SubmoduleB\\Package\\.redirect"))); | ||
Assert.True(File.Exists(this.GetPath("SubmoduleA\\LibraryA\\LibraryA.Windows.csproj"))); | ||
Assert.True(File.Exists(this.GetPath("SubmoduleB\\LibraryB\\LibraryB.Windows.csproj"))); | ||
|
||
var consoleContents = this.ReadFile("Console\\Console.Windows.csproj"); | ||
var libraryAContents = this.ReadFile("SubmoduleA\\LibraryA\\LibraryA.Windows.csproj"); | ||
var libraryBContents = this.ReadFile("SubmoduleB\\LibraryB\\LibraryB.Windows.csproj"); | ||
|
||
Assert.Contains( | ||
@"Include=""..\Package\PackageLibrary\PackageLibrary.Windows.csproj""", | ||
consoleContents); | ||
Assert.Contains( | ||
@"Include=""..\..\Package\PackageLibrary\PackageLibrary.Windows.csproj""", | ||
libraryAContents); | ||
Assert.Contains( | ||
@"Include=""..\..\Package\PackageLibrary\PackageLibrary.Windows.csproj""", | ||
libraryBContents); | ||
} | ||
} | ||
} |
Oops, something went wrong.