本文整理汇总了C#中Microsoft.Build.Utilities.TaskLoggingHelper类的典型用法代码示例。如果您正苦于以下问题:C# TaskLoggingHelper类的具体用法?C# TaskLoggingHelper怎么用?C# TaskLoggingHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TaskLoggingHelper类属于Microsoft.Build.Utilities命名空间,在下文中一共展示了TaskLoggingHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetPaths
public static void GetPaths (out string monoDroidBinDir, out string monoDroidFrameworkDir,
out string androidSdkPath, out string javaSdkPath, TaskLoggingHelper log)
{
monoDroidBinDir = monoDroidFrameworkDir = androidSdkPath = javaSdkPath = null;
GetMonoDroidSdk (out monoDroidBinDir, out monoDroidFrameworkDir);
GetConfiguredSdkLocations (out androidSdkPath, out javaSdkPath, log);
if (!ValidateAndroidSdkLocation (androidSdkPath))
androidSdkPath = null;
if (!ValidateJavaSdkLocation (javaSdkPath))
javaSdkPath = null;
if (androidSdkPath != null && javaSdkPath != null)
return;
var path = Environment.GetEnvironmentVariable ("PATH");
var pathDirs = path.Split (new char[] { Path.PathSeparator }, StringSplitOptions.RemoveEmptyEntries);
if (androidSdkPath == null)
androidSdkPath = FindAndroidSdk (pathDirs);
if (javaSdkPath == null)
javaSdkPath = FindJavaSdk (pathDirs);
}
开发者ID:raufbutt,项目名称:monodevelop-old,代码行数:25,代码来源:MonoDroidSdk.cs
示例2: MsBuildTaskLogger
public MsBuildTaskLogger(TaskLoggingHelper log)
{
if (log == null)
throw new ArgumentNullException("log");
_log = log;
}
开发者ID:uluhonolulu,项目名称:Emkay.S3,代码行数:7,代码来源:MsBuildTaskLogger.cs
示例3: CheckFilePath
/// <summary>
/// Checks that the file path is sanitized and follows
/// all the conventions estabilished by the operating system.
/// </summary>
/// <param name="fileName">The input file name to validate.</param>
/// <param name="log">The current log instance.</param>
/// <returns>A value indicating whether the action was executed succesfuly.</returns>
internal static bool CheckFilePath(string fileName, TaskLoggingHelper log)
{
bool flag = true;
string directoryName = string.Empty;
try
{
directoryName = Path.GetDirectoryName(fileName);
}
catch (ArgumentException exception)
{
directoryName = exception.Message;
flag = false;
}
catch (PathTooLongException exception2)
{
directoryName = exception2.Message;
flag = false;
}
if (!flag)
{
log.LogErrorFromResources("InvalidPathChars", new object[] { directoryName });
}
return flag;
}
开发者ID:tario,项目名称:sdctasks,代码行数:33,代码来源:TaskHelpers.cs
示例4: SerializeCache
internal virtual void SerializeCache(string stateFile, TaskLoggingHelper log)
{
try
{
if ((stateFile != null) && (stateFile.Length > 0))
{
if (File.Exists(stateFile))
{
File.Delete(stateFile);
}
using (FileStream stream = new FileStream(stateFile, FileMode.CreateNew))
{
new BinaryFormatter().Serialize(stream, this);
}
}
}
catch (Exception exception)
{
if (Microsoft.Build.Shared.ExceptionHandling.NotExpectedException(exception))
{
throw;
}
log.LogWarningWithCodeFromResources("General.CouldNotWriteStateFile", new object[] { stateFile, exception.Message });
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:StateFileBase.cs
示例5: ReferenceTable
internal ReferenceTable(bool findDependencies, bool findSatellites, bool findSerializationAssemblies, bool findRelatedFiles, string[] searchPaths, string[] allowedAssemblyExtensions, string[] relatedFileExtensions, string[] candidateAssemblyFiles, string[] frameworkPaths, InstalledAssemblies installedAssemblies, System.Reflection.ProcessorArchitecture targetProcessorArchitecture, Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Shared.DirectoryExists directoryExists, Microsoft.Build.Tasks.GetDirectories getDirectories, GetAssemblyName getAssemblyName, GetAssemblyMetadata getAssemblyMetadata, GetRegistrySubKeyNames getRegistrySubKeyNames, GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, OpenBaseKey openBaseKey, GetAssemblyRuntimeVersion getRuntimeVersion, Version targetedRuntimeVersion, Version projectTargetFramework, FrameworkName targetFrameworkMoniker, TaskLoggingHelper log, string[] latestTargetFrameworkDirectories, bool copyLocalDependenciesWhenParentReferenceInGac, CheckIfAssemblyInGac checkIfAssemblyIsInGac)
{
this.log = log;
this.findDependencies = findDependencies;
this.findSatellites = findSatellites;
this.findSerializationAssemblies = findSerializationAssemblies;
this.findRelatedFiles = findRelatedFiles;
this.frameworkPaths = frameworkPaths;
this.allowedAssemblyExtensions = allowedAssemblyExtensions;
this.relatedFileExtensions = relatedFileExtensions;
this.installedAssemblies = installedAssemblies;
this.targetProcessorArchitecture = targetProcessorArchitecture;
this.fileExists = fileExists;
this.directoryExists = directoryExists;
this.getDirectories = getDirectories;
this.getAssemblyName = getAssemblyName;
this.getAssemblyMetadata = getAssemblyMetadata;
this.getRuntimeVersion = getRuntimeVersion;
this.projectTargetFramework = projectTargetFramework;
this.targetedRuntimeVersion = targetedRuntimeVersion;
this.openBaseKey = openBaseKey;
this.targetFrameworkMoniker = targetFrameworkMoniker;
this.latestTargetFrameworkDirectories = latestTargetFrameworkDirectories;
this.copyLocalDependenciesWhenParentReferenceInGac = copyLocalDependenciesWhenParentReferenceInGac;
this.checkIfAssemblyIsInGac = checkIfAssemblyIsInGac;
this.compiledSearchPaths = AssemblyResolution.CompileSearchPaths(searchPaths, candidateAssemblyFiles, targetProcessorArchitecture, frameworkPaths, fileExists, getAssemblyName, getRegistrySubKeyNames, getRegistrySubKeyDefaultValue, openBaseKey, installedAssemblies, getRuntimeVersion, targetedRuntimeVersion);
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:27,代码来源:ReferenceTable.cs
示例6: ConnectionContext
public ConnectionContext(NetworkStream clientStream, string connString, TcpTestServer3 server, TaskLoggingHelper log)
{
this.clientStream = clientStream;
this.connString = connString;
this.tcpServer = server;
this.log = log;
}
开发者ID:ericlemes,项目名称:IntegrationTests,代码行数:7,代码来源:ConnectionContext.cs
示例7: DataDrivenToolTask
/// <summary>
/// Default constructor
/// </summary>
protected DataDrivenToolTask(ResourceManager taskResources)
: base(taskResources)
{
logPrivate = new TaskLoggingHelper(this);
logPrivate.TaskResources = AssemblyResources.PrimaryResources;
logPrivate.HelpKeywordPrefix = "MSBuild.";
}
开发者ID:cameron314,项目名称:msbuild,代码行数:10,代码来源:DataDrivenToolTask.cs
示例8: Task
protected Task(ResourceManager taskResources,
string helpKeywordPrefix)
{
log = new TaskLoggingHelper (this);
log.TaskResources = taskResources;
this.helpKeywordPrefix = helpKeywordPrefix;
}
开发者ID:ItsVeryWindy,项目名称:mono,代码行数:7,代码来源:Task.cs
示例9: TaskLogger
public TaskLogger(TaskLoggingHelper taskLoggingHelper)
{
if (taskLoggingHelper == null)
throw new ArgumentNullException("taskLoggingHelper");
this.taskLoggingHelper = taskLoggingHelper;
}
开发者ID:dougrathbone,项目名称:mbunit-v3,代码行数:7,代码来源:TaskLogger.cs
示例10: ComReference
/// <summary>
/// Internal constructor
/// </summary>
/// <param name="taskLoggingHelper">task logger instance used for logging</param>
/// <param name="silent">true if this task should log only errors, no warnings or messages; false otherwise</param>
/// <param name="referenceInfo">cached reference information (typelib pointer, original task item, typelib name etc.)</param>
/// <param name="itemName">reference name (for better logging experience)</param>
internal ComReference(TaskLoggingHelper taskLoggingHelper, bool silent, ComReferenceInfo referenceInfo, string itemName)
{
_referenceInfo = referenceInfo;
_itemName = itemName;
_log = taskLoggingHelper;
_silent = silent;
}
开发者ID:cameron314,项目名称:msbuild,代码行数:14,代码来源:ComReference.cs
示例11: GetAppBuildOrder
public IEnumerable<string> GetAppBuildOrder(string sourceDirectory, string startAppPath, string uniqueSourceDirectoryPath, TaskLoggingHelper log)
{
_log = log;
_uniqueSourceDirectoryPath = uniqueSourceDirectoryPath;
var sourceDirectoryPath = sourceDirectory.Trim('\'', '"');
var appList = GetAppListWithReferences(sourceDirectoryPath);
var appPath = startAppPath.Trim('\'', '"');
var startApps = appPath.Split('|').ToList();
foreach (var app in startApps)
{
if (!string.IsNullOrEmpty(app))
{
_log.LogMessage("Application path: {0}", app);
var startApp = appList[Path.GetFullPath(app.ToUpper().Replace(sourceDirectoryPath.ToUpper(), _uniqueSourceDirectoryPath)).ToUpper()];
if (startApp == null)
{
log.LogError("Application {0} could not be found.", app);
}
else
{
_orderedAppList.Add(Path.GetFullPath(app.ToUpper().Replace(sourceDirectoryPath.ToUpper(), _uniqueSourceDirectoryPath)).ToUpper());
LoopReferences(startApp, appList);
}
}
}
_orderedAppList.ForEach(a => _log.LogMessage(a));
return _orderedAppList;
}
开发者ID:nickvane,项目名称:AionMsBuildTasks,代码行数:31,代码来源:AppOrderer.cs
示例12: DeserializeCache
internal static StateFileBase DeserializeCache(string stateFile, TaskLoggingHelper log, Type requiredReturnType)
{
StateFileBase o = null;
try
{
if (((stateFile == null) || (stateFile.Length <= 0)) || !File.Exists(stateFile))
{
return o;
}
using (FileStream stream = new FileStream(stateFile, FileMode.Open))
{
object obj2 = new BinaryFormatter().Deserialize(stream);
o = obj2 as StateFileBase;
if ((o == null) && (obj2 != null))
{
log.LogMessageFromResources("General.CouldNotReadStateFileMessage", new object[] { stateFile, log.FormatResourceString("General.IncompatibleStateFileType", new object[0]) });
}
if ((o != null) && !requiredReturnType.IsInstanceOfType(o))
{
log.LogWarningWithCodeFromResources("General.CouldNotReadStateFile", new object[] { stateFile, log.FormatResourceString("General.IncompatibleStateFileType", new object[0]) });
o = null;
}
}
}
catch (Exception exception)
{
log.LogWarningWithCodeFromResources("General.CouldNotReadStateFile", new object[] { stateFile, exception.Message });
}
return o;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:30,代码来源:StateFileBase.cs
示例13: GetTable
internal static bool GetTable(TaskLoggingHelper log, string parameterName, string[] propertyList, out Hashtable propertiesTable)
{
propertiesTable = null;
if (propertyList != null)
{
propertiesTable = new Hashtable(StringComparer.OrdinalIgnoreCase);
foreach (string str in propertyList)
{
string str2 = string.Empty;
string str3 = string.Empty;
int index = str.IndexOf('=');
if (index != -1)
{
str2 = str.Substring(0, index).Trim();
str3 = str.Substring(index + 1).Trim();
}
if (str2.Length == 0)
{
if (log != null)
{
log.LogErrorWithCodeFromResources("General.InvalidPropertyError", new object[] { parameterName, str });
}
return false;
}
propertiesTable[str2] = str3;
}
}
return true;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:29,代码来源:PropertyParser.cs
示例14: CompilerErrorSink
/// <summary>
/// Constructor for the error sink
/// </summary>
/// <param name="logger">This parameter should be the logger for the task being executed</param>
public CompilerErrorSink(TaskLoggingHelper/*!*/ logger)
{
if (logger == null)
throw new ArgumentNullException("logger");
this.logger = logger;
}
开发者ID:hansdude,项目名称:Phalanger,代码行数:11,代码来源:CompilerErrorSink.cs
示例15: SerializeCache
/// <summary>
/// Writes the contents of this object out to the specified file.
/// </summary>
/// <param name="stateFile"></param>
virtual internal void SerializeCache(string stateFile, TaskLoggingHelper log)
{
try
{
if (!string.IsNullOrEmpty(stateFile))
{
if (File.Exists(stateFile))
{
File.Delete(stateFile);
}
using (FileStream s = new FileStream(stateFile, FileMode.CreateNew))
{
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(s, this);
}
}
}
catch (Exception e)
{
// If there was a problem writing the file (like it's read-only or locked on disk, for
// example), then eat the exception and log a warning. Otherwise, rethrow.
if (ExceptionHandling.NotExpectedSerializationException(e))
throw;
// Not being able to serialize the cache is not an error, but we let the user know anyway.
// Don't want to hold up processing just because we couldn't read the file.
log.LogWarningWithCodeFromResources("General.CouldNotWriteStateFile", stateFile, e.Message);
}
}
开发者ID:cameron314,项目名称:msbuild,代码行数:34,代码来源:StateFileBase.cs
示例16: RemoveSelectors
public static bool RemoveSelectors(TaskLoggingHelper log, HtmlDocument document, IEnumerable<SelectorInfo> selectors)
{
bool updatedItem = false;
HtmlNodeCollection collection = document.DocumentNode.SelectNodes("//style");
int nodeNumber = 0;
foreach (HtmlNode node in collection)
{
log.LogMessage(MessageImportance.Normal, "Processing <style/> tag #{0}", nodeNumber++);
List<SelectorInfo> foundSelectors = selectors.Where(item => item.Expression.IsMatch(node.InnerText)).ToList();
foreach (SelectorInfo foundSelector in foundSelectors)
{
log.LogMessage(MessageImportance.Normal, "Found '{0}' selector. Removing all occurrences.", foundSelector.Name);
node.InnerHtml = foundSelector.Expression.Replace(node.InnerHtml, string.Empty);
updatedItem = true;
}
if (string.IsNullOrWhiteSpace(node.InnerHtml))
{
log.LogMessage(MessageImportance.Normal, "No CSS Styles remain. Removing <style/>");
node.Remove();
updatedItem = true;
}
}
return updatedItem;
}
开发者ID:automatonic,项目名称:exult,代码行数:25,代码来源:RemoveStyles.cs
示例17: MsBuildRunner
public MsBuildRunner(TaskLoggingHelper log, LogTypeEnum logType, string logFile) : base()
{
Log = log;
LogType = logType;
LogFile = logFile;
OriginalIgnoreList = IgnoreList = new NotSupportedIgnoreList();
}
开发者ID:sillsdev,项目名称:Gendarme.MsBuild,代码行数:7,代码来源:MsBuildRunner.cs
示例18: TlbReference
internal TlbReference(TaskLoggingHelper taskLoggingHelper, IComReferenceResolver resolverCallback, IEnumerable<string> referenceFiles, ComReferenceInfo referenceInfo, string itemName, string outputDirectory, bool hasTemporaryWrapper, bool delaySign, string keyFile, string keyContainer, bool noClassMembers, string targetProcessorArchitecture, bool includeTypeLibVersionInName, bool executeAsTool, string sdkToolsPath, IBuildEngine buildEngine, string[] environmentVariables) : base(taskLoggingHelper, resolverCallback, referenceInfo, itemName, outputDirectory, delaySign, keyFile, keyContainer, includeTypeLibVersionInName, executeAsTool, sdkToolsPath, buildEngine, environmentVariables)
{
this.hasTemporaryWrapper = hasTemporaryWrapper;
this.noClassMembers = noClassMembers;
this.targetProcessorArchitecture = targetProcessorArchitecture;
this.referenceFiles = referenceFiles;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:TlbReference.cs
示例19: GetServiceTableAsync
public static async Task<ServiceTable> GetServiceTableAsync(string ConnString, int ServiceTableID, TaskLoggingHelper Log)
{
ServiceTable result = new ServiceTable();
SqlConnection conn = new SqlConnection(ConnString);
conn.Open();
SqlCommand cmd = new SqlCommand("select ServiceTableID, DescServiceTable, Value, CreationDate, StringField1, StringField2 " +
"from ServiceTable where ServiceTableID = @ServiceTableID", conn);
using (conn)
{
SqlParameter p1 = cmd.Parameters.Add("@ServiceTableID", SqlDbType.Int);
p1.Value = ServiceTableID;
SqlDataReader rd = await cmd.ExecuteReaderAsync();
rd.Read();
using (rd)
{
result.ServiceTableID = rd.GetInt32(0);
result.DescServiceTable = rd.GetString(1);
result.Value = (float)rd.GetDouble(2);
result.CreationDate = rd.GetDateTime(3);
result.StringField1 = rd.GetString(4);
result.StringField2 = rd.GetString(5);
}
}
if (Log != null)
Log.LogMessage("Getting ServiceTableID: " + ServiceTableID.ToString());
return result;
}
开发者ID:ericlemes,项目名称:IntegrationTests,代码行数:33,代码来源:DAO.cs
示例20: Run
public bool Run(Assembly assm, string ResourceName, string OutputPath, TaskLoggingHelper Log)
{
// Ensure our output directory exists
if (!Directory.Exists (Path.GetDirectoryName (OutputPath)))
Directory.CreateDirectory (Path.GetDirectoryName (OutputPath));
// Copy out one of our embedded resources to a path
using (var from = GetManifestResourceStream (ResourceName)) {
// If the resource already exists, only overwrite if it's changed
if (File.Exists (OutputPath)) {
var hash1 = MonoAndroidHelper.HashFile (OutputPath);
var hash2 = MonoAndroidHelper.HashStream (from);
if (hash1 == hash2) {
Log.LogDebugMessage ("Resource {0} is unchanged. Skipping.", OutputPath);
return true;
}
}
// Hash calculation read to the end, move back to beginning of file
from.Position = 0;
// Write out the resource
using (var to = File.Create (OutputPath))
Copy (from, to);
Log.LogDebugMessage ("Wrote resource {0}.", OutputPath);
}
return true;
}
开发者ID:yudhitech,项目名称:xamarin-android,代码行数:32,代码来源:CopyResource.cs
注:本文中的Microsoft.Build.Utilities.TaskLoggingHelper类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论