[mtouch/mmp] Move Driver's LOCAL_BUILD_DIR and FRAMEWORK_LOCATION_VARIABLE constants to Application instance fields. (#9320)

This commit is contained in:
Rolf Bjarne Kvinge 2020-08-10 10:47:35 +02:00 коммит произвёл GitHub
Родитель d8665ddd63
Коммит 916e79b8d2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 31 добавлений и 6 удалений

Просмотреть файл

@ -88,6 +88,35 @@ namespace Xamarin.Bundler {
public List<Application> SharedCodeApps = new List<Application> (); // List of appexes we're sharing code with.
public string RegistrarOutputLibrary;
public string LocalBuildDir {
get {
switch (Platform) {
case ApplePlatform.iOS:
case ApplePlatform.TVOS:
case ApplePlatform.WatchOS:
return "_ios-build";
case ApplePlatform.MacOSX:
return "_mac-build";
default:
throw ErrorHelper.CreateError (71, Errors.MX0071, Platform, ProductName);
}
}
}
public string FrameworkLocationVariable {
get {
switch (Platform) {
case ApplePlatform.iOS:
case ApplePlatform.TVOS:
case ApplePlatform.WatchOS:
return "MD_MTOUCH_SDK_ROOT";
case ApplePlatform.MacOSX:
return "XAMMAC_FRAMEWORK_PATH";
default:
throw ErrorHelper.CreateError (71, Errors.MX0071, Platform, ProductName);
}
}
}
public static int Concurrency => Driver.Concurrency;
public Version DeploymentTarget;
public Version SdkVersion;

Просмотреть файл

@ -738,7 +738,7 @@ namespace Xamarin.Bundler {
var localPath = Path.GetDirectoryName (GetFullPath ());
while (localPath.Length > 1) {
if (File.Exists (Path.Combine (localPath, "Make.config"))) {
local_build = Path.Combine (localPath, LOCAL_BUILD_DIR, "Library", "Frameworks", app.ProductName + ".framework", "Versions", "Current");
local_build = Path.Combine (localPath, app.LocalBuildDir, "Library", "Frameworks", app.ProductName + ".framework", "Versions", "Current");
return local_build;
}
@ -754,7 +754,7 @@ namespace Xamarin.Bundler {
public static string GetFrameworkCurrentDirectory (Application app)
{
if (framework_dir == null) {
var env_framework_dir = Environment.GetEnvironmentVariable (FRAMEWORK_LOCATION_VARIABLE);
var env_framework_dir = Environment.GetEnvironmentVariable (app.FrameworkLocationVariable);
if (!string.IsNullOrEmpty (env_framework_dir)) {
framework_dir = env_framework_dir;
} else {

Просмотреть файл

@ -61,8 +61,6 @@ namespace Xamarin.Bundler {
public static partial class Driver {
internal const string NAME = "mmp";
const string LOCAL_BUILD_DIR = "_mac-build";
const string FRAMEWORK_LOCATION_VARIABLE = "XAMMAC_FRAMEWORK_PATH";
internal static Application App = new Application (Environment.GetCommandLineArgs ());
static Target BuildTarget;
static List<string> resources = new List<string> ();

Просмотреть файл

@ -79,8 +79,6 @@ namespace Xamarin.Bundler
{
public partial class Driver {
internal const string NAME = "mtouch";
const string LOCAL_BUILD_DIR = "_ios-build";
const string FRAMEWORK_LOCATION_VARIABLE = "MD_MTOUCH_SDK_ROOT";
public static void ShowHelp (OptionSet os)
{