OLD | NEW |
(Empty) | |
| 1 |
| 2 using System; |
| 3 using System.Collections.Generic; |
| 4 using System.Linq; |
| 5 using System.Text; |
| 6 using System.Collections; |
| 7 using System.IO; |
| 8 using System.Reflection; |
| 9 using System.Resources; |
| 10 using System.Text.RegularExpressions; |
| 11 using System.Diagnostics; |
| 12 |
| 13 using Microsoft.Build.Framework; |
| 14 using Microsoft.Build.CPPTasks; |
| 15 using Microsoft.Build.Utilities; |
| 16 |
| 17 namespace NaCl.Build.CPPTasks |
| 18 { |
| 19 public class NaClLib : TrackedVCToolTask |
| 20 { |
| 21 public bool BuildingInIDE { get; set; } |
| 22 |
| 23 [Required] |
| 24 public string LibrarianToolPath { get; set; } |
| 25 |
| 26 [Required] |
| 27 public string PropertiesFile { get; set; } |
| 28 |
| 29 [Required] |
| 30 public virtual string OutputFile { get; set; } |
| 31 |
| 32 [Required] |
| 33 public string OutputCommandLine { get; set; } |
| 34 |
| 35 [Required] |
| 36 public virtual ITaskItem[] Sources { get; set; } |
| 37 |
| 38 |
| 39 public NaClLib() |
| 40 : base(new ResourceManager("NaCl.Build.CPPTasks.Properties.Resources
", Assembly.GetExecutingAssembly())) |
| 41 { |
| 42 } |
| 43 |
| 44 protected override string GenerateResponseFileCommands() |
| 45 { |
| 46 StringBuilder responseFileCmds = new StringBuilder(GCCUtilities.s_Co
mmandLineLength); |
| 47 responseFileCmds.Append("rcs "); |
| 48 responseFileCmds.Append(GCCUtilities.Convert_Path_Windows_To_Posix(O
utputFile)); |
| 49 |
| 50 foreach (ITaskItem item in Sources) |
| 51 { |
| 52 responseFileCmds.Append(" "); |
| 53 responseFileCmds.Append(GCCUtilities.Convert_Path_Windows_To_Pos
ix(item.ToString())); |
| 54 } |
| 55 return responseFileCmds.ToString(); |
| 56 } |
| 57 |
| 58 protected override int ExecuteTool(string pathToTool, string responseFil
eCommands, string commandLineCommands) |
| 59 { |
| 60 if (OutputCommandLine == "true") |
| 61 { |
| 62 Log.LogMessage(MessageImportance.High, pathToTool + " " + respo
nseFileCommands); |
| 63 } |
| 64 |
| 65 return base.ExecuteTool(pathToTool, responseFileCommands, commandLin
eCommands); |
| 66 } |
| 67 |
| 68 |
| 69 |
| 70 public virtual string PlatformToolset |
| 71 { |
| 72 get |
| 73 { |
| 74 return "GCC"; |
| 75 } |
| 76 } |
| 77 |
| 78 protected override bool MaintainCompositeRootingMarkers |
| 79 { |
| 80 get |
| 81 { |
| 82 return true; |
| 83 } |
| 84 } |
| 85 |
| 86 protected override ITaskItem[] TrackedInputFiles |
| 87 { |
| 88 get |
| 89 { |
| 90 return Sources; |
| 91 } |
| 92 } |
| 93 |
| 94 |
| 95 protected override Encoding ResponseFileEncoding |
| 96 { |
| 97 get |
| 98 { |
| 99 return Encoding.ASCII; |
| 100 } |
| 101 } |
| 102 |
| 103 protected override string ToolName |
| 104 { |
| 105 get |
| 106 { |
| 107 return LibrarianToolPath; |
| 108 } |
| 109 } |
| 110 |
| 111 protected override string TrackerIntermediateDirectory |
| 112 { |
| 113 get |
| 114 { |
| 115 if (this.TrackerLogDirectory != null) |
| 116 { |
| 117 return this.TrackerLogDirectory; |
| 118 } |
| 119 else |
| 120 { |
| 121 return string.Empty; |
| 122 } |
| 123 } |
| 124 } |
| 125 |
| 126 protected override string CommandTLogName |
| 127 { |
| 128 get |
| 129 { |
| 130 return "default.link.command.tlog"; |
| 131 } |
| 132 } |
| 133 |
| 134 protected override string[] ReadTLogNames |
| 135 { |
| 136 get |
| 137 { |
| 138 return new string[] |
| 139 { |
| 140 "default.link.read.tlog" |
| 141 }; |
| 142 } |
| 143 } |
| 144 |
| 145 protected override string[] WriteTLogNames |
| 146 { |
| 147 get |
| 148 { |
| 149 return new string[] |
| 150 { |
| 151 "default.link.write.tlog" |
| 152 }; |
| 153 } |
| 154 } |
| 155 |
| 156 public string TrackerLogDirectory { get; set; } |
| 157 } |
| 158 |
| 159 |
| 160 } |
OLD | NEW |