Skip to content

Commit c3d8556

Browse files
committed
Clean up csproj files
1 parent 9ccbb97 commit c3d8556

File tree

8 files changed

+90
-58
lines changed

8 files changed

+90
-58
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\API\API.csproj" />
4+
</ItemGroup>
5+
6+
<!-- Props -->
27
<PropertyGroup>
38
<IsPackable>false</IsPackable>
49
</PropertyGroup>
510

11+
<!-- NuGet packages -->
612
<ItemGroup>
713
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" />
814
<PackageReference Include="Testcontainers.PostgreSql" />
915
<PackageReference Include="Testcontainers.Redis" />
1016
<PackageReference Include="TUnit" />
1117
</ItemGroup>
12-
13-
<ItemGroup>
14-
<ProjectReference Include="..\API\API.csproj" />
15-
</ItemGroup>
16-
1718
</Project>

API/API.csproj

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
<ItemGroup>
3+
<ProjectReference Include="..\Common\Common.csproj" />
4+
</ItemGroup>
5+
6+
<!-- Props -->
7+
<ItemGroup>
8+
<!-- Expose API internals to IntegrationTest project -->
9+
<InternalsVisibleTo Include="$(AssemblyName).Tests.Integration" />
10+
</ItemGroup>
11+
12+
<!-- NuGet packages -->
213
<ItemGroup>
314
<PackageReference Include="AspNet.Security.OAuth.Discord" />
415
<PackageReference Include="Fluid.Core" />
@@ -7,32 +18,23 @@
718
<PackageReference Include="Microsoft.AspNetCore.Authentication.Twitter" />
819
</ItemGroup>
920

10-
<Target Name="SetSourceRevisionId" BeforeTargets="InitializeSourceControlInformation">
11-
<Exec Command="git rev-parse HEAD" IgnoreExitCode="False">
12-
<Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput" />
13-
</Exec>
14-
</Target>
21+
<!-- Files to copy -->
22+
<ItemGroup>
23+
<!-- Copy all Liquid templates (recursively) to build and publish outputs -->
24+
<None Update="SmtpTemplates\**\*.liquid">
25+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
26+
</None>
27+
28+
<!-- Dev cert included on publish -->
29+
<None Include="devcert.pfx" CopyToPublishDirectory="Always" />
30+
</ItemGroup>
1531

32+
<!-- Git stuff -->
1633
<Target Name="SetHash" AfterTargets="InitializeSourceControlInformation">
1734
<ItemGroup>
1835
<AssemblyAttribute Include="OpenShock.Common.Utils.GitHashAttribute">
1936
<_Parameter1>$(SourceRevisionId)</_Parameter1>
2037
</AssemblyAttribute>
2138
</ItemGroup>
2239
</Target>
23-
24-
<ItemGroup>
25-
<ProjectReference Include="..\Common\Common.csproj" />
26-
<None Include="devcert.pfx" CopyToPublishDirectory="Always" />
27-
<None Update="SmtpTemplates\PasswordReset.liquid">
28-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
29-
</None>
30-
<None Update="SmtpTemplates\EmailVerification.liquid">
31-
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
32-
</None>
33-
</ItemGroup>
34-
35-
<ItemGroup>
36-
<InternalsVisibleTo Include="$(AssemblyName).Tests.Integration" />
37-
</ItemGroup>
3840
</Project>

Common.Tests/Common.Tests.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\Common\Common.csproj" />
4+
</ItemGroup>
5+
6+
<!-- NuGet packages -->
27
<ItemGroup>
38
<PackageReference Include="Testcontainers.PostgreSql" />
49
<PackageReference Include="Testcontainers.Redis" />
510
<PackageReference Include="Bogus" />
611
<PackageReference Include="TUnit" />
712
</ItemGroup>
813

9-
<ItemGroup>
10-
<ProjectReference Include="..\Common\Common.csproj" />
11-
</ItemGroup>
12-
14+
<!-- Files to copy -->
1315
<ItemGroup>
1416
<None Update="Validation\DataSets\BlackList.txt">
1517
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

Common/Common.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
<!-- Props -->
23
<PropertyGroup>
34
<OutputType>Library</OutputType>
45
</PropertyGroup>
56

7+
<!-- NuGet packages -->
68
<ItemGroup>
79
<PackageReference Include="BCrypt.Net-Next" />
810
<PackageReference Include="IDisposableAnalyzers">
@@ -35,9 +37,17 @@
3537
<PackageReference Include="Z.EntityFramework.Plus.EFCore" />
3638
</ItemGroup>
3739

40+
<!-- Files to copy -->
3841
<ItemGroup>
3942
<EmbeddedResource Include="cloudflare-ips.txt">
4043
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
4144
</EmbeddedResource>
4245
</ItemGroup>
46+
47+
<!-- Capture git commit only if we're in a git repo; pipe output back to MSBuild -->
48+
<Target Name="SetSourceRevisionId" BeforeTargets="InitializeSourceControlInformation">
49+
<Exec Command="git rev-parse HEAD" IgnoreExitCode="False">
50+
<Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput" />
51+
</Exec>
52+
</Target>
4353
</Project>

