[mtouch/mmp] Make --setenv available to mmp as well. (#8572)

The actual implementation will be added in a later PR, when the code to
generate main is unified between mtouch and mmp.
This commit is contained in:
Rolf Bjarne Kvinge 2020-05-13 08:50:20 +02:00 коммит произвёл GitHub
Родитель 5f786dead4
Коммит 3e1862ada9
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 12 добавлений и 12 удалений

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

@ -71,6 +71,8 @@ namespace Xamarin.Bundler {
public bool EnableProfiling;
public bool? DebugTrack;
public Dictionary<string, string> EnvironmentVariables = new Dictionary<string, string> ();
public MarshalObjectiveCExceptionMode MarshalObjectiveCExceptions;
public MarshalManagedExceptionMode MarshalManagedExceptions;

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

@ -193,6 +193,16 @@ namespace Xamarin.Bundler {
options.Add ("package-debug-symbols:", "Specify whether debug info files (*.mdb / *.pdb) should be packaged in the app. Default is 'true' for debug builds and 'false' for release builds.", v => app.PackageManagedDebugSymbols = ParseBool (v, "package-debug-symbols"));
options.Add ("profiling:", "Enable profiling", v => app.EnableProfiling = ParseBool (v, "profiling"));
options.Add ("debugtrack:", "Enable debug tracking of object resurrection bugs", v => { app.DebugTrack = ParseBool (v, "--debugtrack"); });
options.Add ("setenv=", "Set the environment variable in the application on startup", v => {
int eq = v.IndexOf ('=');
if (eq <= 0)
throw ErrorHelper.CreateError (2, Errors.MT0002, v);
var name = v.Substring (0, eq);
var value = v.Substring (eq + 1);
app.EnvironmentVariables.Add (name, value);
}
);
// Keep the ResponseFileSource option at the end.
options.Add (new Mono.Options.ResponseFileSource ());
try {

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

@ -88,8 +88,6 @@ namespace Xamarin.Bundler {
public bool UseInterpreter;
public List<string> InterpretedAssemblies = new List<string> ();
public Dictionary<string, string> EnvironmentVariables = new Dictionary<string, string> ();
//
// Linker config
//

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

@ -859,16 +859,6 @@ namespace Xamarin.Bundler
{ "launch-for-background-fetch", "Launch due to a background fetch [DEPRECATED]", v => { }, true},
{ "debugsim=", "Debug the specified MonoTouch.app in the simulator [DEPRECATED]", v => { SetAction (Action.DebugSim); }, true },
{ "argument=", "Launch the app with this command line argument. This must be specified multiple times for multiple arguments [DEPRECATED]", v => { }, true },
{ "setenv=", "Set the environment variable in the application on startup", v =>
{
int eq = v.IndexOf ('=');
if (eq <= 0)
throw new MonoTouchException (2, true, Errors.MT0002, v);
string name = v.Substring (0, eq);
string value = v.Substring (eq + 1);
app.EnvironmentVariables.Add (name, value);
}
},
{ "sgen:", "Enable the SGen garbage collector",
v => {
if (!ParseBool (v, "sgen"))