Skip to content

Conversation

@andreiborodin
Copy link
Contributor

This change makes a lot of improvements to how MSB4U solution file is generated, and more importantly what information it tries to bring forward when overwriting this file. This means, you can now modify and add items to the solution file, and have MSB4U preserve those.

This change addresses:
#86

@andreiborodin andreiborodin added enhancement New feature or request ProjectGenerator Changes related to ProjectGeneration. labels Jan 8, 2020
@andreiborodin andreiborodin added this to the 0.9.0 Release milestone Jan 8, 2020
@andreiborodin andreiborodin self-assigned this Jan 8, 2020
@@ -0,0 +1,395 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

Copy link
Contributor

@chrisfromwork chrisfromwork Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: There's a newer copyright header #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.


In reply to: 364492202 [](ancestors = 364492202)

guid = config.AssemblyCSharpFirstPassEditorGuid;
break;
default:
throw new InvalidOperationException($"Predefined assembly '{assemblyDefinitionInfo.Name}' was not recognized, this generally means it should be added to the switch statement in CSProjectInfo:GetProjectType. Treating is as a PredefinedAssembly instead of PredefinedEditorAssembly.");
Copy link
Contributor

@chrisfromwork chrisfromwork Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is [](start = 248, length = 2)

I think it is supposed to be "Treating it as a PredefinedAssembly" not "is" #Pending

Copy link
Contributor Author

@andreiborodin andreiborodin Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, however, the message is actually stale now, since I just throw. I will update the message, thanks for flagging it. #Resolved

@chrisfromwork
Copy link
Contributor

chrisfromwork commented Jan 8, 2020

    {

nit: consider moving these variables into a wrapper struct/class to decrease the number of arguments in this function call #WontFix


Refers to: Source/MSBuildTools.Unity/Packages/com.microsoft.msbuildforunity/Editor/ProjectGenerator/Scripts/Exporters/TemplatedProjectExporter.cs:56 in 283a6d5. [](commit_id = 283a6d5, deletion_comment = False)

}
}

private SortedDictionary<string, SortedSet<string>> GetSolutuonConfigurationPlatformMap(UnityProjectInfo unityProjectInfo, SolutionFileInfo solutionFileInfo)
Copy link
Contributor

@chrisfromwork chrisfromwork Jan 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetSolutuonConfigurationPlatformMap [](start = 60, length = 35)

nit: "GetSolutuonConfigurationPlatformMap" should be "GetSolutionConfigurationPlatformMap" #Resolved

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.


In reply to: 364495690 [](ancestors = 364495690)

public Dictionary<string, SolutionFileSection<SolutionProjecSectionType>> Sections { get; set; }
}

internal static class TextSolutionFileParser
Copy link
Member

@mhochk mhochk Jan 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TextSolutionFileParser [](start = 26, length = 22)

I haven't looked much in to it, but just making sure you're aware of the Microsoft functionality around solution/project parsing.

https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2013/dn763266(v=vs.121

It looks like it may have been moved to be internal-only functionality still accessible through reflection, so possibly not the best direction, but just making sure it is known about. #WontFix

Copy link
Contributor Author

@andreiborodin andreiborodin Jan 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, here is the problem, I need to reference a NuGet package for that. This presents a form of Catch 22 as this project is responsible for bringing the package in. There is a potential workaround, but we will figure that part out later.


In reply to: 364913591 [](ancestors = 364913591)

@andreiborodin andreiborodin merged commit 027d356 into master Jan 9, 2020
@andreiborodin andreiborodin deleted the features/improveSlnHandling branch January 9, 2020 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ProjectGenerator Changes related to ProjectGeneration.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants