-
-
Notifications
You must be signed in to change notification settings - Fork 278
Expand file tree
/
Copy pathDSInternals.PowerShell.csproj
More file actions
117 lines (110 loc) · 9.78 KB
/
DSInternals.PowerShell.csproj
File metadata and controls
117 lines (110 loc) · 9.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Target both Windows PowerShell 5 and PowerShell 7 -->
<TargetFrameworks>net48;net8.0-windows</TargetFrameworks>
<!-- Redirect the build directory so that it includes the module name -->
<ArtifactsPivots>$(Configuration)/DSInternals/$(TargetFramework)</ArtifactsPivots>
<IncludeSymbols>False</IncludeSymbols>
<Version>6.4</Version>
<AssemblyTitle>DSInternals PowerShell Commands</AssemblyTitle>
<!-- Copy all dependency DLLs to the binary module -->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- XML documentation files are not needed for PowerShell binary modules -->
<GenerateDocumentationFile>False</GenerateDocumentationFile>
<!-- Do not generate the *.deps.json file, which is not needed by PowerShell Core -->
<GenerateDependencyFile>False</GenerateDependencyFile>
<!-- Skip copying XML files from the referenced projects -->
<AllowedReferenceRelatedFileExtensions>.pdb</AllowedReferenceRelatedFileExtensions>
</PropertyGroup>
<ItemGroup>
<!-- Include platform-independent module files in the module root directory -->
<Content Include="*.psd1;*.psm1;**\*.ps1xml;License.txt;*\*.txt;*\*.*Help.xml">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>../%(RecursiveDir)%(Filename)%(Extension)</TargetPath>
</Content>
<!-- Show MarkDown documentation files -->
<None Include="$(MSBuildThisFileDirectory)../../Documentation/PowerShell/*.md">
<Link>Documentation/Commands/%(Filename)%(Extension)</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)../../Documentation/*.md">
<Link>Documentation/%(Filename)%(Extension)</Link>
</None>
<None Include="$(MSBuildThisFileDirectory)../../.github/*.md">
<Link>Documentation/%(Filename)%(Extension)</Link>
</None>
<!-- Display the build scripts as part of the PowerShell project -->
<None Include="$(MSBuildThisFileDirectory)../../Scripts/*.*">
<Link>Scripts/%(Filename)%(Extension)</Link>
</None>
<!-- Pack the script template as an embedded resource -->
<None Remove="ADDBRestoreFromMediaScriptTemplate.ps1" />
<EmbeddedResource Include="ADDBRestoreFromMediaScriptTemplate.ps1" />
<!-- Distribute basic integrity checks with the module -->
<None Remove="Integrity.Tests.ps1" />
<Content Include="Integrity.Tests.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>../Integrity.Tests.ps1</TargetPath>
</Content>
<!-- Distribute the startup script with the module -->
<None Remove="Test-ModuleCompatibility.ps1" />
<Content Include="Test-ModuleCompatibility.ps1">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<TargetPath>../Test-ModuleCompatibility.ps1</TargetPath>
</Content>
</ItemGroup>
<ItemGroup>
<!-- Reference assemblies that are bundled with PowerShell -->
<PackageReference Include="PowerShellStandard.Library" IncludeAssets="compile" />
<ProjectReference Include="..\DSInternals.Common\DSInternals.Common.csproj" />
<ProjectReference Include="..\DSInternals.ADSI\DSInternals.ADSI.csproj" />
<ProjectReference Include="..\DSInternals.Datastore\DSInternals.Datastore.csproj" />
<ProjectReference Include="..\DSInternals.Replication.Model\DSInternals.Replication.Model.csproj" />
<ProjectReference Include="..\DSInternals.Replication\DSInternals.Replication.csproj" />
<ProjectReference Include="..\DSInternals.SAM\DSInternals.SAM.csproj" />
<!-- The following dependency from DSInternals.ADSI is already bundled with PowerShell Core -->
<PackageReference Include="System.DirectoryServices" Condition="'$(TargetFramework)' != 'net48'" IncludeAssets="compile" />
<!-- The following dependencies from DSInternals.Common are already bundled with PowerShell Desktop on Windows Server 2025, but are absent on Windows Server 2008 R2: -->
<!-- System.Memory, System.Numerics.Vectors, System.Buffers, System.Runtime.CompilerServices.Unsafe -->
</ItemGroup>
<!-- Bundle the platform-specific DSInternals.Replication.Interop libraries and Visual C and C++ runtimes -->
<!-- To avoid compilation errors when debugging, only existing files will be copied. -->
<!-- As the CPP runtime DLLs are specified using wildcards, only look for them if the corresponding Interop assembly exists. -->
<Target Name="CopyInteropLibraries" AfterTargets="PostBuildEvent">
<PropertyGroup>
<ReplicationInteropRootDir>$(ArtifactsPath)\bin\DSInternals.Replication.Interop\$(Configuration.ToLower())_$(TargetFramework)\</ReplicationInteropRootDir>
</PropertyGroup>
<ItemGroup Condition="'$(Configuration)' == 'Release'">
<CppRuntimeBinariesX64 Include="$(ReplicationInteropRootDir)x64\msvc????.dll;$(ReplicationInteropRootDir)x64\vcruntime???.dll;$(ReplicationInteropRootDir)x64\vcruntime???_?.dll" />
<CppRuntimeBinariesX86 Include="$(ReplicationInteropRootDir)Win32\msvc????.dll;$(ReplicationInteropRootDir)Win32\vcruntime???.dll;$(ReplicationInteropRootDir)Win32\vcruntime???_?.dll" />
<CppRuntimeBinariesARM64 Include="$(ReplicationInteropRootDir)ARM64\msvc????.dll;$(ReplicationInteropRootDir)ARM64\vcruntime???.dll;$(ReplicationInteropRootDir)ARM64\vcruntime???_?.dll" />
</ItemGroup>
<ItemGroup Condition="'$(Configuration)' == 'Debug'">
<CppRuntimeBinariesX64 Include="$(ReplicationInteropRootDir)x64\msvc????d.dll;$(ReplicationInteropRootDir)x64\vcruntime???d.dll;$(ReplicationInteropRootDir)x64\vcruntime???_?d.dll;$(ReplicationInteropRootDir)x64\ucrtbased.dll" />
<CppRuntimeBinariesX86 Include="$(ReplicationInteropRootDir)Win32\msvc????d.dll;$(ReplicationInteropRootDir)Win32\vcruntime???d.dll;$(ReplicationInteropRootDir)Win32\vcruntime???_?d.dll;$(ReplicationInteropRootDir)Win32\ucrtbased.dll" />
<CppRuntimeBinariesARM64 Include="$(ReplicationInteropRootDir)ARM64\msvc????d.dll;$(ReplicationInteropRootDir)ARM64\vcruntime???d.dll;$(ReplicationInteropRootDir)ARM64\vcruntime???_?d.dll;$(ReplicationInteropRootDir)ARM64\ucrtbased.dll" />
</ItemGroup>
<!-- X64 -->
<Copy SourceFiles="$(ReplicationInteropRootDir)x64\DSInternals.Replication.Interop.dll" DestinationFolder="$(OutDir)amd64" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)x64\DSInternals.Replication.Interop.dll')" />
<Copy SourceFiles="$(ReplicationInteropRootDir)x64\DSInternals.Replication.Interop.pdb" DestinationFolder="$(OutDir)amd64" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)x64\DSInternals.Replication.Interop.pdb')" />
<Copy SourceFiles="@(CppRuntimeBinariesX64)" DestinationFolder="$(OutDir)amd64" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)x64\DSInternals.Replication.Interop.dll')" />
<Copy SourceFiles="$(ReplicationInteropRootDir)x64\Ijwhost.dll" DestinationFolder="$(OutDir)amd64" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="'$(TargetFramework)' != 'net48' and Exists('$(ReplicationInteropRootDir)x64\Ijwhost.dll')" />
<!-- X86 -->
<Copy SourceFiles="$(ReplicationInteropRootDir)Win32\DSInternals.Replication.Interop.dll" DestinationFolder="$(OutDir)x86" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)Win32\DSInternals.Replication.Interop.dll')" />
<Copy SourceFiles="$(ReplicationInteropRootDir)Win32\DSInternals.Replication.Interop.pdb" DestinationFolder="$(OutDir)x86" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)Win32\DSInternals.Replication.Interop.pdb')" />
<Copy SourceFiles="@(CppRuntimeBinariesX86)" DestinationFolder="$(OutDir)x86" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)Win32\DSInternals.Replication.Interop.dll')" />
<Copy SourceFiles="$(ReplicationInteropRootDir)Win32\Ijwhost.dll" DestinationFolder="$(OutDir)x86" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="'$(TargetFramework)' != 'net48' and Exists('$(ReplicationInteropRootDir)Win32\Ijwhost.dll')" />
<!-- ARM64-->
<Copy SourceFiles="$(ReplicationInteropRootDir)ARM64\DSInternals.Replication.Interop.dll" DestinationFolder="$(OutDir)arm64" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)ARM64\DSInternals.Replication.Interop.dll')" />
<Copy SourceFiles="$(ReplicationInteropRootDir)ARM64\DSInternals.Replication.Interop.pdb" DestinationFolder="$(OutDir)arm64" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)ARM64\DSInternals.Replication.Interop.pdb')" />
<Copy SourceFiles="@(CppRuntimeBinariesARM64)" DestinationFolder="$(OutDir)arm64" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="Exists('$(ReplicationInteropRootDir)ARM64\DSInternals.Replication.Interop.dll')" />
<Copy SourceFiles="$(ReplicationInteropRootDir)ARM64\Ijwhost.dll" DestinationFolder="$(OutDir)arm64" SkipUnchangedFiles="true" UseHardlinksIfPossible="true" Condition="'$(TargetFramework)' != 'net48' and Exists('$(ReplicationInteropRootDir)ARM64\Ijwhost.dll')" />
</Target>
<!-- Remove platform-specific files from the AnyCPU root -->
<Target Name="RemoveRootInteropDll" AfterTargets="PostBuildEvent">
<!-- Remove DSInternals.Replication.Interop DLL and PDB from module root. Only keep it in the architecture-specific subdirectories. -->
<Delete Files="$(OutDir)DSInternals.Replication.Interop.dll" />
<Delete Files="$(OutDir)DSInternals.Replication.Interop.pdb" />
<!-- Remove the .NET IJW host from module root. Only keep it in the architecture-specific subdirectories. -->
<Delete Files="$(OutDir)Ijwhost.dll" />
</Target>
</Project>