Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Workaround issue in solution targets in MSBuild RC3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate McMaster committed Jan 20, 2017
1 parent 8d94d91 commit 7f7413b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions graph.proj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- workaround https://github.com/Microsoft/msbuild/issues/1587 -->
<Project>
<ItemGroup>
<RestoreGraphProjectInputItems Include="$(RepoDir)\**\*.csproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\NuGet.targets" />
</Project>
14 changes: 11 additions & 3 deletions makefile.shade
Original file line number Diff line number Diff line change
Expand Up @@ -918,9 +918,15 @@ functions
{
public static MsBuildSolutionInfo LoadFromFile(string file)
{
var info = new MsBuildSolutionInfo()
if (!Path.IsPathRooted(file))
{
FilePath = file
file = Path.Combine(System.IO.Directory.GetCurrentDirectory(), file);
}

var info = new MsBuildSolutionInfo
{
FilePath = file,
Directory = Path.GetDirectoryName(file)
};

var lines = File.ReadAllLines(file);
Expand All @@ -942,6 +948,7 @@ functions
}

public string FilePath { get; private set; }
public string Directory { get; private set; }

public Version VisualStudioVersion { get; set; }

Expand Down Expand Up @@ -1054,7 +1061,8 @@ functions
{
UseShellExecute = false,
FileName = "dotnet",
Arguments = "msbuild \"" + solution.FilePath + "\" /nologo /t:GenerateRestoreGraphFile \"/p:RestoreGraphOutputPath=" + dgJson + "\""
// TODO revert to invoking on .sln file when https://github.com/Microsoft/msbuild/issues/1587 is resolve
Arguments = "msbuild \"" + Path.Combine(Directory.GetCurrentDirectory(), "graph.proj") + "\" /v:q /p:WarningLevel=0 /p:RepoDir=\"" + solution.Directory + "\" /nologo /t:GenerateRestoreGraphFile \"/p:RestoreGraphOutputPath=" + dgJson + "\""
};
var p = Process.Start(psi);
p.WaitForExit();
Expand Down

0 comments on commit 7f7413b

Please sign in to comment.