Another iteration on cooking job

This commit is contained in:
Wojtek Figat
2024-12-05 15:29:24 +01:00
parent 987916cc1c
commit 0ef1220846
3 changed files with 119 additions and 10 deletions

78
.github/data/Build Settings.json vendored Normal file
View File

@@ -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
}
]
}
]
}
}

View File

@@ -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"

View File

@@ -468,13 +468,12 @@ int32 MacPlatform::CreateProcess(CreateProcessSettings& settings)
if (settings.WaitForEnd)
{
id<NSObject> outputObserver = nil;
id<NSObject> 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;