remove hard coded paths to make it easier for building in debug mode
auto copy script plugins/localization for local builds
This commit is contained in:
parent
2b3e21d4ba
commit
8a8dec8bbd
12
Application/BuildScripts/DownloadTranslations.ps1
Normal file
12
Application/BuildScripts/DownloadTranslations.ps1
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
param (
|
||||||
|
[string]$OutputDir = $(throw "-OutputDir is required.")
|
||||||
|
)
|
||||||
|
|
||||||
|
$localizations = @("en-US", "ru-RU", "es-EC", "pt-BR", "de-DE")
|
||||||
|
foreach($localization in $localizations)
|
||||||
|
{
|
||||||
|
$url = "http://api.raidmax.org:5000/localization/{0}" -f $localization
|
||||||
|
$filePath = "{0}Localization\IW4MAdmin.{1}.json" -f $OutputDir, $localization
|
||||||
|
$response = Invoke-WebRequest $url
|
||||||
|
Out-File -FilePath $filePath -InputObject $response.Content -Encoding utf8
|
||||||
|
}
|
@ -1,3 +1,6 @@
|
|||||||
set SolutionDir=%1
|
set SolutionDir=%1
|
||||||
set ProjectDir=%2
|
set ProjectDir=%2
|
||||||
set TargetDir=%3
|
set TargetDir=%3
|
||||||
|
|
||||||
|
echo D | xcopy "%SolutionDir%Plugins\ScriptPlugins\*.js" "%TargetDir%Plugins" /y
|
||||||
|
powershell -File "%ProjectDir%BuildScripts\DownloadTranslations.ps1" %TargetDir%
|
@ -233,7 +233,7 @@ namespace IW4MAdmin.Application
|
|||||||
serviceCollection.AddSingleton<IServiceCollection>(_serviceProvider => serviceCollection)
|
serviceCollection.AddSingleton<IServiceCollection>(_serviceProvider => serviceCollection)
|
||||||
.AddSingleton(new BaseConfigurationHandler<ApplicationConfiguration>("IW4MAdminSettings") as IConfigurationHandler<ApplicationConfiguration>)
|
.AddSingleton(new BaseConfigurationHandler<ApplicationConfiguration>("IW4MAdminSettings") as IConfigurationHandler<ApplicationConfiguration>)
|
||||||
.AddSingleton(new BaseConfigurationHandler<CommandConfiguration>("CommandConfiguration") as IConfigurationHandler<CommandConfiguration>)
|
.AddSingleton(new BaseConfigurationHandler<CommandConfiguration>("CommandConfiguration") as IConfigurationHandler<CommandConfiguration>)
|
||||||
.AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<ApplicationConfiguration>>().Configuration())
|
.AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<ApplicationConfiguration>>().Configuration() ?? new ApplicationConfiguration())
|
||||||
.AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<CommandConfiguration>>().Configuration() ?? new CommandConfiguration())
|
.AddSingleton(_serviceProvider => _serviceProvider.GetRequiredService<IConfigurationHandler<CommandConfiguration>>().Configuration() ?? new CommandConfiguration())
|
||||||
.AddSingleton<ILogger>(_serviceProvider => defaultLogger)
|
.AddSingleton<ILogger>(_serviceProvider => defaultLogger)
|
||||||
.AddSingleton<IPluginImporter, PluginImporter>()
|
.AddSingleton<IPluginImporter, PluginImporter>()
|
||||||
|
@ -26,7 +26,6 @@ namespace SharedLibraryCore.Database
|
|||||||
|
|
||||||
static string _ConnectionString;
|
static string _ConnectionString;
|
||||||
static string _provider;
|
static string _provider;
|
||||||
private static readonly string _migrationPluginDirectory = @"X:\IW4MAdmin\BUILD\Plugins";
|
|
||||||
private static readonly ILoggerFactory _loggerFactory = LoggerFactory.Create(builder =>
|
private static readonly ILoggerFactory _loggerFactory = LoggerFactory.Create(builder =>
|
||||||
{
|
{
|
||||||
builder.AddConsole()
|
builder.AddConsole()
|
||||||
@ -72,7 +71,7 @@ namespace SharedLibraryCore.Database
|
|||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
|
||||||
{
|
{
|
||||||
//optionsBuilder.UseLoggerFactory(_loggerFactory)
|
//optionsBuilder.UseLoggerFactory(_loggerFactory)
|
||||||
// .EnableSensitiveDataLogging();
|
// .EnableSensitiveDataLogging();
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(_ConnectionString))
|
if (string.IsNullOrEmpty(_ConnectionString))
|
||||||
{
|
{
|
||||||
@ -198,11 +197,14 @@ namespace SharedLibraryCore.Database
|
|||||||
|
|
||||||
// adapted from
|
// adapted from
|
||||||
// https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/
|
// https://aleemkhan.wordpress.com/2013/02/28/dynamically-adding-dbset-properties-in-dbcontext-for-entity-framework-code-first/
|
||||||
#if DEBUG
|
|
||||||
string pluginDir = _migrationPluginDirectory;
|
|
||||||
#else
|
|
||||||
string pluginDir = Path.Join(Utilities.OperatingDirectory, "Plugins");
|
string pluginDir = Path.Join(Utilities.OperatingDirectory, "Plugins");
|
||||||
#endif
|
|
||||||
|
if (Utilities.IsDevelopment)
|
||||||
|
{
|
||||||
|
pluginDir = Path.Join(Utilities.OperatingDirectory, "..", "..", "..", "..", "BUILD", "Plugins");
|
||||||
|
}
|
||||||
|
|
||||||
IEnumerable<string> directoryFiles = Directory.GetFiles(pluginDir).Where(f => f.EndsWith(".dll"));
|
IEnumerable<string> directoryFiles = Directory.GetFiles(pluginDir).Where(f => f.EndsWith(".dll"));
|
||||||
|
|
||||||
foreach (string dllPath in directoryFiles)
|
foreach (string dllPath in directoryFiles)
|
||||||
|
@ -24,11 +24,14 @@ namespace WebfrontCore.Controllers
|
|||||||
{
|
{
|
||||||
if (fileName.EndsWith(".css"))
|
if (fileName.EndsWith(".css"))
|
||||||
{
|
{
|
||||||
#if DEBUG
|
if (Utilities.IsDevelopment)
|
||||||
string cssData = await System.IO.File.ReadAllTextAsync($"X:\\IW4MAdmin\\WebfrontCore\\wwwroot\\css\\{fileName}");
|
{
|
||||||
cssData = await Manager.MiddlewareActionHandler.Execute(cssData, "custom_css_accent");
|
var path = Path.Join(Utilities.OperatingDirectory, "..", "..", "..", "..", "WebfrontCore", "wwwroot", "css", fileName);
|
||||||
return Content(cssData, "text/css");
|
string cssData = await System.IO.File.ReadAllTextAsync(path);
|
||||||
#endif
|
cssData = await Manager.MiddlewareActionHandler.Execute(cssData, "custom_css_accent");
|
||||||
|
return Content(cssData, "text/css");
|
||||||
|
}
|
||||||
|
|
||||||
if (!_fileCache.ContainsKey(fileName))
|
if (!_fileCache.ContainsKey(fileName))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user