<Project>


	<Target Name="CopyNugetPackages" AfterTargets="Build">
		<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
			<ApplicationPackageFiles Include="$(PkgConfluent_Kafka)\lib\net6.0\*.*" />
		</ItemGroup>
		<ItemGroup Condition="'$(TargetFramework)' != 'net6.0'">
			<ApplicationPackageFiles Include="$(PkgConfluent_Kafka)\lib\net8.0\*.*" />
		</ItemGroup>
		<PropertyGroup>
			<ApplicationFolder>$(TargetDir)</ApplicationFolder>
		</PropertyGroup>
		<Copy SourceFiles="@(ApplicationPackageFiles)" DestinationFolder="$(ApplicationFolder)%(RecursiveDir)" />
	</Target>

	<!--在构建后触发的。它通过在 Nuget 包的 Content 文件夹中包含目标目录中的所有文件和子文件夹来创建 nuget 包-->
	<Target Name="IncludeAllFilesInTargetDir" AfterTargets="Build">
		<ItemGroup>
			<Content Include="$(ProjectDir)$(OutputPath)\$(TargetFramework)\**\*Kafka*.dll">
				<Pack>true</Pack>
				<PackagePath>Content</PackagePath>
			</Content>
		</ItemGroup>
	</Target>

</Project>
