- Fixed bug in builder when no content files exist
This commit is contained in:
parent
dd3bbf1d5b
commit
d45f7c3b8c
@ -37,12 +37,15 @@ public void Run(BuildArgs args)
|
|||||||
CollectAssetFiles(absContentPath, absContentPath, ref contentFiles);
|
CollectAssetFiles(absContentPath, absContentPath, ref contentFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (contentFiles.Count > 0)
|
||||||
|
{
|
||||||
string importPath = $"{args.ProjectPath}/{PathUtil.ImportFolderName}";
|
string importPath = $"{args.ProjectPath}/{PathUtil.ImportFolderName}";
|
||||||
|
|
||||||
ParallelOptions parallelOptions = new ParallelOptions
|
ParallelOptions parallelOptions = new ParallelOptions
|
||||||
{
|
{
|
||||||
MaxDegreeOfParallelism = contentFiles.Count
|
MaxDegreeOfParallelism = contentFiles.Count
|
||||||
};
|
};
|
||||||
|
|
||||||
Parallel.ForEach(contentFiles, parallelOptions, relativeFile =>
|
Parallel.ForEach(contentFiles, parallelOptions, relativeFile =>
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
@ -89,13 +92,14 @@ public void Run(BuildArgs args)
|
|||||||
Console.Error.WriteLine($"Import error on asset '{relativeFile}': {e.Message}");
|
Console.Error.WriteLine($"Import error on asset '{relativeFile}': {e.Message}");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Console.WriteLine($"Build content completed in {stopwatch.Elapsed.TotalSeconds:F2} seconds");
|
Console.WriteLine($"Build content completed in {stopwatch.Elapsed.TotalSeconds:F2} seconds");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CopyLibs(string projectPath)
|
private void CopyLibs(string projectPath)
|
||||||
{
|
{
|
||||||
string libDir = $"{Directory.GetCurrentDirectory()}/../../Native/";
|
string libDir = $"{AppDomain.CurrentDomain.BaseDirectory}/../../Native/";
|
||||||
if (OperatingSystem.IsWindows())
|
if (OperatingSystem.IsWindows())
|
||||||
{
|
{
|
||||||
libDir += "x64";
|
libDir += "x64";
|
||||||
|
@ -27,4 +27,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Import Project=".\CopyLibs.targets"/>
|
<Import Project=".\CopyLibs.targets"/>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command=""$(ProjectDir)../Tools/Nerfed.Builder/Nerfed.Builder" -build -projectPath $(ProjectDir) -platform Desktop" />
|
||||||
|
</Target>
|
||||||
</Project>
|
</Project>
|
||||||
|
Loading…
Reference in New Issue
Block a user