<Project>

<!--Admin-->

  <ItemGroup>
    <PackageReference Include="ThingsGateway.Admin.Razor" Version="$(Version)" />
    <PackageReference Include="ThingsGateway.Admin.Application" Version="$(Version)" GeneratePathProperty="true"/>
  </ItemGroup>
  
  <Target Name="_ResolveCopyAdminLocalNuGetPkgXmls" AfterTargets="ResolveReferences">
    <ItemGroup>
      <ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths->'%(RootDir)%(Directory)%(Filename).xml')" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)'=='ThingsGateway.Admin.Application' and Exists('%(RootDir)%(Directory)%(Filename).xml')" />
    </ItemGroup>
  </Target>
  
  <Target Name="CopyAdminNugetPackages" AfterTargets="Build">
    <ItemGroup>
      <!-- setting up the variable for convenience -->
      <AdminApplicationPackageFiles Include="$(PkgThingsGateway_Admin_Application)\Content\SeedData\Admin\*.*" />
    </ItemGroup>
    <PropertyGroup>
      <AdminApplicationFolder>$(TargetDir)SeedData\Admin\</AdminApplicationFolder>
    </PropertyGroup>
    <RemoveDir Directories="$(AdminApplicationFolder)" />
    <Copy SourceFiles="@(AdminApplicationPackageFiles)" DestinationFolder="$(AdminApplicationFolder)%(RecursiveDir)" />

  </Target>
  
  <Target Name="AdminPostPublish" AfterTargets="Publish">
    <ItemGroup>
      <!-- setting up the variable for convenience -->
      <AdminFiles Include="$(OutputPath)\$(TargetFramework)\SeedData\**" />
    </ItemGroup>
    <PropertyGroup>
    </PropertyGroup>
    <Copy SourceFiles="@(AdminFiles)" DestinationFolder="$(PublishDir)SeedData\%(RecursiveDir)" />

  </Target>

  <!--Admin-->

  
</Project>
