mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix version attributes, again
This commit is contained in:
parent
f6c395809b
commit
f0c254f8e2
1 changed files with 20 additions and 32 deletions
|
|
@ -110,11 +110,12 @@
|
|||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<Target Name="GetGitHash" BeforeTargets="WriteGitHash" Condition="'$(BuildHash)' == '' AND '$(Configuration)' == 'Release'">
|
||||
<PropertyGroup>
|
||||
<TempVerFile>$(OutputPath)TEMP_gitver.txt</TempVerFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Needed temporarily for CI -->
|
||||
<TempVerFile>$(OutputPath)TEMP_gitver.txt</TempVerFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="GetGitHash" BeforeTargets="WriteGitHash" Condition="'$(BuildHash)'=='' And '$(Configuration)'=='Release'">
|
||||
<!-- write the hash to the temp file.-->
|
||||
<Exec Command="git -C "$(ProjectDir.Replace('\','\\'))" describe --long --always --dirty" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="DalamudGitDescribeOutput" />
|
||||
|
|
@ -132,7 +133,20 @@
|
|||
<!-- Looks like this is the only way to write a file without a carriage return in msbuild... -->
|
||||
<Exec Command="echo|set /P ="$(BuildHash)" > $(TempVerFile)" IgnoreExitCode="true"/>
|
||||
</Target>
|
||||
<Target Name="WriteGitHash" BeforeTargets="CoreCompile" Condition="'$(Configuration)'=='Release'">
|
||||
|
||||
<Target Name="GetGitHashStub" BeforeTargets="WriteGitHash" Condition="'$(BuildHash)'=='' And '$(Configuration)'=='Debug'">
|
||||
<!-- Set the BuildHash property to contain some placeholder, if it wasn't already set.-->
|
||||
<PropertyGroup>
|
||||
<LocalBuildText>Local build at $([System.DateTime]::Now.ToString(yyyyMMdd-hhmmss))</LocalBuildText>
|
||||
<BuildHash>$(LocalBuildText)</BuildHash>
|
||||
<BuildHashClientStructs>???</BuildHashClientStructs>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Looks like this is the only way to write a file without a carriage return in msbuild... -->
|
||||
<Exec Command="echo|set /P ="$(BuildHash)" > $(TempVerFile)" IgnoreExitCode="true"/>
|
||||
</Target>
|
||||
|
||||
<Target Name="WriteGitHash" BeforeTargets="CoreCompile">
|
||||
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
||||
<PropertyGroup>
|
||||
<CustomAssemblyInfoFile>$(IntermediateOutputPath)CustomAssemblyInfo.cs</CustomAssemblyInfoFile>
|
||||
|
|
@ -155,30 +169,4 @@
|
|||
<!-- writes the attribute to the customAssemblyInfo file -->
|
||||
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
||||
</Target>
|
||||
|
||||
<!-- Stubbed, running git commands takes a long time and I don't want to wait every time -->
|
||||
<Target Name="WriteGitHash" BeforeTargets="CoreCompile" Condition="'$(Configuration)'=='Debug'">
|
||||
<!-- names the obj/.../CustomAssemblyInfo.cs file -->
|
||||
<PropertyGroup>
|
||||
<CustomAssemblyInfoFile>$(IntermediateOutputPath)CustomAssemblyInfo.cs</CustomAssemblyInfoFile>
|
||||
<LocalBuildText>Local build at $([System.DateTime]::Now.ToString(yyyyMMdd-hhmmss))</LocalBuildText>
|
||||
</PropertyGroup>
|
||||
<!-- includes the CustomAssemblyInfo for compilation into your project -->
|
||||
<ItemGroup>
|
||||
<Compile Include="$(CustomAssemblyInfoFile)" />
|
||||
</ItemGroup>
|
||||
<!-- defines the AssemblyMetadata attribute that will be written -->
|
||||
<ItemGroup>
|
||||
<AssemblyAttributes Include="AssemblyMetadata">
|
||||
<_Parameter1>GitHash</_Parameter1>
|
||||
<_Parameter2>$(LocalBuildText)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyMetadata">
|
||||
<_Parameter1>GitHashClientStructs</_Parameter1>
|
||||
<_Parameter2>$(LocalBuildText)</_Parameter2>
|
||||
</AssemblyAttributes>
|
||||
</ItemGroup>
|
||||
<!-- writes the attribute to the customAssemblyInfo file -->
|
||||
<WriteCodeFragment Language="C#" OutputFile="$(CustomAssemblyInfoFile)" AssemblyAttributes="@(AssemblyAttributes)" />
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue