-
Notifications
You must be signed in to change notification settings - Fork 32
Added Special Patching of TestRunner #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…oject. The AsmDef is referenced by Test projects that always have 'UNITY_INCLUDE_TESTS' defined, and it references nunit which also has it set. However, it itself doesn't and this breaks during generated projects player compilation as no player platform includes that define.
|
This change also has a fix for mapping of build disabled platforms in the solution file. |
| /// Another patching technique to add defines to some assembly defintion file. TestRunner for example, is only referenced by projects with UNITY_INCLUDE_TESTS and references nunit that has UNITY_INCLUDE_TESTS; | ||
| /// However it doesn't have the define itself. This breaks Player build, and as it appears that Unity specially handles this case as well. | ||
| /// </summary> | ||
| private static readonly Dictionary<string, List<string>> ImpledDefinesForAsmDefs = new Dictionary<string, List<string>>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ImpledDefinesForAsmDefs [](start = 65, length = 23)
nit: I think this is supposed to be ImpliedDefinesForAsmDefs #Resolved
| }; | ||
|
|
||
| /// <summary> | ||
| /// Another patching technique to add defines to some assembly defintion file. TestRunner for example, is only referenced by projects with UNITY_INCLUDE_TESTS and references nunit that has UNITY_INCLUDE_TESTS; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file [](start = 81, length = 4)
nit: some assembly definition file should be some assembly definition files #Resolved
| { | ||
| asmDefPair.Value.DefineConstraints.Add(define); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: It seems like this should be broken out into a CorrectConstantDefines function #Resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rename the entire function, I just think we should loop over asmdefs once.
In reply to: 366027569 [](ancestors = 366027569)
| } | ||
| } | ||
|
|
||
| List<string> availablePlatformsNames = unityProjectInfo.AvailablePlatforms.Select(t => t.Name).ToList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
availablePlatformsNames [](start = 25, length = 23)
nit: availablePlatformsNames rename to availablePlatformNames #Resolved
chrisfromwork
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()
TestRunner is a strange asmdef, so added special patching for this project. The AsmDef is referenced by Test projects that always have 'UNITY_INCLUDE_TESTS' defined, and it references nunit which also has it set. However, it itself doesn't and this breaks during generated projects player compilation as no player platform includes that define.