diff --git a/.github/data/Build Settings.json b/.github/data/Build Settings.json new file mode 100644 index 000000000..955468fa6 --- /dev/null +++ b/.github/data/Build Settings.json @@ -0,0 +1,78 @@ +{ + "ID": "2364031e4e327637c1ad88b415fa756e", + "TypeName": "FlaxEditor.Content.Settings.BuildSettings", + "EngineBuild": 6605, + "Data": { + "OutputName": "${PROJECT_NAME}", + "MaxAssetsPerPackage": 4096, + "MaxPackageSizeMB": 1024, + "ContentKey": 0, + "ForDistribution": false, + "SkipPackaging": true, + "AdditionalAssets": null, + "AdditionalScenes": null, + "AdditionalAssetFolders": null, + "ShadersNoOptimize": false, + "ShadersGenerateDebugData": false, + "SkipDefaultFonts": false, + "SkipDotnetPackaging": false, + "SkipUnusedDotnetLibsPackaging": true, + "Presets": [ + { + "Name": "Development", + "Targets": [ + { + "Name": "Windows", + "Output": "Output\\Windows", + "Platform": 2, + "Mode": 1, + "CustomDefines": null, + "PreBuildAction": null, + "PostBuildAction": null + }, + { + "Name": "Linux", + "Output": "Output\\LInux", + "Platform": 6, + "Mode": 1, + "CustomDefines": null, + "PreBuildAction": null, + "PostBuildAction": null + }, + { + "Name": "Android", + "Output": "Output\\Android", + "Platform": 9, + "Mode": 1, + "CustomDefines": null, + "PreBuildAction": null, + "PostBuildAction": null + }, + { + "Name": "iOS", + "Output": "Output\\iOS", + "Platform": 14, + "Mode": 1, + "CustomDefines": null, + "PreBuildAction": null, + "PostBuildAction": null + } + ] + }, + { + "Name": "Release", + "Targets": [ + { + "Name": "Windows", + "Output": "Output\\Windows", + "Platform": 2, + "Mode": 2, + "CustomDefines": null, + "PreBuildAction": null, + "PostBuildAction": null + } + ] + } + ] +} +} \ No newline at end of file diff --git a/.github/workflows/cooking.yml b/.github/workflows/cooking.yml index f8d5afe94..b5cfb1fd0 100644 --- a/.github/workflows/cooking.yml +++ b/.github/workflows/cooking.yml @@ -32,18 +32,21 @@ jobs: fetch-depth: 1 repository: FlaxEngine/FlaxSamples path: FlaxSamples - - name: Build Editor + - name: Path Files run: | cp .github\data\ExitOnEsc.cs FlaxSamples\MaterialsFeaturesTour\Source\Game + cp ".github\data\Build Settings.json" "FlaxSamples\MaterialsFeaturesTour\Content\Settings" + - name: Build Editor + run: | .\Development\Scripts\Windows\CallBuildTool.bat -build -log -printSDKs -dotnet=8 -arch=x64 -platform=Windows -configuration=Development -buildtargets=FlaxEditor - name: Cook Game (Windows) - shell: cmd + shell: bash run: | - Binaries\Editor\Win64\Development\FlaxEditor.exe -std -headless -mute -null -project "FlaxSamples\MaterialsFeaturesTour" -build "Development.Windows" + ./Binaries/Editor/Win64/Development/FlaxEditor.exe -std -headless -mute -null -project "FlaxSamples/MaterialsFeaturesTour" -build "Development.Windows" - name: Test Game (Windows) - shell: cmd + shell: bash run: | - FlaxSamples\MaterialsFeaturesTour\Output\Windows\MaterialsFeaturesTour.exe -std -headless -mute -null + ./FlaxSamples/MaterialsFeaturesTour/Output/Windows/MaterialsFeaturesTour.exe -std -headless -mute -null # Cook on Mac cook-mac: @@ -75,10 +78,13 @@ jobs: fetch-depth: 1 repository: FlaxEngine/FlaxSamples path: FlaxSamples + - name: Path Files + run: | + cp .github/data/ExitOnEsc.cs FlaxSamples/MaterialsFeaturesTour/Source/Game + cp ".github/data/Build Settings.json" "FlaxSamples/MaterialsFeaturesTour/Content/Settings" - name: Build Editor run: | ./Development/Scripts/Mac/CallBuildTool.sh -build -log -printSDKs -dotnet=8 -arch=ARM64 -platform=Mac -configuration=Development -buildtargets=FlaxEditor - name: Cook Game (iOS) run: | - cp .github/data/ExitOnEsc.cs FlaxSamples/MaterialsFeaturesTour/Source/Game ./Binaries/Editor/Mac/Development/FlaxEditor -std -headless -mute -null -project "FlaxSamples/MaterialsFeaturesTour" -build "Development.iOS" diff --git a/Source/Engine/Platform/Mac/MacPlatform.cpp b/Source/Engine/Platform/Mac/MacPlatform.cpp index c14195d0b..6962949e2 100644 --- a/Source/Engine/Platform/Mac/MacPlatform.cpp +++ b/Source/Engine/Platform/Mac/MacPlatform.cpp @@ -468,13 +468,12 @@ int32 MacPlatform::CreateProcess(CreateProcessSettings& settings) if (settings.WaitForEnd) { id outputObserver = nil; + id outputObserverError = nil; if (captureStdOut) { - NSPipe *stdoutPipe = [NSPipe pipe]; + NSPipe* stdoutPipe = [NSPipe pipe]; [task setStandardOutput:stdoutPipe]; - [task setStandardError:stdoutPipe]; - outputObserver = [[NSNotificationCenter defaultCenter] addObserverForName: NSFileHandleDataAvailableNotification object: [stdoutPipe fileHandleForReading] @@ -498,8 +497,34 @@ int32 MacPlatform::CreateProcess(CreateProcessSettings& settings) } } ]; - [[stdoutPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; + + NSPipe *stderrPipe = [NSPipe pipe]; + [task setStandardError:stderrPipe]; + outputObserverError = [[NSNotificationCenter defaultCenter] + addObserverForName: NSFileHandleDataAvailableNotification + object: [stderrPipe fileHandleForReading] + queue: nil + usingBlock:^(NSNotification* notification) + { + NSData* data = [stderrPipe fileHandleForReading].availableData; + if (data.length) + { + String line((const char*)data.bytes, data.length); + if (settings.SaveOutput) + settings.Output.Add(line.Get(), line.Length()); + if (settings.LogOutput) + { + StringView lineView(line); + if (line[line.Length() - 1] == '\n') + lineView = StringView(line.Get(), line.Length() - 1); + Log::Logger::Write(LogType::Error, lineView); + } + [[stderrPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; + } + } + ]; + [[stderrPipe fileHandleForReading] waitForDataInBackgroundAndNotify]; } String exception;