Example #1
0
 //-------------------------------------------------------------------------
 // Android Stuff
 //-------------------------------------------------------------------------
 private static void HandleAndroidAppBundle()
 {
     if (CLITools.TryGetEnv(ANDROID_APP_BUNDLE, out string value))
     {
         if (bool.TryParse(value, out bool buildAppBundle))
         {
             EditorUserBuildSettings.buildAppBundle = buildAppBundle;
             Console.WriteLine($":: {ANDROID_APP_BUNDLE} env var detected, set buildAppBundle to {value}.");
         }
         else
         {
             Console.WriteLine($":: {ANDROID_APP_BUNDLE} env var detected but the value \"{value}\" is not a boolean.");
         }
     }
 }
Example #2
0
 private static void HandleAndroidBundleVersionCode()
 {
     if (CLITools.TryGetEnv(ANDROID_BUNDLE_VERSION_CODE, out string value))
     {
         if (int.TryParse(value, out int version))
         {
             PlayerSettings.Android.bundleVersionCode = version;
             Console.WriteLine($":: {ANDROID_BUNDLE_VERSION_CODE} env var detected, set the bundle version code to {value}.");
         }
         else
         {
             Console.WriteLine($":: {ANDROID_BUNDLE_VERSION_CODE} env var detected but the version value \"{value}\" is not an integer.");
         }
     }
 }
Example #3
0
        private static void HandleAndroidKeystore()
        {
            PlayerSettings.Android.useCustomKeystore = false;

            if (!File.Exists(KEYSTORE))
            {
                Console.WriteLine($":: {KEYSTORE} not found, skipping setup, using Unity's default keystore");
                return;
            }

            PlayerSettings.Android.keystoreName = KEYSTORE;

            string keystorePass;
            string keystoreAliasPass;

            if (CLITools.TryGetEnv(KEY_ALIAS_NAME, out string keyaliasName))
            {
                PlayerSettings.Android.keyaliasName = keyaliasName;
                Console.WriteLine($":: using ${KEY_ALIAS_NAME} env var on PlayerSettings");
            }
            else
            {
                Console.WriteLine($":: ${KEY_ALIAS_NAME} env var not set, using Project's PlayerSettings");
            }

            if (!CLITools.TryGetEnv(KEYSTORE_PASS, out keystorePass))
            {
                Console.WriteLine($":: ${KEYSTORE_PASS} env var not set, skipping setup, using Unity's default keystore");
                return;
            }

            if (!CLITools.TryGetEnv(KEY_ALIAS_PASS, out keystoreAliasPass))
            {
                Console.WriteLine($":: ${KEY_ALIAS_PASS} env var not set, skipping setup, using Unity's default keystore");
                return;
            }

            PlayerSettings.Android.useCustomKeystore = true;
            PlayerSettings.Android.keystorePass      = keystorePass;
            PlayerSettings.Android.keyaliasPass      = keystoreAliasPass;
        }
Example #4
0
        private void SetScriptingBackendFromEnv(BuildTarget platform)
        {
            var targetGroup = BuildPipeline.GetBuildTargetGroup(platform);

            if (CLITools.TryGetEnv(SCRIPTING_BACKEND_ENV_VAR, out string scriptingBackend))
            {
                if (scriptingBackend.TryConvertToEnum(out ScriptingImplementation backend))
                {
                    Console.WriteLine($":: Setting ScriptingBackend to {backend}");
                    PlayerSettings.SetScriptingBackend(targetGroup, backend);
                }
                else
                {
                    string possibleValues = string.Join(", ", Enum.GetValues(typeof(ScriptingImplementation)).Cast <ScriptingImplementation>());
                    throw new Exception($"Could not find '{scriptingBackend}' in ScriptingImplementation enum. Possible values are: {possibleValues}");
                }
            }
            else
            {
                var defaultBackend = PlayerSettings.GetDefaultScriptingBackend(targetGroup);
                Console.WriteLine($":: Using project's configured ScriptingBackend (should be {defaultBackend} for tagetGroup {targetGroup}");
            }
        }