public static List<DeployDetails> resolve(ProjectModel.DeployAttribute deployAttribute, string projectDirectory, string repository)
 {          
     Dictionary<string, string> resultMap = new Dictionary<string, string>();
     BuildArtifactsMapping mapping = new BuildArtifactsMapping(deployAttribute.InputPattern, deployAttribute.OutputPattern);
     BuildArtifactsMappingResolver.matchMappingArtifacts(mapping, projectDirectory, resultMap);
   
     return resultMap.Select(a => new DeployDetails
     {
         artifactPath = a.Value,
         file = new FileInfo(a.Key),
         md5 = MD5CheckSum.GenerateMD5(a.Key),
         sha1 = Sha1Reference.GenerateSHA1(a.Key),
         targetRepository = repository
     }).ToList();
 }
        /// <summary>
        /// Read all referenced nuget`s in the .csproj calculate their md5, sha1 and id.
        /// </summary>
        public static void ProccessModule(Build build, ProjectModel project, ArtifactoryBuild _task)
        {
            var module = new Module(project.AssemblyName);

            string localSource = Path.Combine(_task.SolutionRoot, "packages");
            //string[] directoryPaths = Directory.GetDirectories(_task.SolutionRoot, project.AssemblyName, SearchOption.AllDirectories);
            string[] packageConfigPath = Directory.GetFiles(project.projectDirectory, "packages.config", SearchOption.AllDirectories);

            if (project.artifactoryDeploy != null && !string.IsNullOrWhiteSpace(_task.DeployEnabled) && _task.DeployEnabled.Equals("true"))
            {
                foreach (ProjectModel.DeployAttribute deployAttribute in project.artifactoryDeploy)
                {
                    List<DeployDetails> details = BuildArtifacts.resolve(deployAttribute, project.projectDirectory, _task.DeploymentRepository);
                    deployAttribute.properties.AddRange(build.getDefaultProperties());
                    foreach (DeployDetails artifactDetail in details)
                    {
                        //Add default artifact properties                    
                        artifactDetail.properties = Build.buildMatrixParamsString(deployAttribute.properties);

                        string artifactName = artifactDetail.file.Name;
                        module.Artifacts.Add(new Artifact
                        {
                            type = artifactDetail.file.Extension.Replace(".", String.Empty),
                            md5 = artifactDetail.md5,
                            sha1 = artifactDetail.sha1,
                            name = artifactName
                        });

                        string artifactId = module.id + ":" + artifactName;
                        if (_task.deployableArtifactBuilderMap.ContainsKey(artifactId))
                        {
                            _task.deployableArtifactBuilderMap[artifactId].Add(artifactDetail);
                        }
                        else
                        {
                            _task.deployableArtifactBuilderMap.Add(artifactId, new List<DeployDetails> { artifactDetail });
                        }
                    }
                }
            }
            addDependencies(project.AssemblyName, module, localSource, packageConfigPath, _task.Configuration);
            build.modules.Add(module);
        }
        /// <summary>
        /// create project model and return its references for nuget, local and other projects
        /// </summary>
       
        public ProjectModel generate()
        {
                ProjectModel projectRefModel = new ProjectModel();

                if (ArtifactoryConfiguration != null) 
                {
                    projectRefModel.artifactoryDeploy = new List<ProjectModel.DeployAttribute>();

                    var result = ArtifactoryConfiguration.PropertyGroup.Deployments.Deploy.Select(attr => new ProjectModel.DeployAttribute()
                    {
                        InputPattern = (attr.InputPattern != null ? attr.InputPattern : string.Empty),
                        OutputPattern = (attr.OutputPattern != null ? attr.OutputPattern : string.Empty),
                        properties = convertProperties(attr.Properties)
                    });

                    projectRefModel.artifactoryDeploy.AddRange(result);
                }

                projectRefModel.AssemblyName = ProjectName;
                projectRefModel.projectDirectory = ProjectDirectory;

                return projectRefModel;           
        }