Пример #1
0
    public void Execute()
    {
        references = new Dictionary <string, string>(StringComparer.OrdinalIgnoreCase);
        if (string.IsNullOrWhiteSpace(config.References))
        {
            try
            {
                SetRefDictionary(buildEnginePropertyExtractor.GetEnvironmentVariable("ReferencePath", true));
                logger.LogMessage("\tYou did not define the WeavingTask.References. So references were extracted from the BuildEngine. Reference count=" + references.Count);
            }
            catch (Exception exception)
            {
                throw new WeavingException(string.Format(@"Tried to extract references from the BuildEngine. 
Please raise a bug here http://code.google.com/p/notifypropertyweaver/issues/list with the below exception text.
The temporary work-around is to change the weaving task as follows 
<WeavingTask ... References=""@(ReferencePath)"" />
Exception details: {0}", exception));
            }
        }
        else
        {
            SetRefDictionary(config.References.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries));
            logger.LogMessage("\tUsing WeavingTask.References. Reference count=" + references.Count);
        }
    }
Пример #2
0
    public void Execute()
    {
        if (string.IsNullOrWhiteSpace(config.TargetPath))
        {
            logger.LogMessage("\tYou did not define the WeavingTask.TargetPath. So it was extracted from the BuildEngine.");
            var buildEngineKey = GetBuildEngineKey();
            try
            {
                config.TargetPath = buildEnginePropertyExtractor.GetEnvironmentVariable(buildEngineKey, true).First();
            }
            catch (Exception exception)
            {
                throw new WeavingException(string.Format(
                                               @"Failed to extract target assembly path from the BuildEngine. 
Please raise a bug with the below exception text.
The temporary work-around is to change the weaving task as follows 
<WeavingTask ... TargetPath=""PathToYourAssembly"" />
Exception details: {0}", exception));
            }
        }
        if (!File.Exists(config.TargetPath))
        {
            throw new WeavingException(string.Format("TargetPath \"{0}\" does not exists. If you have not done a build you can ignore this error.", config.TargetPath));
        }
    }
Пример #3
0
 public void Execute()
 {
     if (embedTask.ReferenceCopyLocalPaths == null)
     {
         Dependencies = buildEnginePropertyExtractor.GetEnvironmentVariable("ReferenceCopyLocalPaths", false)
                        .Where(x => x.EndsWith(".dll") || x.EndsWith(".exe"))
                        .ToList();
         return;
     }
     Dependencies = embedTask.ReferenceCopyLocalPaths;
 }
Пример #4
0
    public void Execute()
    {
        if (string.IsNullOrWhiteSpace(weavingTask.TargetPath))
        {
            try
            {
                weavingTask.TargetPath = buildEnginePropertyExtractor.GetEnvironmentVariable("TargetPath", true).First();
                logger.LogMessage("\tYou did not define the WeavingTask.TargetPath. So it was extracted from the BuildEngine.");
            }
            catch (Exception exception)
            {
                throw new WeavingException(string.Format(
                                               @"Failed to extract target assembly path from the BuildEngine. 
Please raise a bug here http://code.google.com/p/costura/issues/list with the below exception text.
The temporary work-around is to change the weaving task as follows 
<EmbedTask ... TargetPath=""@(TargetPath)"" />
Exception details: {0}", exception));
            }
        }
        if (!File.Exists(weavingTask.TargetPath))
        {
            throw new WeavingException(string.Format("TargetPath \"{0}\" does not exists. If you have not done a build you can ignore this error.", weavingTask.TargetPath));
        }
    }