[Build] Fix wildcard expansion with AssemblyProcessor + PropertyGroup for environment variables (#1860)

This commit is contained in:
JeromyWalsh 2023-09-30 15:41:20 -07:00 коммит произвёл GitHub
Родитель 75bc9ac6bd
Коммит 66cf8ad09d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 45 добавлений и 16 удалений

Просмотреть файл

@ -24,6 +24,25 @@
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<!-- Add support for building this project from the Project Directory -->
<PropertyGroup>
<SolutionDir Condition="'$(SolutionDir)' == ''">$(ProjectDir)..\..\..\build\</SolutionDir>
</PropertyGroup>
<!-- ======================================================================================== -->
<!-- Item Groups -->
<!-- ======================================================================================== -->
<!-- Referenced Packages -->
<ItemGroup>
<PackageReference Include="ILRepack" Version="2.0.18" PrivateAssets="All" />
<PackageReference Include="Mono.Cecil" Version="0.11.5" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.3.2" ExcludeAssets="runtime" />
</ItemGroup>
<!-- Compiled Items -->
<ItemGroup>
<Compile Include="..\Stride.Core\DataMemberMode.cs">
<Link>Core\DataMemberMode.cs</Link>
@ -63,19 +82,25 @@
<DesignTime>True</DesignTime>
</Compile>
</ItemGroup>
<!-- Items that have no role in the build process -->
<ItemGroup>
<None Include="app.config" />
</ItemGroup>
<!-- Indicates this Project is included in Unit Test Projects -->
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<!-- Define the full set of built items for later use -->
<ItemGroup>
<PackageReference Include="ILRepack" Version="2.0.18" PrivateAssets="All" />
<PackageReference Include="Mono.Cecil" Version="0.11.5" />
<PackageReference Include="Mono.Options" Version="6.12.0.148" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="17.3.2" ExcludeAssets="runtime" />
<BuiltItems Include="$(TargetDir)*" />
</ItemGroup>
<!-- ======================================================================================== -->
<!-- Tasks & Targets -->
<!-- ======================================================================================== -->
<!-- Define a custom task for writing text to a file -->
<UsingTask
@ -97,11 +122,7 @@
</Task>
</UsingTask>
<ItemGroup>
<BuiltItems Include="$(TargetDir)*" />
</ItemGroup>
<!-- Copy the built items to the deps folder -->
<!-- Copies the built items to the deps folder -->
<Target Name="CopyFiles" AfterTargets="PostBuildEvent">
<Copy
SourceFiles="@(BuiltItems)"
@ -109,10 +130,11 @@
/>
</Target>
<!-- Packs the BuildItems into a single .Packed DLL and generates a .hash file from it -->
<Target Name="GenerateHash" AfterTargets="CopyFiles">
<!-- Repack the assemblies into a single file -->
<Exec Command="cd $(SolutionDir)..\deps\AssemblyProcessor\$(TargetFramework)
$(ILRepack) Stride.Core.AssemblyProcessor$(TargetExt) Mono.Cecil.* Mono.Options.* /out:Stride.Core.AssemblyProcessor.Packed$(TargetExt)"/>
$(ILRepack) Stride.Core.AssemblyProcessor$(TargetExt) Mono.Cecil.dll Mono.Cecil.Mdb.dll Mono.Cecil.Pdb.dll Mono.Cecil.Rocks.dll Mono.Options.dll /out:Stride.Core.AssemblyProcessor.Packed$(TargetExt)"/>
<!-- Generate the hash and then write it to disk with the .hash extension -->
<GetFileHash Files="$(SolutionDir)..\deps\AssemblyProcessor\$(TargetFramework)\Stride.Core.AssemblyProcessor.Packed$(TargetExt)">
<Output

Просмотреть файл

@ -39,6 +39,12 @@
Assembly Processor
*****************************************************************************************************************************
-->
<!-- Multi-OS Compatibility Properties -->
<PropertyGroup>
<TEMP>$([System.IO.Path]::GetTempPath())</TEMP>
</PropertyGroup>
<PropertyGroup>
<!--By default, turn on assembly processor-->
<StrideAssemblyProcessor Condition="'$(StrideAssemblyProcessor)' == ''">true</StrideAssemblyProcessor>
@ -48,13 +54,9 @@
<StrideAssemblyProcessorBasePath Condition="Exists('$(MSBuildThisFileDirectory)..\..\..\..\deps\AssemblyProcessor\$(StrideAssemblyProcessorFramework)\Stride.Core.AssemblyProcessor.Packed$(StrideAssemblyProcessorExt)')">$(MSBuildThisFileDirectory)..\..\..\..\deps\AssemblyProcessor\$(StrideAssemblyProcessorFramework)\</StrideAssemblyProcessorBasePath>
<StrideAssemblyProcessorPath>$(StrideAssemblyProcessorBasePath)Stride.Core.AssemblyProcessor.Packed$(StrideAssemblyProcessorExt)</StrideAssemblyProcessorPath>
<StrideAssemblyProcessorSerializationHashFile>$(IntermediateOutputPath)$(TargetName).sdserializationhash</StrideAssemblyProcessorSerializationHashFile>
<TempFolder>$(TEMP)</TempFolder>
<TempFolder Condition="'$(TempFolder)' == ''">$(TMPDIR)</TempFolder>
<TempFolder Condition="'$(TempFolder)' == ''">/tmp</TempFolder>
<StrideAssemblyProcessorHash>$([System.IO.File]::ReadAllText('$(StrideAssemblyProcessorPath).hash'))</StrideAssemblyProcessorHash>
<StrideAssemblyProcessorTempBasePath>$(TempFolder)\Stride\AssemblyProcessor\$(StrideAssemblyProcessorFramework)\$(StrideAssemblyProcessorHash)\</StrideAssemblyProcessorTempBasePath>
<StrideAssemblyProcessorTempBasePath>$(TEMP)\Stride\AssemblyProcessor\$(StrideAssemblyProcessorFramework)\$(StrideAssemblyProcessorHash)\</StrideAssemblyProcessorTempBasePath>
<StrideAssemblyProcessorTempPath>$(StrideAssemblyProcessorTempBasePath)Stride.Core.AssemblyProcessor.Packed$(StrideAssemblyProcessorExt)</StrideAssemblyProcessorTempPath>
</PropertyGroup>
<UsingTask TaskName="AssemblyProcessorTask" AssemblyFile="$(StrideAssemblyProcessorTempPath)" Condition=" '$(StrideAssemblyProcessorTempPath)' != '' And '$(StrideAssemblyProcessorDev)' != 'true' "/>

Просмотреть файл

@ -23,6 +23,11 @@
</ItemGroup>
</Target>
<!-- Linux Compatibility Properties -->
<PropertyGroup>
<TEMP>$([System.IO.Path]::GetTempPath())</TEMP>
</PropertyGroup>
<!-- Code Analysis -->
<PropertyGroup Condition="'$(StrideCodeAnalysis)' == 'true'">
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)Stride.ruleset</CodeAnalysisRuleSet>