Skip to content
Permalink
Browse files

[Build] Make sure Package.Id stays is in sync with .sln one

  • Loading branch information
xen2 committed Sep 18, 2018
1 parent 68702d5 commit 0b5ba025c753847d31180f8d1e9307c3a9fcbca0
@@ -768,7 +768,7 @@ public static PackageContainer LoadProject(ILogger log, string filePath)
var projectPath = filePath;
var packagePath = Path.ChangeExtension(filePath, Package.PackageFileExtension);
var package = LoadRaw(log, packagePath);
return new SolutionProject(package, package.Id, projectPath);
return new SolutionProject(package, projectPath);
}
else
{
@@ -779,7 +779,7 @@ public static PackageContainer LoadProject(ILogger log, string filePath)
var projectPath = Path.ChangeExtension(package.FullPath, ".csproj");
if (File.Exists(projectPath))
{
return new SolutionProject(package, package.Id, projectPath);
return new SolutionProject(package, projectPath);
}
else
{
@@ -124,16 +124,16 @@ public class SolutionProject : PackageContainer
private PackageSession session;
private readonly Package package;

public SolutionProject([NotNull] Package package, Guid guid, string fullPath)
public SolutionProject([NotNull] Package package, string fullPath)
: base(package)
{
VSProject = new VisualStudio.Project(guid, VisualStudio.KnownProjectTypeGuid.CSharp, Path.GetFileNameWithoutExtension(fullPath), fullPath, Guid.Empty,
VSProject = new VisualStudio.Project(package.Id, VisualStudio.KnownProjectTypeGuid.CSharp, Path.GetFileNameWithoutExtension(fullPath), fullPath, Guid.Empty,
Enumerable.Empty<VisualStudio.Section>(),
Enumerable.Empty<VisualStudio.PropertyItem>(),
Enumerable.Empty<VisualStudio.PropertyItem>());
}

public SolutionProject(Package package, VisualStudio.Project vsProject)
public SolutionProject([NotNull] Package package, VisualStudio.Project vsProject)
: base(package)
{
VSProject = vsProject;
@@ -555,6 +555,7 @@ public static void Load(string filePath, PackageSessionResult sessionResult, Pac
{
var project = (SolutionProject)session.LoadProject(sessionResult, vsProject.FullPath, false, loadParameters);
project.VSProject = vsProject;
project.Package.Id = vsProject.Guid;
session.Projects.Add(project);

if (firstProject == null)
@@ -221,7 +221,7 @@ public static SolutionProject GenerateTemplate(TemplateGeneratorParameters param
var projectTemplate = PrepareTemplate(parameters, package, templateRelativePath, platformType, graphicsPlatform, projectType);
projectTemplate.Generate(outputDirectoryPath, projectName, projectGuid, parameters.Logger, options, generatedFiles);

var project = new SolutionProject(package, projectGuid, projectFullPath);
var project = new SolutionProject(package, projectFullPath);

return project;
}

0 comments on commit 0b5ba02

Please sign in to comment.
You can’t perform that action at this time.