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

	<Import Project="..\Version.props" />


	<ItemGroup Condition=" '$(SolutionName)' != 'ThingsGatewayRelease'">
		<ProjectReference Include="..\Gateway\ThingsGateway.Gateway.Application\ThingsGateway.Gateway.Application.csproj" />
		<ProjectReference Include="..\Gateway\ThingsGateway.Gateway.Razor\ThingsGateway.Gateway.Razor.csproj" />
	</ItemGroup>


	<!--发布版-->
	<Import Project="targets\Gateway.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayRelease' " />
	<Import Project="targets\Admin.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayRelease' " />

	<Import Project="targets\PluginContext.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND  '$(Configuration)' != 'Debug' " />

	<!--nuget包解压复制文件，上下文动态加载-->
	<Import Project="targets\PluginContext.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro' AND  '$(Configuration)' != 'Debug' " />
	<!--直接引用-->
	<Import Project="targets\PluginDebug.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro' AND '$(Configuration)' == 'Debug' " />

	<!--nuget包解压复制文件，插件域隔离动态加载-->
	<!--<Import Project="targets\Plugin.targets" />-->

	<!--nuget包解压复制文件，上下文动态加载，Pro插件-->
	<Import Project="targets\Pro2.targets" Condition=" '$(SolutionName)' != 'ThingsGatewayPro' OR  '$(Configuration)' != 'Debug'" />

	<!--直接引用Pro-->
	<Import Project="targets\PluginDebug.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND '$(Configuration)' == 'Debug'" />


	<Import Project="targets\ProPluginDebug.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND '$(Configuration)' == 'Debug'" />

	<!--<Import Project="targets\Pro3.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' " />
	<Import Project="targets\Pro5.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' " />-->
	<!--<Import Project="targets\Pro6.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND '$(Configuration)' != 'Debug'" />-->
	<Import Project="targets\Pro7.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayPro' AND '$(Configuration)' != 'Debug'" />

	<!--打包复制-->
	<Import Project="targets\PluginPublish.targets" />
	<PropertyGroup>

		<GenerateDocumentationFile>false</GenerateDocumentationFile>

		<TargetFrameworks>net8.0;net9.0;</TargetFrameworks>
		<CustomTargetFramework>$(TargetFramework)</CustomTargetFramework>
		<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>
		<SatelliteResourceLanguages>zh-Hans;en-US</SatelliteResourceLanguages>
		<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
		<ApplicationIcon>favicon.ico</ApplicationIcon>

		<!--动态适用GC-->
		<GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>


		<CETCompat>false</CETCompat>




		<!--<TieredCompilation>false</TieredCompilation>-->

		<!--使用自托管线程池-->
		<!--<UseWindowsThreadPool>false</UseWindowsThreadPool> -->

		<!--使用工作站GC-->
		<!--<ServerGarbageCollection>true</ServerGarbageCollection>-->

		<!--<PlatformTarget>x86</PlatformTarget>-->
	</PropertyGroup>



	<ItemGroup>
		<Content Update="wwwroot\**">
			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
		</Content>
	</ItemGroup>


	<ItemGroup>
		<Content Remove="Locales\*.json" />
		<EmbeddedResource Include="Locales\*.json">
			<CopyToOutputDirectory>Never</CopyToOutputDirectory>
		</EmbeddedResource>
	</ItemGroup>


	<ItemGroup>
		<None Include="Layout\BlazorApp.razor" />
		<None Include="Layout\BlazorAppNet8.razor" />
	</ItemGroup>


	<!--安装服务守护-->
	<ItemGroup Condition=" '$(TargetFramework)' == 'net8.0' ">

		<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="8.0.1" />
		<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="8.0.1" />
		<Content Remove="Layout\BlazorApp.razor" />
		<Content Update="Layout\BlazorAppNet8.razor" />
	</ItemGroup>
	<ItemGroup Condition=" '$(TargetFramework)' == 'net9.0' ">
		<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="$(NET9Version)" />
		<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="$(NET9Version)" />
		<Content Remove="Layout\BlazorAppNet8.razor" />
		<Content Update="Layout\BlazorApp.razor" />
	</ItemGroup>


	<ItemGroup>
		<Content Include="favicon.ico">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>
		<None Update="ThingsGateway.pfx">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="WindowsService">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="Dockerfile">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="Dockerfile_arm64">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>

		<None Update="pm2-windows.json">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="pm2-linux.json">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="thingsgateway.service">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="WindowsWebDisable.bat">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="WindowsServiceCreate.bat">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>
		<None Update="WindowsServiceDelete.bat">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</None>

	</ItemGroup>




	<ItemGroup>
		<Content Include="DockerPush.ps1">
			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
		</Content>
		<Content Include="DockerPush_arm64.ps1">
			<CopyToOutputDirectory>Always</CopyToOutputDirectory>
		</Content>
	</ItemGroup>



</Project>
