Remove out variable declaration to support Unity 2018 in default build script. Remove <2019.3 versions of unity from windows builder as IL2CPP isn't supported until 2019.3.
parent
1e84cce86e
commit
7d3a5d5876
|
|
@ -42,11 +42,6 @@ jobs:
|
||||||
projectPath:
|
projectPath:
|
||||||
- test-project
|
- test-project
|
||||||
unityVersion:
|
unityVersion:
|
||||||
- 2018.2.21f1
|
|
||||||
- 2018.3.14f1
|
|
||||||
- 2018.4.36f1
|
|
||||||
- 2019.1.14f1
|
|
||||||
- 2019.2.21f1
|
|
||||||
- 2019.3.15f1
|
- 2019.3.15f1
|
||||||
- 2019.4.40f1
|
- 2019.4.40f1
|
||||||
- 2020.1.17f1
|
- 2020.1.17f1
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,21 @@ namespace UnityBuilderAction.Input
|
||||||
PlayerSettings.Android.keystoreName = keystoreName;
|
PlayerSettings.Android.keystoreName = keystoreName;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (options.TryGetValue("androidKeystorePass", out string keystorePass) && !string.IsNullOrEmpty(keystorePass))
|
// Can't use out variable declaration as Unity 2018 doesn't support it
|
||||||
|
string keystorePass;
|
||||||
|
if (options.TryGetValue("androidKeystorePass", out keystorePass) && !string.IsNullOrEmpty(keystorePass))
|
||||||
PlayerSettings.Android.keystorePass = keystorePass;
|
PlayerSettings.Android.keystorePass = keystorePass;
|
||||||
if (options.TryGetValue("androidKeyaliasName", out string keyaliasName) && !string.IsNullOrEmpty(keyaliasName))
|
|
||||||
|
string keyAliasName;
|
||||||
|
if (options.TryGetValue("androidKeyaliasName", out keyaliasName) && !string.IsNullOrEmpty(keyaliasName))
|
||||||
PlayerSettings.Android.keyaliasName = keyaliasName;
|
PlayerSettings.Android.keyaliasName = keyaliasName;
|
||||||
if (options.TryGetValue("androidKeyaliasPass", out string keyaliasPass) && !string.IsNullOrEmpty(keyaliasPass))
|
|
||||||
|
string keyaliasPass;
|
||||||
|
if (options.TryGetValue("androidKeyaliasPass", out keyaliasPass) && !string.IsNullOrEmpty(keyaliasPass))
|
||||||
PlayerSettings.Android.keyaliasPass = keyaliasPass;
|
PlayerSettings.Android.keyaliasPass = keyaliasPass;
|
||||||
if (options.TryGetValue("androidTargetSdkVersion", out string androidTargetSdkVersion) && !string.IsNullOrEmpty(androidTargetSdkVersion))
|
|
||||||
|
string androidTargetSdkVersion;
|
||||||
|
if (options.TryGetValue("androidTargetSdkVersion", out androidTargetSdkVersion) && !string.IsNullOrEmpty(androidTargetSdkVersion))
|
||||||
{
|
{
|
||||||
var targetSdkVersion = AndroidSdkVersions.AndroidApiLevelAuto;
|
var targetSdkVersion = AndroidSdkVersions.AndroidApiLevelAuto;
|
||||||
try
|
try
|
||||||
|
|
@ -36,7 +44,8 @@ namespace UnityBuilderAction.Input
|
||||||
PlayerSettings.Android.targetSdkVersion = targetSdkVersion;
|
PlayerSettings.Android.targetSdkVersion = targetSdkVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.TryGetValue("androidExportType", out string androidExportType) && !string.IsNullOrEmpty(androidExportType))
|
string androidExportType;
|
||||||
|
if (options.TryGetValue("androidExportType", out androidExportType) && !string.IsNullOrEmpty(androidExportType))
|
||||||
{
|
{
|
||||||
switch (androidExportType)
|
switch (androidExportType)
|
||||||
{
|
{
|
||||||
|
|
@ -55,7 +64,8 @@ namespace UnityBuilderAction.Input
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.TryGetValue("androidSymbolType", out string symbolType) && !string.IsNullOrEmpty(symbolType))
|
string symbolType;
|
||||||
|
if (options.TryGetValue("androidSymbolType", out symbolType) && !string.IsNullOrEmpty(symbolType))
|
||||||
{
|
{
|
||||||
#if UNITY_2021_1_OR_NEWER
|
#if UNITY_2021_1_OR_NEWER
|
||||||
switch (symbolType)
|
switch (symbolType)
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,17 @@ namespace UnityBuilderAction.Input
|
||||||
|
|
||||||
public static Dictionary<string, string> GetValidatedOptions()
|
public static Dictionary<string, string> GetValidatedOptions()
|
||||||
{
|
{
|
||||||
ParseCommandLineArguments(out var validatedOptions);
|
Dictionary<string, string> validatedOptions;
|
||||||
|
ParseCommandLineArguments(out validatedOptions);
|
||||||
|
|
||||||
if (!validatedOptions.TryGetValue("projectPath", out var projectPath)) {
|
string projectPath;
|
||||||
|
if (!validatedOptions.TryGetValue("projectPath", out projectPath)) {
|
||||||
Console.WriteLine("Missing argument -projectPath");
|
Console.WriteLine("Missing argument -projectPath");
|
||||||
EditorApplication.Exit(110);
|
EditorApplication.Exit(110);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validatedOptions.TryGetValue("buildTarget", out var buildTarget)) {
|
string buildTarget;
|
||||||
|
if (!validatedOptions.TryGetValue("buildTarget", out buildTarget)) {
|
||||||
Console.WriteLine("Missing argument -buildTarget");
|
Console.WriteLine("Missing argument -buildTarget");
|
||||||
EditorApplication.Exit(120);
|
EditorApplication.Exit(120);
|
||||||
}
|
}
|
||||||
|
|
@ -28,13 +31,15 @@ namespace UnityBuilderAction.Input
|
||||||
EditorApplication.Exit(121);
|
EditorApplication.Exit(121);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validatedOptions.TryGetValue("customBuildPath", out var customBuildPath)) {
|
string customBuildPath;
|
||||||
|
if (!validatedOptions.TryGetValue("customBuildPath", out customBuildPath)) {
|
||||||
Console.WriteLine("Missing argument -customBuildPath");
|
Console.WriteLine("Missing argument -customBuildPath");
|
||||||
EditorApplication.Exit(130);
|
EditorApplication.Exit(130);
|
||||||
}
|
}
|
||||||
|
|
||||||
const string defaultCustomBuildName = "TestBuild";
|
const string defaultCustomBuildName = "TestBuild";
|
||||||
if (!validatedOptions.TryGetValue("customBuildName", out var customBuildName)) {
|
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);
|
validatedOptions.Add("customBuildName", defaultCustomBuildName);
|
||||||
} else if (customBuildName == "") {
|
} else if (customBuildName == "") {
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,8 @@ namespace UnityBuilderAction.Versioning
|
||||||
using (var process = new System.Diagnostics.Process()) {
|
using (var process = new System.Diagnostics.Process()) {
|
||||||
string workingDirectory = UnityEngine.Application.dataPath;
|
string workingDirectory = UnityEngine.Application.dataPath;
|
||||||
|
|
||||||
int exitCode = process.Run(application, arguments, workingDirectory, out string output, out string errors);
|
string output, errors;
|
||||||
|
int exitCode = process.Run(application, arguments, workingDirectory, out output, out errors);
|
||||||
if (exitCode != 0) { throw new GitException(exitCode, errors); }
|
if (exitCode != 0) { throw new GitException(exitCode, errors); }
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue