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

	<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" />
		<ProjectReference Include="..\Admin\ThingsGateway.Photino.Blazor\ThingsGateway.Photino.Blazor.csproj" />

	</ItemGroup>


	<!--发布版-->
	<Import Project="..\ThingsGateway.Server\targets\Gateway.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayRelease' " />
	<Import Project="..\ThingsGateway.Server\targets\Admin.targets" Condition=" '$(SolutionName)' == 'ThingsGatewayRelease' " />
	
	<ItemGroup Condition=" '$(SolutionName)' == 'ThingsGatewayRelease' ">
		<PackageReference Include="ThingsGateway.Photino.Blazor" Version="$(Version)" />
	</ItemGroup>


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

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

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



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

	<!--打包复制-->
	<Import Project="..\ThingsGateway.Server\targets\PluginPublish.targets" />
	<PropertyGroup>
		<TargetFrameworks>net8.0;net9.0;</TargetFrameworks>
		<CustomTargetFramework>$(TargetFramework)</CustomTargetFramework>
		<OutputType>WinExe</OutputType>
		<OpenApiGenerateDocuments>false</OpenApiGenerateDocuments>
		<SatelliteResourceLanguages>zh-Hans;en-US</SatelliteResourceLanguages>
		<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
		<ApplicationIcon>favicon.ico</ApplicationIcon>
		<!--<PublishAot>true</PublishAot>-->
		<CETCompat>false</CETCompat>

		<!--动态适用GC-->
		<GarbageCollectionAdaptationMode>1</GarbageCollectionAdaptationMode>
		<!--使用工作站GC-->
		<!--<ServerGarbageCollection>true</ServerGarbageCollection>-->
		<!--<PlatformTarget>x86</PlatformTarget>-->
	</PropertyGroup>

	<ItemGroup>
		<FrameworkReference Include="Microsoft.AspNetCore.App" />
	</ItemGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Data.Sqlite" Version="$(NET9Version)" />
	</ItemGroup>

	<ItemGroup>
		<Content Include="..\ThingsGateway.Server\Index\GatewayIndex.razor" Link="Index\GatewayIndex.razor" />
		<Compile Include="..\ThingsGateway.Server\Index\GatewayIndex.razor.cs" Link="Index\GatewayIndex.razor.cs" />
		<Content Include="..\ThingsGateway.Server\Layout\MainLayout.razor" Link="Layout\MainLayout.razor" />
		<Compile Include="..\ThingsGateway.Server\Layout\MainLayout.razor.cs" Link="Layout\MainLayout.razor.cs" />
		<Content Include="..\ThingsGateway.Server\Layout\MainLayout.razor.css" Link="Layout\MainLayout.razor.css" />
		<Content Include="..\ThingsGateway.Server\Layout\AccessDenied.razor" Link="Layout\AccessDenied.razor" />
		<Compile Include="..\ThingsGateway.Server\Layout\AccessDenied.razor.cs" Link="Layout\AccessDenied.razor.cs" />
		<Content Include="..\ThingsGateway.Server\Layout\Login.razor" Link="Layout\Login.razor" />
		<Compile Include="..\ThingsGateway.Server\Layout\Login.razor.cs" Link="Layout\Login.razor.cs" />
		<Content Include="..\ThingsGateway.Server\Layout\Login.razor.css" Link="Layout\Login.razor.css" />
		<Content Include="..\ThingsGateway.Server\Layout\NotFound404.razor" Link="Layout\NotFound404.razor" />
		<Compile Include="..\ThingsGateway.Server\Layout\NotFound404.razor.cs" Link="Layout\NotFound404.razor.cs" />
		<Content Include="..\ThingsGateway.Server\Index\GatewayIndexComponent.razor" Link="Index\GatewayIndexComponent.razor" />
		<Compile Include="..\ThingsGateway.Server\Index\GatewayIndexComponent.razor.cs" Link="Index\GatewayIndexComponent.razor.cs" />

		<Compile Include="..\ThingsGateway.Server\Program\SingleFilePublish.cs" Link="Program\SingleFilePublish.cs" />


		<Content Include="..\ThingsGateway.Server\ThingsGateway.pfx" Link="ThingsGateway.pfx">
		  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>


		<Content Include="..\ThingsGateway.Server\wwwroot\favicon.ico" Link="wwwroot\favicon.ico" />
		<Content Include="..\ThingsGateway.Server\wwwroot\favicon.png" Link="wwwroot\favicon.png" />
		<Content Include="..\ThingsGateway.Server\appsettings.Development.json" Link="appsettings.Development.json">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>
		<Content Include="..\ThingsGateway.Server\appsettings.json" Link="appsettings.json">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>

		<Content Include="..\ThingsGateway.Server\Configuration\*" LinkBase="Configuration">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>

		<EmbeddedResource Include="..\ThingsGateway.Server\Locales\en-US.json" Link="Locales\en-US.json" />
		<EmbeddedResource Include="..\ThingsGateway.Server\Locales\zh-CN.json" Link="Locales\zh-CN.json" />


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


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


	<ItemGroup>
	  <Content Remove="launchSettings.json" />
	</ItemGroup>

	<ItemGroup>
		<Content Include="favicon.ico">
			<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
		</Content>
	</ItemGroup>

	<ItemGroup>
	  <None Include="Properties\launchSettings.json">
	    <ExcludeFromSingleFile>true</ExcludeFromSingleFile>
	    <CopyToPublishDirectory>Never</CopyToPublishDirectory>
	  </None>
	</ItemGroup>


</Project>
