mirror of
https://github.com/bitwarden/server
synced 2026-01-28 15:23:38 +00:00
feat: Add compiler conditional ServiceDefaults to included projects
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Admin' " />
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Admin-SelfHost' " />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ServiceDefaults\ServiceDefaults.csproj" Condition="'$(Configuration)' == 'Debug'" />
|
||||
<ProjectReference Include="..\..\util\MySqlMigrations\MySqlMigrations.csproj" />
|
||||
<ProjectReference Include="..\..\util\PostgresMigrations\PostgresMigrations.csproj" />
|
||||
<ProjectReference Include="..\SharedWeb\SharedWeb.csproj" />
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Bit.Core.Utilities;
|
||||
#if DEBUG
|
||||
using Bit.ServiceDefaults;
|
||||
#endif
|
||||
|
||||
namespace Bit.Admin;
|
||||
|
||||
@@ -6,7 +9,7 @@ public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Host
|
||||
var builder = Host
|
||||
.CreateDefaultBuilder(args)
|
||||
.ConfigureCustomAppConfiguration(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
@@ -17,8 +20,12 @@ public class Program
|
||||
});
|
||||
webBuilder.UseStartup<Startup>();
|
||||
})
|
||||
.AddSerilogFileLogging()
|
||||
.Build()
|
||||
.Run();
|
||||
.AddSerilogFileLogging();
|
||||
|
||||
#if DEBUG
|
||||
builder.AddServiceDefaults();
|
||||
#endif
|
||||
|
||||
builder.Build().Run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Api' " />
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Api-SelfHost' " />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ServiceDefaults\ServiceDefaults.csproj" Condition="'$(Configuration)' == 'Debug'" />
|
||||
<ProjectReference Include="..\SharedWeb\SharedWeb.csproj" />
|
||||
<ProjectReference Include="..\Core\Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Bit.Core.Utilities;
|
||||
#if DEBUG
|
||||
using Bit.ServiceDefaults;
|
||||
#endif
|
||||
|
||||
namespace Bit.Api;
|
||||
|
||||
@@ -6,15 +9,19 @@ public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Host
|
||||
var builder = Host
|
||||
.CreateDefaultBuilder(args)
|
||||
.ConfigureCustomAppConfiguration(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
})
|
||||
.AddSerilogFileLogging()
|
||||
.Build()
|
||||
.Run();
|
||||
.AddSerilogFileLogging();
|
||||
|
||||
#if DEBUG
|
||||
builder.AddServiceDefaults();
|
||||
#endif
|
||||
|
||||
builder.Build().Run();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Billing' " />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ServiceDefaults\ServiceDefaults.csproj" Condition="'$(Configuration)' == 'Debug'" />
|
||||
<ProjectReference Include="..\..\bitwarden_license\src\Commercial.Core\Commercial.Core.csproj" />
|
||||
<ProjectReference Include="..\SharedWeb\SharedWeb.csproj" />
|
||||
<ProjectReference Include="..\Core\Core.csproj" />
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Bit.Core.Utilities;
|
||||
#if DEBUG
|
||||
using Bit.ServiceDefaults;
|
||||
#endif
|
||||
|
||||
namespace Bit.Billing;
|
||||
|
||||
@@ -6,15 +9,20 @@ public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Host
|
||||
var builder = Host
|
||||
.CreateDefaultBuilder(args)
|
||||
.UseBitwardenSdk()
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
})
|
||||
.AddSerilogFileLogging()
|
||||
.Build()
|
||||
.Run();
|
||||
.AddSerilogFileLogging();
|
||||
|
||||
#if DEBUG
|
||||
builder.AddServiceDefaults();
|
||||
#endif
|
||||
|
||||
builder.Build().Run();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Identity' " />
|
||||
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Identity-SelfHost' " />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ServiceDefaults\ServiceDefaults.csproj" Condition="'$(Configuration)' == 'Debug'" />
|
||||
<ProjectReference Include="..\SharedWeb\SharedWeb.csproj" />
|
||||
<ProjectReference Include="..\Core\Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Bit.Core.Utilities;
|
||||
#if DEBUG
|
||||
using Bit.ServiceDefaults;
|
||||
#endif
|
||||
|
||||
namespace Bit.Identity;
|
||||
|
||||
@@ -6,9 +9,14 @@ public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
CreateHostBuilder(args)
|
||||
.Build()
|
||||
.Run();
|
||||
var builder = CreateHostBuilder(args);
|
||||
|
||||
#if DEBUG
|
||||
builder.AddServiceDefaults();
|
||||
#endif
|
||||
|
||||
builder.Build().Run();
|
||||
|
||||
}
|
||||
|
||||
public static IHostBuilder CreateHostBuilder(string[] args)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\ServiceDefaults\ServiceDefaults.csproj" Condition="'$(Configuration)' == 'Debug'" />
|
||||
<ProjectReference Include="..\Core\Core.csproj" />
|
||||
<ProjectReference Include="..\SharedWeb\SharedWeb.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
using Bit.Core.Utilities;
|
||||
#if DEBUG
|
||||
using Bit.ServiceDefaults;
|
||||
#endif
|
||||
|
||||
namespace Bit.Notifications;
|
||||
|
||||
@@ -6,15 +9,19 @@ public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Host
|
||||
var builder = Host
|
||||
.CreateDefaultBuilder(args)
|
||||
.ConfigureCustomAppConfiguration(args)
|
||||
.ConfigureWebHostDefaults(webBuilder =>
|
||||
{
|
||||
webBuilder.UseStartup<Startup>();
|
||||
})
|
||||
.AddSerilogFileLogging()
|
||||
.Build()
|
||||
.Run();
|
||||
.AddSerilogFileLogging();
|
||||
|
||||
#if DEBUG
|
||||
builder.AddServiceDefaults();
|
||||
#endif
|
||||
|
||||
builder.Build().Run();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user