private void GetOutputSatellites(PublishInfo[] publishInfos, ref List<ITaskItem> assemblyList)
 {
     FileMap map = new FileMap();
     if (this.satelliteAssemblies != null)
     {
         foreach (ITaskItem item in this.satelliteAssemblies)
         {
             item.SetMetadata("AssemblyType", "Satellite");
             map.Add(item, true);
         }
     }
     foreach (PublishInfo info in publishInfos)
     {
         string str = info.key + ".dll";
         MapEntry entry = map[str];
         if (entry != null)
         {
             entry.publishInfo = info;
         }
         else
         {
             base.Log.LogWarningWithCodeFromResources("ResolveManifestFiles.PublishFileNotFound", new object[] { info.key });
         }
     }
     foreach (MapEntry entry2 in (IEnumerable) map)
     {
         if (entry2.publishInfo == null)
         {
             entry2.publishInfo = new PublishInfo();
         }
         CultureInfo itemCulture = GetItemCulture(entry2.item);
         PublishFlags flags = PublishFlags.GetSatelliteFlags(entry2.publishInfo.state, itemCulture, this.targetCulture, this.includeAllSatellites);
         if ((flags.IsPublished && string.Equals(entry2.publishInfo.includeHash, "false", StringComparison.OrdinalIgnoreCase)) && this.SigningManifests)
         {
             this.canPublish = false;
         }
         if (flags.IsPublished)
         {
             assemblyList.Add(CreateAssemblyItem(entry2.item, entry2.publishInfo.group, entry2.publishInfo.targetPath, entry2.publishInfo.includeHash));
         }
         else if (flags.IsPrerequisite)
         {
             assemblyList.Add(CreatePrerequisiteItem(entry2.item));
         }
     }
 }
Пример #2
0
        private void GetOutputSatellites(PublishInfo[] publishInfos, ref List<ITaskItem> assemblyList)
        {
            FileMap satelliteMap = new FileMap();

            if (_satelliteAssemblies != null)
                foreach (ITaskItem item in _satelliteAssemblies)
                {
                    item.SetMetadata("AssemblyType", "Satellite");
                    satelliteMap.Add(item, true);
                }

            // Apply PublishInfo state from PublishFile items...
            foreach (PublishInfo publishInfo in publishInfos)
            {
                string key = publishInfo.key + ".dll";
                MapEntry entry = satelliteMap[key];
                if (entry != null)
                    entry.publishInfo = publishInfo;
                else
                    Log.LogWarningWithCodeFromResources("ResolveManifestFiles.PublishFileNotFound", publishInfo.key);
            }

            // Go through the AssemblyMap and determine which items get added to ouput SatelliteList based
            // on computed PublishFlags for each item...
            foreach (MapEntry entry in satelliteMap)
            {
                // If PublishInfo didn't come from a PublishFile item, then construct PublishInfo from the item
                if (entry.publishInfo == null)
                {
                    entry.publishInfo = new PublishInfo();
                }

                CultureInfo satelliteCulture = GetItemCulture(entry.item);
                PublishFlags flags = PublishFlags.GetSatelliteFlags(entry.publishInfo.state, satelliteCulture, _targetCulture, _includeAllSatellites);

                if (flags.IsPublished &&
                    string.Equals(entry.publishInfo.includeHash, "false", StringComparison.OrdinalIgnoreCase) &&
                    SigningManifests == true)
                    _canPublish = false;

                if (flags.IsPublished)
                {
                    assemblyList.Add(CreateAssemblyItem(entry.item, entry.publishInfo.group, entry.publishInfo.targetPath, entry.publishInfo.includeHash));
                }
                else if (flags.IsPrerequisite)
                {
                    assemblyList.Add(CreatePrerequisiteItem(entry.item));
                }
            }
        }
 private ITaskItem[] GetOutputFiles(PublishInfo[] publishInfos)
 {
     List<ITaskItem> list = new List<ITaskItem>();
     FileMap map = new FileMap();
     if (this.Files != null)
     {
         foreach (ITaskItem item in this.Files)
         {
             map.Add(item, true);
         }
     }
     if (this.ExtraFiles != null)
     {
         foreach (ITaskItem item2 in this.ExtraFiles)
         {
             map.Add(item2, false);
         }
     }
     foreach (PublishInfo info in publishInfos)
     {
         MapEntry entry = map[info.key];
         if (entry != null)
         {
             entry.publishInfo = info;
         }
         else
         {
             base.Log.LogWarningWithCodeFromResources("ResolveManifestFiles.PublishFileNotFound", new object[] { info.key });
         }
     }
     foreach (MapEntry entry2 in (IEnumerable) map)
     {
         if (entry2.publishInfo == null)
         {
             entry2.publishInfo = new PublishInfo();
         }
         string extension = Path.GetExtension(entry2.item.ItemSpec);
         PublishFlags flags = PublishFlags.GetFileFlags(entry2.publishInfo.state, extension, entry2.includedByDefault);
         if ((flags.IsPublished && string.Equals(entry2.publishInfo.includeHash, "false", StringComparison.OrdinalIgnoreCase)) && this.SigningManifests)
         {
             this.canPublish = false;
         }
         if (flags.IsPublished)
         {
             list.Add(CreateFileItem(entry2.item, entry2.publishInfo.group, entry2.publishInfo.targetPath, entry2.publishInfo.includeHash, flags.IsDataFile));
         }
     }
     return list.ToArray();
 }
Пример #4
0
        private ITaskItem[] GetOutputFiles(PublishInfo[] publishInfos)
        {
            List<ITaskItem> fileList = new List<ITaskItem>();
            FileMap fileMap = new FileMap();

            // Add all input Files to the FileMap, flagging them to be published by default...
            if (Files != null)
                foreach (ITaskItem item in Files)
                    fileMap.Add(item, true);

            // Add all input ExtraFiles to the FileMap, flagging them to NOT be published by default...
            if (ExtraFiles != null)
                foreach (ITaskItem item in ExtraFiles)
                    fileMap.Add(item, false);

            // Apply PublishInfo state from PublishFile items...
            foreach (PublishInfo publishInfo in publishInfos)
            {
                MapEntry entry = fileMap[publishInfo.key];
                if (entry != null)
                    entry.publishInfo = publishInfo;
                else
                    Log.LogWarningWithCodeFromResources("ResolveManifestFiles.PublishFileNotFound", publishInfo.key);
            }

            // Go through the FileMap and determine which items get added to ouput FileList based
            // on computed PublishFlags for each item...
            foreach (MapEntry entry in fileMap)
            {
                // If PublishInfo didn't come from a PublishFile item, then construct PublishInfo from the item
                if (entry.publishInfo == null)
                    entry.publishInfo = new PublishInfo();

                string fileExtension = Path.GetExtension(entry.item.ItemSpec);
                PublishFlags flags = PublishFlags.GetFileFlags(entry.publishInfo.state, fileExtension, entry.includedByDefault);

                if (flags.IsPublished &&
                    string.Equals(entry.publishInfo.includeHash, "false", StringComparison.OrdinalIgnoreCase) &&
                    SigningManifests == true)
                    _canPublish = false;

                if (flags.IsPublished)
                    fileList.Add(CreateFileItem(entry.item, entry.publishInfo.group, entry.publishInfo.targetPath, entry.publishInfo.includeHash, flags.IsDataFile));
            }

            return fileList.ToArray();
        }