Skip to content

Commit b62d9fa

Browse files
committed
Updated variable check to be case insensitive
1 parent 19948c8 commit b62d9fa

File tree

3 files changed

+14
-19
lines changed

3 files changed

+14
-19
lines changed

.yamato/project-builders/project-builders.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,21 @@ build_{{ netcodeProject[0] }}_project:
6262
# Build the project using Unity Editor. This will call the given static BuilderScripts method.
6363
# Ideally, it would be nice to parametrize the BuilderScripts (for example to pass scripting backend as parameter) but -executeMethod only calls static methods without parameters so for now we will have multiple configurations
6464
# Notice that for Android platform even if mono is selected, il2cpp will be used since mono is not supported for Android builds.
65-
- IF "%PLATFORM_WIN64_MAC_ANDROID%"=="win64" (
66-
IF "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
65+
- IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="win64" (
66+
IF /I "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
6767
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget win64 -executeMethod BuilderScripts.BuildWinIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
6868
) ELSE (
6969
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget win64 -executeMethod BuilderScripts.BuildWinMono -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
7070
)
7171
)
72-
ELSE IF "%PLATFORM_WIN64_MAC_ANDROID%"=="mac" (
73-
IF "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
72+
ELSE IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="mac" (
73+
IF /I "%SCRIPTING_BACKEND_IL2CPP_MONO%"=="il2cpp" (
7474
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget osx -executeMethod BuilderScripts.BuildMacIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
7575
) ELSE (
7676
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget osx -executeMethod BuilderScripts.BuildMacMono -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
7777
)
7878
)
79-
ELSE IF "%PLATFORM_WIN64_MAC_ANDROID%"=="android" (
79+
ELSE IF /I "%PLATFORM_WIN64_MAC_ANDROID%"=="android" (
8080
C:/TestingEditor/Unity.exe -projectPath C:/ClonedProject/{{ netcodeProject[1].projectPath }} -buildTarget android -executeMethod BuilderScripts.BuildAndroidIl2cpp -batchmode -logFile ./artifacts/UnityLog.txt -automated -crash-report-folder ./artifacts/CrashArtifacts -quit
8181
)
8282

Tools/scripts/BuildAutomation/disable-enable-burst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def create_config(settings_path):
5252
# Note that this jobs uses environment variables to pass parameters to the script.
5353
def resolve_target():
5454
# Get the platform value from the environment variable
55-
platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID')
55+
platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID').lower()
5656

5757
resolved_target = platform_key
5858
if 'win64' == platform_key:
@@ -95,7 +95,7 @@ def main():
9595
parse_args()
9696
config_names = get_or_create_burst_AOT_config()
9797

98-
platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID')
98+
platform_key = os.environ.get('PLATFORM_WIN64_MAC_ANDROID').lower()
9999
print(f"Burst compilation script: Unity project path is {args.project_path}")
100100
print(f"Burst compilation script: Target platform is {platform_key}")
101101

Tools/scripts/BuildAutomation/validate_params.py

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
import os
22
import sys
33

44
# --- Configuration ---
@@ -17,23 +17,20 @@ def main():
1717
"""
1818
all_params_valid = True
1919

20-
# Iterate through the dictionary of rules.
2120
for var_name, allowed_values in VALIDATION_RULES.items():
22-
# Get the variable's value from the environment.
23-
actual_value = os.environ.get(var_name, '')
21+
actual_value = os.environ.get(var_name, '').lower()
22+
allowed_values_lower = {v.lower() for v in allowed_values}
2423

25-
# Check if the actual value is in the set of allowed values.
26-
if actual_value not in allowed_values:
24+
if actual_value not in allowed_values_lower:
2725
print(
2826
f"ERROR: Invalid {var_name}: '{actual_value}'. "
2927
f"Allowed values are: {list(allowed_values)}",
3028
file=sys.stderr
3129
)
3230
all_params_valid = False
3331

34-
# --- Validation for Invalid Combinations ---
35-
platform = os.environ.get('PLATFORM_WIN64_MAC_ANDROID')
36-
scripting_backend = os.environ.get('SCRIPTING_BACKEND_IL2CPP_MONO')
32+
platform = os.environ.get('PLATFORM_WIN64_MAC_ANDROID', '').lower()
33+
scripting_backend = os.environ.get('SCRIPTING_BACKEND_IL2CPP_MONO', '').lower()
3734

3835
if platform == 'mac' and scripting_backend == 'il2cpp':
3936
print(
@@ -51,13 +48,11 @@ def main():
5148
)
5249
all_params_valid = False
5350

54-
# --- Final Result ---
5551
if not all_params_valid:
5652
print("\nOne or more parameters failed validation. Halting build.", file=sys.stderr)
57-
# Exit with a non-zero code to fail the Yamato job.
5853
sys.exit(1)
5954

6055
print("All parameters are valid. Proceeding with the build.")
6156

6257
if __name__ == "__main__":
63-
main()
58+
main()

0 commit comments

Comments
 (0)