Codestyle fixes
This commit is contained in:
@@ -9,32 +9,30 @@ namespace Flax.Build
|
||||
/// </summary>
|
||||
public static class FileCache
|
||||
{
|
||||
private static Dictionary<string, FileInfo> fileInfoCache = new Dictionary<string, FileInfo>();
|
||||
private static readonly Dictionary<string, FileInfo> _cache = new();
|
||||
|
||||
public static void FileRemoveFromCache(string path)
|
||||
{
|
||||
//fileInfoCache[path].Refresh();
|
||||
fileInfoCache.Remove(path);
|
||||
_cache.Remove(path);
|
||||
}
|
||||
|
||||
|
||||
public static bool Exists(string path)
|
||||
{
|
||||
if (fileInfoCache.TryGetValue(path, out var fileInfo))
|
||||
if (_cache.TryGetValue(path, out var fileInfo))
|
||||
return fileInfo.Exists;
|
||||
|
||||
fileInfo = new FileInfo(path);
|
||||
fileInfoCache.Add(path, fileInfo);
|
||||
_cache.Add(path, fileInfo);
|
||||
return fileInfo.Exists;
|
||||
}
|
||||
|
||||
public static DateTime GetLastWriteTime(string path)
|
||||
{
|
||||
|
||||
if (fileInfoCache.TryGetValue(path, out var fileInfo))
|
||||
if (_cache.TryGetValue(path, out var fileInfo))
|
||||
return fileInfo.LastWriteTime;
|
||||
|
||||
fileInfo = new FileInfo(path);
|
||||
fileInfoCache.Add(path, fileInfo);
|
||||
_cache.Add(path, fileInfo);
|
||||
return fileInfo.LastWriteTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -808,11 +808,11 @@ namespace Flax.Build
|
||||
foreach (var moduleName in moduleOptions.PrivateDependencies.Concat(moduleOptions.PublicDependencies))
|
||||
{
|
||||
var dependencyModule = buildData.Rules.GetModule(moduleName);
|
||||
if (dependencyModule != null &&
|
||||
!string.IsNullOrEmpty(dependencyModule.BinaryModuleName) &&
|
||||
dependencyModule.BinaryModuleName != binaryModule.Key &&
|
||||
if (dependencyModule != null &&
|
||||
!string.IsNullOrEmpty(dependencyModule.BinaryModuleName) &&
|
||||
dependencyModule.BinaryModuleName != binaryModule.Key &&
|
||||
!moduleNamesUsed.Contains(dependencyModule.BinaryModuleName) &&
|
||||
GetModuleProject(dependencyModule, project) != null &&
|
||||
GetModuleProject(dependencyModule, project) != null &&
|
||||
buildData.Modules.TryGetValue(dependencyModule, out var dependencyOptions))
|
||||
{
|
||||
// Import symbols from referenced binary module
|
||||
|
||||
@@ -77,14 +77,10 @@ namespace Flax.Build
|
||||
var architectureId = RuntimeInformation.ProcessArchitecture;
|
||||
switch (architectureId)
|
||||
{
|
||||
case Architecture.X86:
|
||||
return TargetArchitecture.x86;
|
||||
case Architecture.X64:
|
||||
return TargetArchitecture.x64;
|
||||
case Architecture.Arm:
|
||||
return TargetArchitecture.ARM;
|
||||
case Architecture.Arm64:
|
||||
return TargetArchitecture.ARM64;
|
||||
case Architecture.X86: return TargetArchitecture.x86;
|
||||
case Architecture.X64: return TargetArchitecture.x64;
|
||||
case Architecture.Arm: return TargetArchitecture.ARM;
|
||||
case Architecture.Arm64: return TargetArchitecture.ARM64;
|
||||
default: throw new NotImplementedException(string.Format("Unsupported build platform {0}.", architectureId));
|
||||
}
|
||||
}
|
||||
@@ -290,12 +286,9 @@ namespace Flax.Build
|
||||
var subdir = "Binaries/Editor/";
|
||||
switch (Platform.BuildTargetPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return subdir + "Win64";
|
||||
case TargetPlatform.Linux:
|
||||
return subdir + "Linux";
|
||||
case TargetPlatform.Mac:
|
||||
return subdir + "Mac";
|
||||
case TargetPlatform.Windows: return subdir + "Win64";
|
||||
case TargetPlatform.Linux: return subdir + "Linux";
|
||||
case TargetPlatform.Mac: return subdir + "Mac";
|
||||
}
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user