Reset AOT Assemblies game cooker cache when Flax.Build gets modified
This commit is contained in:
@@ -21,7 +21,11 @@ void PrecompileAssembliesStep::OnBuildStarted(CookingData& data)
|
|||||||
|
|
||||||
// Reset any AOT cache from previous run if the AOT mode has changed (eg. Mono AOT -> ILC on Desktop)
|
// Reset any AOT cache from previous run if the AOT mode has changed (eg. Mono AOT -> ILC on Desktop)
|
||||||
const String aotModeCacheFilePath = data.ManagedCodeOutputPath / TEXT("AOTMode.txt");
|
const String aotModeCacheFilePath = data.ManagedCodeOutputPath / TEXT("AOTMode.txt");
|
||||||
String aotModeCacheValue = String::Format(TEXT("{};{};{}"), (int32)aotMode, (int32)data.Configuration, (int32)buildSettings.SkipUnusedDotnetLibsPackaging);
|
String aotModeCacheValue = String::Format(TEXT("{};{};{};{}"),
|
||||||
|
(int32)aotMode,
|
||||||
|
(int32)data.Configuration,
|
||||||
|
(int32)buildSettings.SkipUnusedDotnetLibsPackaging,
|
||||||
|
FileSystem::GetFileLastEditTime(ScriptsBuilder::GetBuildToolPath()).Ticks);
|
||||||
for (const String& define : data.CustomDefines)
|
for (const String& define : data.CustomDefines)
|
||||||
aotModeCacheValue += define;
|
aotModeCacheValue += define;
|
||||||
if (FileSystem::DirectoryExists(data.ManagedCodeOutputPath))
|
if (FileSystem::DirectoryExists(data.ManagedCodeOutputPath))
|
||||||
@@ -60,7 +64,7 @@ bool PrecompileAssembliesStep::Perform(CookingData& data)
|
|||||||
// Run AOT by Flax.Build (see DotNetAOT)
|
// Run AOT by Flax.Build (see DotNetAOT)
|
||||||
const Char *platform, *architecture, *configuration = ::ToString(data.Configuration);
|
const Char *platform, *architecture, *configuration = ::ToString(data.Configuration);
|
||||||
data.GetBuildPlatformName(platform, architecture);
|
data.GetBuildPlatformName(platform, architecture);
|
||||||
const String logFile = data.CacheDirectory / TEXT("AotLog.txt");
|
const String logFile = data.CacheDirectory / TEXT("AOTLog.txt");
|
||||||
String args = String::Format(
|
String args = String::Format(
|
||||||
TEXT("-log -logfile=\"{}\" -runDotNetAOT -mutex -platform={} -arch={} -configuration={} -aotMode={} -binaries=\"{}\" -intermediate=\"{}\""),
|
TEXT("-log -logfile=\"{}\" -runDotNetAOT -mutex -platform={} -arch={} -configuration={} -aotMode={} -binaries=\"{}\" -intermediate=\"{}\""),
|
||||||
logFile, platform, architecture, configuration, ToString(aotMode), data.DataOutputPath, data.ManagedCodeOutputPath);
|
logFile, platform, architecture, configuration, ToString(aotMode), data.DataOutputPath, data.ManagedCodeOutputPath);
|
||||||
|
|||||||
@@ -134,6 +134,15 @@ int32 ScriptsBuilder::GetCompilationsCount()
|
|||||||
return _compilationsCount;
|
return _compilationsCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String ScriptsBuilder::GetBuildToolPath()
|
||||||
|
{
|
||||||
|
#if USE_NETCORE && (PLATFORM_LINUX || PLATFORM_MAC)
|
||||||
|
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build");
|
||||||
|
#else
|
||||||
|
return Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build.exe");
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool ScriptsBuilder::LastCompilationFailed()
|
bool ScriptsBuilder::LastCompilationFailed()
|
||||||
{
|
{
|
||||||
return _lastCompilationFailed;
|
return _lastCompilationFailed;
|
||||||
@@ -221,11 +230,7 @@ void ScriptsBuilder::Compile()
|
|||||||
bool ScriptsBuilder::RunBuildTool(const StringView& args, const StringView& workingDir)
|
bool ScriptsBuilder::RunBuildTool(const StringView& args, const StringView& workingDir)
|
||||||
{
|
{
|
||||||
PROFILE_CPU();
|
PROFILE_CPU();
|
||||||
#if USE_NETCORE && (PLATFORM_LINUX || PLATFORM_MAC)
|
const String buildToolPath = GetBuildToolPath();
|
||||||
const String buildToolPath = Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build");
|
|
||||||
#else
|
|
||||||
const String buildToolPath = Globals::StartupFolder / TEXT("Binaries/Tools/Flax.Build.exe");
|
|
||||||
#endif
|
|
||||||
if (!FileSystem::FileExists(buildToolPath))
|
if (!FileSystem::FileExists(buildToolPath))
|
||||||
{
|
{
|
||||||
Log::FileNotFoundException(buildToolPath).SetLevel(LogType::Fatal);
|
Log::FileNotFoundException(buildToolPath).SetLevel(LogType::Fatal);
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ public:
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
API_PROPERTY() static int32 GetCompilationsCount();
|
API_PROPERTY() static int32 GetCompilationsCount();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the full path to the Flax.Build app.
|
||||||
|
/// </summary>
|
||||||
|
API_PROPERTY() static String GetBuildToolPath();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if last scripting building failed due to errors.
|
/// Checks if last scripting building failed due to errors.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user