Cron/Cron.csproj

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22
<ItemGroup>
3-
<PackageReference Include="Hangfire.AspNetCore" />
4-
<PackageReference Include="Hangfire.PostgreSql" />
3+
<ProjectReference Include="..\Common\Common.csproj" />
54
</ItemGroup>
65

6+
<!-- NuGet packages -->
77
<ItemGroup>
8-
<ProjectReference Include="..\Common\Common.csproj" />
8+
<PackageReference Include="Hangfire.AspNetCore" />
9+
<PackageReference Include="Hangfire.PostgreSql" />
910
</ItemGroup>
1011

12+
<!-- Files to copy -->
1113
<ItemGroup>
1214
<None Update="devcert.pfx">
1315
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
1416
</None>
1517
</ItemGroup>
18+
19+
<!-- Git stuff -->
20+
<Target Name="SetHash" AfterTargets="InitializeSourceControlInformation">
21+
<ItemGroup>
22+
<AssemblyAttribute Include="OpenShock.Common.Utils.GitHashAttribute">
23+
<_Parameter1>$(SourceRevisionId)</_Parameter1>
24+
</AssemblyAttribute>
25+
</ItemGroup>
26+
</Target>
1627
</Project>
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
<Target Name="SetSourceRevisionId" BeforeTargets="InitializeSourceControlInformation">
3-
<Exec Command="git rev-parse HEAD" IgnoreExitCode="False">
4-
<Output PropertyName="SourceRevisionId" TaskParameter="ConsoleOutput" />
5-
</Exec>
6-
</Target>
7-
8-
<Target Name="SetHash" AfterTargets="InitializeSourceControlInformation">
9-
<ItemGroup>
10-
<AssemblyAttribute Include="OpenShock.Common.Utils.GitHashAttribute">
11-
<_Parameter1>$(SourceRevisionId)</_Parameter1>
12-
</AssemblyAttribute>
13-
</ItemGroup>
14-
</Target>
15-
162
<ItemGroup>
173
<ProjectReference Include="..\Common\Common.csproj" />
4+
</ItemGroup>
5+
6+
<!-- Flatbuffers -->
7+
<ItemGroup>
188
<FlatSharpSchema Include="Serialization\**\*.fbs" />
199
</ItemGroup>
2010

11+
<!-- Files to copy -->
2112
<ItemGroup>
2213
<None Update="devcert.pfx">
23-
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
14+
<CopyToPublishDirectory>Always</CopyToPublishDirectory>
2415
</None>
2516
</ItemGroup>
17+
18+
<!-- Git stuff -->
19+
<Target Name="SetHash" AfterTargets="InitializeSourceControlInformation">
20+
<ItemGroup>
21+
<AssemblyAttribute Include="OpenShock.Common.Utils.GitHashAttribute">
22+
<_Parameter1>$(SourceRevisionId)</_Parameter1>
23+
</AssemblyAttribute>
24+
</ItemGroup>
25+
</Target>
2626
</Project>

MigrationHelper/MigrationHelper.csproj

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
<PropertyGroup>
3-
<OutputType>Exe</OutputType>
4-
</PropertyGroup>
5-
62
<ItemGroup>
73
<ProjectReference Include="..\Common\Common.csproj" />
84
</ItemGroup>
95

6+
<!-- Props -->
7+
<PropertyGroup>
8+
<OutputType>Exe</OutputType>
9+
</PropertyGroup>
10+
11+
<!-- NuGet packages -->
1012
<ItemGroup>
1113
<PackageReference Include="Microsoft.EntityFrameworkCore.Design">
1214
<PrivateAssets>all</PrivateAssets>

SeedE2E/SeedE2E.csproj

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2+
<ItemGroup>
3+
<ProjectReference Include="..\Common\Common.csproj" />
4+
</ItemGroup>
5+
6+
<!-- Props -->
27
<PropertyGroup>
38
<OutputType>Exe</OutputType>
49
</PropertyGroup>
510

11+
<!-- NuGet packages -->
12+
<ItemGroup>
13+
<PackageReference Include="Bogus" />
14+
</ItemGroup>
15+
16+
<!-- Files to copy -->
617
<ItemGroup>
718
<Content Include="appsettings.json">
819
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
@@ -11,11 +22,4 @@
1122
</Content>
1223
</ItemGroup>
1324

14-
<ItemGroup>
15-
<PackageReference Include="Bogus" />
16-
</ItemGroup>
17-
18-
<ItemGroup>
19-
<ProjectReference Include="..\Common\Common.csproj" />
20-
</ItemGroup>
2125
</Project>

0 commit comments

Comments
 (0)