-
Notifications
You must be signed in to change notification settings - Fork 255
Expand file tree
/
Copy pathSharphound.csproj
More file actions
88 lines (80 loc) · 4.83 KB
/
Sharphound.csproj
File metadata and controls
88 lines (80 loc) · 4.83 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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net472</TargetFramework>
<LangVersion>latest</LangVersion>
<DebugType>full</DebugType>
<ApplicationIcon>favicon.ico</ApplicationIcon>
<Version>2.12.0</Version>
<FileVersion>2.12.0</FileVersion>
<Company>SpecterOps</Company>
<Product>SharpHound</Product>
<AssemblyName>SharpHound</AssemblyName>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup>
<CommonLibsVersion>4.6.1</CommonLibsVersion>
<CommonSource>Dev</CommonSource>
<_CommonSource>$(CommonSource.ToLower())</_CommonSource>
<_CommonLibPath>..\SharpHoundCommon\src\CommonLib\bin\$(Configuration)\net472\SharpHoundCommonLib.dll</_CommonLibPath>
<_RPCPath>..\SharpHoundCommon\src\SharpHoundRPC\bin\$(Configuration)\net472\SharpHoundRPC.dll</_RPCPath>
</PropertyGroup>
<Target Name="ValidateCommonSource" BeforeTargets="Build">
<Error Condition="'$(_CommonSource)' != 'dev' AND '$(_CommonSource)' != 'stable' AND '$(_CommonSource)' != 'local'"
Text="Invalid CommonSource value '$(CommonSource)'. Valid values are: Dev, Stable, Local." />
</Target>
<PropertyGroup Condition="'$(_CommonSource)' == 'dev' AND !$(CommonLibsVersion.Contains('-'))">
<!-- Derive the dev version by incrementing the patch of the stable version e.g. 4.6.0 → 4.6.1-dev* -->
<_Major>$([System.Version]::Parse('$(CommonLibsVersion)').Major)</_Major>
<_Minor>$([System.Version]::Parse('$(CommonLibsVersion)').Minor)</_Minor>
<_Patch>$([System.Version]::Parse('$(CommonLibsVersion)').Build)</_Patch>
<_DevVersion>$(_Major).$(_Minor).$([MSBuild]::Add($(_Patch), 1))-dev*</_DevVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(_CommonSource)' != 'local'">
<_ResolvedCommonVersion Condition="$(CommonLibsVersion.Contains('-'))">$(CommonLibsVersion)</_ResolvedCommonVersion>
<_ResolvedCommonVersion Condition="'$(_ResolvedCommonVersion)' == '' AND '$(_CommonSource)' == 'dev'">$(_DevVersion)</_ResolvedCommonVersion>
<_ResolvedCommonVersion Condition="'$(_ResolvedCommonVersion)' == ''">$(CommonLibsVersion)</_ResolvedCommonVersion>
</PropertyGroup>
<ItemGroup Condition="'$(_CommonSource)' == 'local'">
<Reference Include="SharpHoundCommonLib">
<HintPath>$(_CommonLibPath)</HintPath>
</Reference>
<Reference Include="SharpHoundRPC">
<HintPath>$(_RPCPath)</HintPath>
</Reference>
</ItemGroup>
<ItemGroup Condition="'$(_CommonSource)' != 'local'">
<PackageReference Include="SharpHoundCommon" Version="$(_ResolvedCommonVersion)" />
<PackageReference Include="SharpHoundRPC" Version="$(_ResolvedCommonVersion)" />
</ItemGroup>
<Target Name="LogCommonLibsSource" BeforeTargets="Build">
<Message Text='CommonLib Source "$(CommonSource)":' Importance="high" />
<Message Condition="'$(_CommonSource)' == 'local'" Text=" Resolved Using Local DLLs" Importance="high" />
<Message Condition="'$(_CommonSource)' != 'local'" Text=" Resolved to NuGet Version: $(_ResolvedCommonVersion)" Importance="high" />
</Target>
<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="Costura.Fody" Version="5.7.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Fody" Version="6.6.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="SharpZipLib" Version="1.3.3" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Threading.Channels" Version="8.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System.DirectoryServices" />
<Reference Include="System.DirectoryServices.Protocols" />
<Reference Include="System.IO.Compression" />
</ItemGroup>
<Target Name="PS1" AfterTargets="Build" Condition="$([MSBuild]::IsOSPlatform('Windows'))">
<Message Text="Test" />
<Exec Command="powershell -ep bypass -c ". '$(ProjectDir)src\Powershell\Out-CompressedDLL.ps1';Out-CompressedDll -FilePath '$(TargetPath)' -TemplatePath '$(ProjectDir)src\\Powershell\Template.ps1' | Out-File -Encoding ASCII '$(TargetDir)$(TargetName).ps1'"" />
</Target>
</Project>