greenshot/Greenshot/Greenshot.csproj

91 lines
3.7 KiB
XML

<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<PropertyGroup>
<RootNamespace>Greenshot</RootNamespace>
<AssemblyName>Greenshot</AssemblyName>
<OutputType>WinExe</OutputType>
<ApplicationIcon>icons\applicationIcon\icon.ico</ApplicationIcon>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<ApplicationManifest>greenshot.manifest</ApplicationManifest>
<EmbeddedResourceUseDependentUponConvention>false</EmbeddedResourceUseDependentUponConvention>
<EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems>
</PropertyGroup>
<ItemGroup>
<None Include="Languages\language*.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Tools.InnoSetup" version="6.1.2" GeneratePathProperty="true" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Forms\ColorDialog.resx">
<DependentUpon>ColorDialog.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\ImageEditorForm.resx">
<DependentUpon>ImageEditorForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\MainForm.resx">
<DependentUpon>MainForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\SettingsForm.resx">
<DependentUpon>SettingsForm.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Sounds.resx" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GreenshotPlugin\GreenshotPlugin.csproj" />
<FilesToHash Include="$(SolutionDir)$(SolutionName)\$(OutDir)\*" />
</ItemGroup>
<ItemGroup>
<None Update="log4net.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<PackageReference Update="MSBuildTasks" Version="1.5.0.235">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<UsingTask TaskName="SetEnvironmentVariableTask" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Name ParameterType="System.String" Required="true" />
<Value ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Code Type="Fragment" Language="cs">
<![CDATA[
Environment.SetEnvironmentVariable(Name, Value);
]]>
</Code>
</Task>
</UsingTask>
<Target Name="Generate hashes" BeforeTargets="PostBuildEvent">
<GetFileHash Files="@(FilesToHash)" Algorithm="SHA256" HashEncoding="hex">
<Output TaskParameter="Items" ItemName="FilesWithHashes" />
</GetFileHash>
<WriteLinesToFile File="$(SolutionDir)$(SolutionName)\$(OutDir)\checksum.SHA256" Lines="@(FilesWithHashes->'%(Filename)%(Extension): %(FileHash)')" Overwrite="true" WriteOnlyWhenDifferent="true" />
</Target>
<Target Name="PostBuild" BeforeTargets="PostBuildEvent" Condition="'$(Configuration)' == 'Release'">
<SetEnvironmentVariableTask Name="BuildVersionSimple" Value="$(BuildVersionSimple)" />
<SetEnvironmentVariableTask Name="AssemblyInformationalVersion" Value="$(AssemblyInformationalVersion)" />
<Exec Command="$(PkgTools_InnoSetup)\tools\ISCC.exe $(SolutionDir)\greenshot\releases\innosetup\setup.iss" />
</Target>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<PostBuildEvent>
copy "$(SolutionDir)Greenshot\log4net-debug.xml" "$(SolutionDir)Greenshot\bin\$(Configuration)\net472\log4net.xml"
</PostBuildEvent>
</PropertyGroup>
</Project>