<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<OutputType>WinExe</OutputType>
		<TargetFramework>net472</TargetFramework>
		<UseWPF>true</UseWPF>
		<Version>1.0.1</Version>
		<ApplicationIcon>favicon.ico</ApplicationIcon>
		<ApplicationManifest>app.manifest</ApplicationManifest>
	</PropertyGroup>

	<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
		<DefineConstants>$(DefineConstants);Nancy</DefineConstants>
	</PropertyGroup>
	<ItemGroup>
		<Content Include="favicon.ico" />
		<Resource Include="Assets\**" />
		<!--<Content Include="..\Configs\*" Link="%(Filename)%(Extension)">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>-->
		<Content Include="..\Configs\Config.json" Link="%(Filename)%(Extension)">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>

	</ItemGroup>


	<Choose>
		<!-- 条件加载  如果宏定义了Nancy就使用Nancy的库-->
		<When Condition="$([System.Text.RegularExpressions.Regex]::IsMatch($(DefineConstants),'^(.*;)*Nancy(;.*)*$'))">
			<ItemGroup>
				<PackageReference Include="Nancy.Hosting.Self" Version="2.0.0" />
				<PackageReference Include="ZJW.NancySwagger" Version="2.0.1" />
			</ItemGroup>
		</When>
		<!-- 否则就使用Microsoft的Owin -->
		<Otherwise>
			<ItemGroup>
				<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="9.0.9" />
				<PackageReference Include="Microsoft.AspNet.WebApi.Owin" version="5.3.0" />
				<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.3.0" />
				<PackageReference Include="Microsoft.Owin" Version="4.2.3" />
				<PackageReference Include="Microsoft.Owin.Host.SystemWeb" Version="4.2.3" />
				<PackageReference Include="Microsoft.AspNet.WebApi.OwinSelfHost" Version="5.3.0" />
				<PackageReference Include="Microsoft.AspNet.Identity.Owin" Version="2.2.4" />
				<PackageReference Include="Swashbuckle.Core" version="5.6.0" />
				<PackageReference Include="Beginor.Owin.StaticFile" Version="0.3.1" />
				<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.3.0" />
			</ItemGroup>
		</Otherwise>
	</Choose>


	<ItemGroup>
		<Reference Include="System.Windows.Forms" />
		<!-- JSON框架 -->
		<PackageReference Include="Newtonsoft.Json" Version="13.0.4" />
		<!-- 界面UI-->
		<PackageReference Include="HandyControl" Version="3.5.1" />
		<PackageReference Include="PropertyChanged.Fody" Version="4.1.0">
			<PrivateAssets>all</PrivateAssets>
			<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
		</PackageReference>
		<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />

		<!-- 生成单文件 -->
		<PackageReference Include="Costura.Fody" Version="6.0.0">
			<PrivateAssets>all</PrivateAssets>
			<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
		</PackageReference>
	</ItemGroup>

</Project>
