using System.Collections.Generic;
using UnityEngine;
namespace Ubisoft.Hotel.PackageManager.Editor
{
internal class BuildSettings : ScriptableObject
{
internal const string BUILD_PARAM_ADDRESSABLES = "addressables";
///
/// 'lightweight' param enables 'ExportProject' which means that the artifact is not generated. It's used to make sure that
/// the app compiles. It's used by CICD to reduce build times, typically to blame compilation errors on a particular commit.
/// -)iOS: always lightweight builds, since Unity can't export the ipa. It produces XCode project.
/// -)Android: A lightweight build produces the Android Studio project, otherwise an .apk or .abb file (depending on configuration) is produced.
/// -)Windows: A lightweight build produces the Visual Studio project, otherwise an .exe file is produced.
///
internal const string BUILD_PARAM_LIGHTWEIGHT = "lightweight";
private static readonly List BUILD_PARAMS = new List()
{
BUILD_PARAM_ADDRESSABLES,
BUILD_PARAM_LIGHTWEIGHT
};
[SerializeField]
private bool m_buildAddressables;
[SerializeField]
private bool m_exportProject;
[SerializeField]
private bool m_askForLocation;
internal bool BuildAddressables
{
get { return m_buildAddressables; }
set { m_buildAddressables = value; }
}
internal bool ExportProject
{
get { return m_exportProject; }
set { m_exportProject = value; }
}
internal bool AskForLocation
{
get { return m_askForLocation; }
set { m_askForLocation = value; }
}
internal bool ProcessBuildParams(string name, string value)
{
bool returnValue = BUILD_PARAMS.Contains(name);
if (returnValue)
{
switch (name)
{
case BUILD_PARAM_LIGHTWEIGHT:
{
_ = HtBool.TryParse(value, out bool boolValue);
ExportProject = boolValue;
}
break;
case BUILD_PARAM_ADDRESSABLES:
{
_ = HtBool.TryParse(value, out bool boolValue);
BuildAddressables = boolValue;
}
break;
/*
case BUILD_PARAM_VERSION:
Build_ParamVersion = KeyToEVersion(value);
break;*/
}
}
return returnValue;
}
}
}