/// <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); }