Add Android Build Settings
This commit is contained in:
committed by
Webber Takken
parent
3523c6a934
commit
6ece6447b2
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
|
||||
namespace UnityBuilderAction.Input
|
||||
{
|
||||
public class AndroidSettings
|
||||
{
|
||||
public static void Apply(Dictionary<string, string> options)
|
||||
{
|
||||
EditorUserBuildSettings.buildAppBundle = options["customBuildPath"].EndsWith(".aab");
|
||||
if (options.TryGetValue("androidKeystoreName", out string keystoreName) && !string.IsNullOrEmpty(keystoreName))
|
||||
PlayerSettings.Android.keystoreName = keystoreName;
|
||||
if (options.TryGetValue("androidKeystorePass", out string keystorePass) && !string.IsNullOrEmpty(keystorePass))
|
||||
PlayerSettings.Android.keystorePass = keystorePass;
|
||||
if (options.TryGetValue("androidKeyaliasName", out string keyaliasName) && !string.IsNullOrEmpty(keyaliasName))
|
||||
PlayerSettings.Android.keyaliasName = keyaliasName;
|
||||
if (options.TryGetValue("androidKeyaliasPass", out string keyaliasPass) && !string.IsNullOrEmpty(keyaliasPass))
|
||||
PlayerSettings.Android.keyaliasPass = keyaliasPass;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0d51cf8acfff8c941bb753e82750b60a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
|
||||
namespace UnityBuilderAction.Input
|
||||
@@ -7,6 +8,7 @@ namespace UnityBuilderAction.Input
|
||||
public class ArgumentsParser
|
||||
{
|
||||
static string EOL = Environment.NewLine;
|
||||
static readonly string[] Secrets = { "androidKeystorePass", "androidKeyaliasName", "androidKeyaliasPass" };
|
||||
|
||||
public static Dictionary<string, string> GetValidatedOptions()
|
||||
{
|
||||
@@ -66,9 +68,11 @@ namespace UnityBuilderAction.Input
|
||||
// Parse optional value
|
||||
bool flagHasValue = next < args.Length && !args[next].StartsWith("-");
|
||||
string value = flagHasValue ? args[next].TrimStart('-') : "";
|
||||
bool secret = Secrets.Contains(flag);
|
||||
string displayValue = secret ? "*HIDDEN*" : "\"" + value + "\"";
|
||||
|
||||
// Assign
|
||||
Console.WriteLine($"Found flag \"{flag}\" with value \"{value}\".");
|
||||
Console.WriteLine($"Found flag \"{flag}\" with value {displayValue}.");
|
||||
providedArguments.Add(flag, value);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user