OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 using System; | 4 using System; |
5 using System.Collections.Generic; | 5 using System.Collections.Generic; |
6 using System.Text; | 6 using System.Text; |
7 using System.Collections; | 7 using System.Collections; |
8 using System.IO; | 8 using System.IO; |
9 using System.Reflection; | 9 using System.Reflection; |
10 using System.Resources; | 10 using System.Resources; |
11 using System.Windows.Forms; | 11 using System.Windows.Forms; |
12 using Microsoft.Build.Framework; | 12 using Microsoft.Build.Framework; |
13 using Microsoft.Win32; | 13 using Microsoft.Win32; |
14 using Microsoft.Build.Utilities; | 14 using Microsoft.Build.Utilities; |
15 using System.Collections.Specialized; | 15 using System.Collections.Specialized; |
16 | 16 |
17 using System.Diagnostics; | 17 using System.Diagnostics; |
18 | 18 |
19 namespace NaCl.Build.CPPTasks | 19 namespace NaCl.Build.CPPTasks |
20 { | 20 { |
Sam Clegg
2012/11/12 20:10:36
Code lifted into the superclass.
| |
21 public class NaClCompile : NaClToolTask | 21 public class NaClCompile : NaClToolTask |
22 { | 22 { |
23 public bool BuildingInIDE { get; set; } | |
24 | |
25 [Required] | 23 [Required] |
26 public string PropertiesFile { get; set; } | 24 public string PropertiesFile { get; set; } |
27 | 25 |
28 [Required] | 26 [Required] |
29 public string NaCLCompilerPath { get; set; } | 27 public string NaCLCompilerPath { get; set; } |
30 | 28 |
31 [Required] | |
32 public bool OutputCommandLine { get; set; } | |
33 | |
34 [Required] | |
35 public string Platform { get; set; } | |
36 | |
37 public int ProcessorNumber { get; set; } | 29 public int ProcessorNumber { get; set; } |
38 | 30 |
39 public bool MultiProcessorCompilation { get; set; } | 31 public bool MultiProcessorCompilation { get; set; } |
40 | 32 |
41 [Required] | 33 [Required] |
42 public string ConfigurationType { get; set; } | 34 public string ConfigurationType { get; set; } |
43 | 35 |
44 [Obsolete] | 36 [Obsolete] |
45 protected override StringDictionary EnvironmentOverride | 37 protected override StringDictionary EnvironmentOverride |
46 { | 38 { |
47 get { | 39 get { |
48 string show = OutputCommandLine ? "1" : "0"; | 40 string show = OutputCommandLine ? "1" : "0"; |
49 string cores = Convert.ToString(ProcessorNumber); | 41 string cores = Convert.ToString(ProcessorNumber); |
50 return new StringDictionary() { | 42 return new StringDictionary() { |
51 {"NACL_GCC_CORES", cores}, | 43 {"NACL_GCC_CORES", cores}, |
52 {"NACL_GCC_SHOW_COMMANDS", show } | 44 {"NACL_GCC_SHOW_COMMANDS", show } |
53 }; | 45 }; |
54 } | 46 } |
55 } | 47 } |
56 | 48 |
57 protected override string GenerateFullPathToTool() | |
58 { | |
59 return ToolName; | |
60 } | |
61 | |
62 public NaClCompile() | 49 public NaClCompile() |
63 : base(new ResourceManager("NaCl.Build.CPPTasks.Properties.Resources ", Assembly.GetExecutingAssembly())) | 50 : base(new ResourceManager("NaCl.Build.CPPTasks.Properties.Resources ", Assembly.GetExecutingAssembly())) |
64 { | 51 { |
65 this.EnvironmentVariables = new string[] { "CYGWIN=nodosfilewarning" , "LC_CTYPE=C" }; | 52 this.EnvironmentVariables = new string[] { "CYGWIN=nodosfilewarning" , "LC_CTYPE=C" }; |
66 } | 53 } |
67 | 54 |
68 protected IDictionary<string, string> GenerateCommandLinesFromTlog() | 55 protected IDictionary<string, string> GenerateCommandLinesFromTlog() |
69 { | 56 { |
70 IDictionary<string, string> cmdLineDictionary = new Dictionary<strin g, string>(StringComparer.OrdinalIgnoreCase); | 57 IDictionary<string, string> cmdLineDictionary = new Dictionary<strin g, string>(StringComparer.OrdinalIgnoreCase); |
71 string tlogFilename = this.TLogCommandFile.GetMetadata("FullPath"); | 58 string tlogFilename = this.TLogCommandFile.GetMetadata("FullPath"); |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
551 protected override string ToolName | 538 protected override string ToolName |
552 { | 539 { |
553 get | 540 get |
554 { | 541 { |
555 return NaCLCompilerPath; | 542 return NaCLCompilerPath; |
556 } | 543 } |
557 } | 544 } |
558 | 545 |
559 } | 546 } |
560 } | 547 } |
OLD | NEW |