Exemple #1
0
        private void LoadPackager(Suite suite, Product product, YamlNode node)
        {
            var mapping = node as YamlMappingNode;

            if (mapping != null)
            {
                var packagerKey = new YamlScalarNode("packager");
                if (mapping.Children.ContainsKey(packagerKey))
                {
                    var packagerNode = mapping.Children[packagerKey] as YamlMappingNode;
                    if (packagerNode != null)
                    {
                        string type = parser.GetScalarValue(packagerNode, "type", "Packager type is not defined");

                        var loader = parametersLoaders.FirstOrDefault(l => l.Supports(type));
                        IPackagerParameters param = null;
                        if (loader != null)
                        {
                            YamlNode paramNode;
                            if (packagerNode.Children.TryGetValue(new YamlScalarNode("param"), out paramNode))
                            {
                                param = loader.Load(suite, type, paramNode, parser) as IPackagerParameters;
                            }
                            else
                            {
                                param = loader.Load(suite, type, new YamlMappingNode(), parser) as IPackagerParameters;
                            }
                        }

                        product.Packager = new PackagerDefinition(type, param);
                    }
                }
            }
        }
Exemple #2
0
 public PackagerDefinition(PackagerId packagerType, IPackagerParameters parameters)
 {
     this.packagerType = packagerType;
     this.parameters = parameters;
 }
Exemple #3
0
 public PackagerDefinition(PackagerId packagerType, IPackagerParameters parameters)
 {
     this.packagerType = packagerType;
     this.parameters   = parameters;
 }