Skip to content

Commit c519095

Browse files
committed
relocated DefineConstants in csproj
1 parent 45af97c commit c519095

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

Assets/Tests/InputSystem/DocumentationBasedAPIVerficationTests.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,15 @@ public void OneTimeSetup()
6565
csprojContent.AppendLine("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
6666
csprojContent.AppendLine("<Project ToolsVersion=\"4.0\" DefaultTargets=\"Build\" " +
6767
"xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">");
68+
// DefineConstants must be in an unconditional PropertyGroup so DocFX reads them
69+
// regardless of whether MSBuild's Platform property is set.
70+
csprojContent.AppendLine(" <PropertyGroup>");
71+
csprojContent.AppendLine($" <DefineConstants>{string.Join(";", asm.defines)}</DefineConstants>");
72+
csprojContent.AppendLine(" </PropertyGroup>");
6873
csprojContent.AppendLine(" <PropertyGroup Condition=\" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' \">");
6974
csprojContent.AppendLine($" <AssemblyName>{asm.name}</AssemblyName>");
7075
csprojContent.AppendLine(" <TargetFrameworkVersion>v4.7.1</TargetFrameworkVersion>");
7176
csprojContent.AppendLine(" <OutputType>Library</OutputType>");
72-
csprojContent.AppendLine($" <DefineConstants>{string.Join(";", asm.defines)}</DefineConstants>");
7377
csprojContent.AppendLine(" <AllowUnsafeBlocks>True</AllowUnsafeBlocks>");
7478
csprojContent.AppendLine(" <LangVersion>9.0</LangVersion>");
7579
csprojContent.AppendLine(" <NoConfig>true</NoConfig>");

0 commit comments

Comments
 (0)