Disable partial crossgen.
This will crossgen all the methods but the size of aseemblies increase.
This commit is contained in:
parent
d6fe71d4dd
commit
59f81484bb
2 changed files with 23 additions and 9 deletions
|
@ -5,16 +5,17 @@ namespace Microsoft.DotNet.Cli.Build.Framework
|
||||||
public static class BuildHelpers
|
public static class BuildHelpers
|
||||||
{
|
{
|
||||||
public static int ExecInSilent(string workingDirectory, string command, params string[] args) => ExecInSilent(workingDirectory, command, (IEnumerable<string>)args);
|
public static int ExecInSilent(string workingDirectory, string command, params string[] args) => ExecInSilent(workingDirectory, command, (IEnumerable<string>)args);
|
||||||
public static int ExecInSilent(string workingDirectory, string command, IEnumerable<string> args) => ExecCore(command, args, workingDirectory, silent: true);
|
public static int ExecInSilent(string workingDirectory, string command, IEnumerable<string> args) => ExecCore(command, args, workingDirectory, silent: true, env: null);
|
||||||
|
|
||||||
public static int ExecIn(string workingDirectory, string command, params string[] args) => ExecIn(workingDirectory, command, (IEnumerable<string>)args);
|
public static int ExecIn(string workingDirectory, string command, params string[] args) => ExecIn(workingDirectory, command, (IEnumerable<string>)args);
|
||||||
public static int ExecIn(string workingDirectory, string command, IEnumerable<string> args) => ExecCore(command, args, workingDirectory, silent: false);
|
public static int ExecIn(string workingDirectory, string command, IEnumerable<string> args) => ExecCore(command, args, workingDirectory, silent: false, env: null);
|
||||||
|
|
||||||
public static int ExecSilent(string command, params string[] args) => ExecSilent(command, (IEnumerable<string>)args);
|
public static int ExecSilent(string command, params string[] args) => ExecSilent(command, (IEnumerable<string>)args);
|
||||||
public static int ExecSilent(string command, IEnumerable<string> args) => ExecCore(command, args, workingDirectory: null, silent: true);
|
public static int ExecSilent(string command, IEnumerable<string> args) => ExecSilent(command, args, env: null);
|
||||||
|
public static int ExecSilent(string command, IEnumerable<string> args, IDictionary<string, string> env) => ExecCore(command, args, workingDirectory: null, silent: true, env: null);
|
||||||
|
|
||||||
public static int Exec(string command, params string[] args) => Exec(command, (IEnumerable<string>)args);
|
public static int Exec(string command, params string[] args) => Exec(command, (IEnumerable<string>)args);
|
||||||
public static int Exec(string command, IEnumerable<string> args) => ExecCore(command, args, workingDirectory: null, silent: false);
|
public static int Exec(string command, IEnumerable<string> args) => ExecCore(command, args, workingDirectory: null, silent: false, env: null);
|
||||||
|
|
||||||
public static Command Cmd(string command, params string[] args) => Cmd(command, (IEnumerable<string>)args);
|
public static Command Cmd(string command, params string[] args) => Cmd(command, (IEnumerable<string>)args);
|
||||||
public static Command Cmd(string command, IEnumerable<string> args)
|
public static Command Cmd(string command, IEnumerable<string> args)
|
||||||
|
@ -22,21 +23,29 @@ namespace Microsoft.DotNet.Cli.Build.Framework
|
||||||
return Command.Create(command, args);
|
return Command.Create(command, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static int ExecCore(string command, IEnumerable<string> args, string workingDirectory, bool silent)
|
internal static int ExecCore(string command, IEnumerable<string> args, string workingDirectory, bool silent, IDictionary<string, string> env)
|
||||||
{
|
{
|
||||||
var cmd = Cmd(command, args);
|
var cmd = Cmd(command, args);
|
||||||
if(!string.IsNullOrEmpty(workingDirectory))
|
if (!string.IsNullOrEmpty(workingDirectory))
|
||||||
{
|
{
|
||||||
cmd.WorkingDirectory(workingDirectory);
|
cmd.WorkingDirectory(workingDirectory);
|
||||||
}
|
}
|
||||||
if(silent)
|
|
||||||
|
if (silent)
|
||||||
{
|
{
|
||||||
cmd.CaptureStdErr().CaptureStdOut();
|
cmd.CaptureStdErr().CaptureStdOut();
|
||||||
}
|
}
|
||||||
var result = cmd.Execute();
|
|
||||||
|
if (env == null)
|
||||||
|
{
|
||||||
|
env = new Dictionary<string, string>();
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = cmd.Environment(env).Execute();
|
||||||
|
|
||||||
result.EnsureSuccessful();
|
result.EnsureSuccessful();
|
||||||
return result.ExitCode;
|
return result.ExitCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,7 +99,12 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
"-platform_assemblies_paths", $"{sharedFxPath};{pathToAssemblies};{addtionalPaths}"
|
"-platform_assemblies_paths", $"{sharedFxPath};{pathToAssemblies};{addtionalPaths}"
|
||||||
};
|
};
|
||||||
|
|
||||||
ExecSilent(_crossGenPath, crossgenArgs);
|
var env = new Dictionary<string, string>()
|
||||||
|
{
|
||||||
|
// disable partial ngen
|
||||||
|
{ "COMPLUS_ZapDisable", "0" }
|
||||||
|
};
|
||||||
|
ExecSilent(_crossGenPath, crossgenArgs, env);
|
||||||
|
|
||||||
File.Delete(file);
|
File.Delete(file);
|
||||||
File.Move(tempPathName, file);
|
File.Move(tempPathName, file);
|
||||||
|
|
Loading…
Add table
Reference in a new issue