[mtouch] Add support for -j X to specify concurrency. (#876)
This commit is contained in:
Родитель
d4edc453a6
Коммит
0db1fe1ff2
|
@ -1698,7 +1698,7 @@ namespace Xamarin.Bundler {
|
|||
{
|
||||
var next = v.Execute ();
|
||||
if (next != null)
|
||||
Parallel.ForEach (next, new ParallelOptions () { MaxDegreeOfParallelism = Environment.ProcessorCount }, Execute);
|
||||
Parallel.ForEach (next, new ParallelOptions () { MaxDegreeOfParallelism = Driver.Concurrency }, Execute);
|
||||
}
|
||||
|
||||
public void ExecuteInParallel ()
|
||||
|
@ -1706,7 +1706,7 @@ namespace Xamarin.Bundler {
|
|||
if (Count == 0)
|
||||
return;
|
||||
|
||||
Parallel.ForEach (this, new ParallelOptions () { MaxDegreeOfParallelism = Environment.ProcessorCount }, Execute);
|
||||
Parallel.ForEach (this, new ParallelOptions () { MaxDegreeOfParallelism = Driver.Concurrency }, Execute);
|
||||
|
||||
Clear ();
|
||||
}
|
||||
|
|
|
@ -1009,7 +1009,7 @@ namespace Xamarin.Bundler
|
|||
|
||||
if (strip) {
|
||||
// note: this is much slower when Parallel.ForEach is used
|
||||
Parallel.ForEach (Assemblies, new ParallelOptions () { MaxDegreeOfParallelism = Environment.ProcessorCount }, (assembly) =>
|
||||
Parallel.ForEach (Assemblies, new ParallelOptions () { MaxDegreeOfParallelism = Driver.Concurrency }, (assembly) =>
|
||||
{
|
||||
var file = assembly.FullPath;
|
||||
var output = Path.Combine (AppTargetDirectory, Path.GetFileName (assembly.FullPath));
|
||||
|
|
|
@ -150,6 +150,13 @@ namespace Xamarin.Bundler
|
|||
|
||||
public static List<string> classic_only_arguments = new List<string> (); // list of deprecated arguments, which (if used) will cause errors in Unified profile)
|
||||
|
||||
static int Jobs;
|
||||
public static int Concurrency {
|
||||
get {
|
||||
return Jobs == 0 ? Environment.ProcessorCount : Jobs;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// We need to put a hard dep on Mono.Cecil.Mdb.dll so that it get's mkbundled
|
||||
//
|
||||
|
@ -1075,6 +1082,7 @@ namespace Xamarin.Bundler
|
|||
var os = new OptionSet () {
|
||||
{ "h|?|help", "Displays the help", v => SetAction (Action.Help) },
|
||||
{ "version", "Output version information and exit.", v => SetAction (Action.Version) },
|
||||
{ "j|jobs=", "The level of concurrency. Default is the number of processors.", v => Jobs = int.Parse (v) },
|
||||
{ "d|dir=", "Output directory for the results (Used for partial builds) [Deprecated]", v => { output_dir = v; classic_only_arguments.Add ("--dir"); }, true },
|
||||
{ "cp=|crossprefix=", "Specifies the Mono cross compiler prefix [Deprecated]", v => { cross_prefix = v; classic_only_arguments.Add ("--crossprefix"); }, true },
|
||||
{ "f|force", "Forces the recompilation of code, regardless of timestamps", v=>force = true },
|
||||
|
|
Загрузка…
Ссылка в новой задаче