Skip to content

Commit

Permalink
Removed all instances of interpolated strings from editor scripts so …
Browse files Browse the repository at this point in the history
…we don't get compiler errors on old versions of .NET in Unity 2018 (#633)

Co-authored-by: Zac <zac@dickinson.xyz>
Co-authored-by: Andrew Kahr <22359829+AndrewKahr@users.noreply.github.com>
Co-authored-by: David Finol <davidmfinol@gmail.com>
  • Loading branch information
4 people authored Oct 10, 2024
1 parent b11b6a6 commit 83c8532
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void BuildProject()
}
catch (Exception e)
{
Debug.LogError($"Failed to run default addressables build:\n{e}");
Debug.LogError("Failed to run default addressables build:\n" + e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ public static void Apply(Dictionary<string, string> options)
case "androidStudioProject":
EditorUserBuildSettings.exportAsGoogleAndroidProject = true;
if (buildAppBundle != null)
buildAppBundle.SetValue(null, false);
buildAppBundle.SetValue(null, false, null);
break;
case "androidAppBundle":
EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
if (buildAppBundle != null)
buildAppBundle.SetValue(null, true);
buildAppBundle.SetValue(null, true, null);
break;
case "androidPackage":
EditorUserBuildSettings.exportAsGoogleAndroidProject = false;
if (buildAppBundle != null)
buildAppBundle.SetValue(null, false);
buildAppBundle.SetValue(null, false, null);
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static Dictionary<string, string> GetValidatedOptions()
}

if (!Enum.IsDefined(typeof(BuildTarget), buildTarget)) {
Console.WriteLine($"{buildTarget} is not a defined {nameof(BuildTarget)}");
Console.WriteLine(buildTarget + " is not a defined " + typeof(BuildTarget).Name);
EditorApplication.Exit(121);
}

Expand All @@ -41,10 +41,10 @@ public static Dictionary<string, string> GetValidatedOptions()
const string defaultCustomBuildName = "TestBuild";
string customBuildName;
if (!validatedOptions.TryGetValue("customBuildName", out customBuildName)) {
Console.WriteLine($"Missing argument -customBuildName, defaulting to {defaultCustomBuildName}.");
Console.WriteLine("Missing argument -customBuildName, defaulting to" + defaultCustomBuildName);
validatedOptions.Add("customBuildName", defaultCustomBuildName);
} else if (customBuildName == "") {
Console.WriteLine($"Invalid argument -customBuildName, defaulting to {defaultCustomBuildName}.");
Console.WriteLine("Invalid argument -customBuildName, defaulting to" + defaultCustomBuildName);
validatedOptions.Add("customBuildName", defaultCustomBuildName);
}

Expand All @@ -57,11 +57,11 @@ static void ParseCommandLineArguments(out Dictionary<string, string> providedArg
string[] args = Environment.GetCommandLineArgs();

Console.WriteLine(
$"{EOL}" +
$"###########################{EOL}" +
$"# Parsing settings #{EOL}" +
$"###########################{EOL}" +
$"{EOL}"
EOL +
"###########################" + EOL +
"# Parsing settings #" + EOL +
"###########################" + EOL +
EOL
);

// Extract flags with optional values
Expand All @@ -78,7 +78,7 @@ static void ParseCommandLineArguments(out Dictionary<string, string> providedArg
string displayValue = secret ? "*HIDDEN*" : "\"" + value + "\"";

// Assign
Console.WriteLine($"Found flag \"{flag}\" with value {displayValue}.");
Console.WriteLine("Found flag \"" + flag + "\" with value " + displayValue);
providedArguments.Add(flag, value);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static void Application_logMessageReceived(string condition, string stac
prefix = "error";
break;
}
Console.WriteLine($"{Environment.NewLine}::{prefix} ::{condition}{Environment.NewLine}{stackTrace}");
Console.WriteLine(Environment.NewLine + "::" + prefix + "::" + condition + Environment.NewLine + stackTrace);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ public class StdOutReporter
public static void ReportSummary(BuildSummary summary)
{
Console.WriteLine(
$"{EOL}" +
$"###########################{EOL}" +
$"# Build results #{EOL}" +
$"###########################{EOL}" +
$"{EOL}" +
$"Duration: {summary.totalTime.ToString()}{EOL}" +
$"Warnings: {summary.totalWarnings.ToString()}{EOL}" +
$"Errors: {summary.totalErrors.ToString()}{EOL}" +
$"Size: {summary.totalSize.ToString()} bytes{EOL}" +
$"{EOL}"
EOL +
"###########################" + EOL +
"# Build results #" + EOL +
"###########################" + EOL +
EOL +
"Duration: " + summary.totalTime.ToString() + EOL +
"Warnings: " + summary.totalWarnings.ToString() + EOL +
"Errors: " + summary.totalErrors.ToString() + EOL +
"Size: " + summary.totalSize.ToString() + " bytes" + EOL +
EOL
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ public static string GenerateSemanticCommitVersion()
version = GetSemanticCommitVersion();
Console.WriteLine("Repository has a valid version tag.");
} else {
version = $"0.0.{GetTotalNumberOfCommits()}";
version = "0.0." + GetTotalNumberOfCommits();
Console.WriteLine("Repository does not have tags to base the version on.");
}

Console.WriteLine($"Version is {version}");
Console.WriteLine("Version is " + version);

return version;
}
Expand Down

0 comments on commit 83c8532

Please sign in to comment.