예제 #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SolutionFileInfo" /> class
        /// </summary>
        /// <param name="solution">solution entity</param>
        /// <param name="organizationServiceProxy">Organization proxy</param>
        /// <param name="uniqueSolutionName">unique solution name</param>
        public SolutionFileInfo(Entity solution, OrganizationServiceProxy organizationServiceProxy, string uniqueSolutionName)
        {
            this.OrganizationServiceProxy = organizationServiceProxy;
            this.SolutionsToBeMerged      = new List <string>();
            this.SolutionUniqueName       = uniqueSolutionName;

            // solution.GetAttributeValue<string>(Constants.SourceControlQueueAttributeNameForSolutionName);
            this.Message          = solution.GetAttributeValue <string>(Constants.SourceControlQueueAttributeNameForComment);
            this.OwnerName        = solution.GetAttributeValue <EntityReference>(Constants.SourceControlQueueAttributeNameForOwnerId).Name;
            this.IncludeInRelease = solution.GetAttributeValue <bool>(Constants.SourceControlQueueAttributeNameForIncludeInRelease);
            this.CheckInSolution  = solution.GetAttributeValue <bool>(Constants.SourceControlQueueAttributeNameForCheckinSolution);
            this.MergeSolution    = solution.GetAttributeValue <bool>(Constants.SourceControlQueueAttributeNameForMergeSolution);
            var solutions = solution.GetAttributeValue <string>(Constants.SourceControlQueueAttributeNameForSourceSolutions);

            if (this.CheckInSolution)
            {
                this.SolutionExtractionPath = Path.GetTempPath() + this.SolutionUniqueName;
                this.BranchName             = solution.GetAttributeValue <string>(Constants.SourceControlQueueAttributeNameForBranch);
                CrmSolutionHelper.CreateEmptyFolder(this.SolutionExtractionPath);
            }

            if (!string.IsNullOrEmpty(solutions) && this.MergeSolution)
            {
                foreach (var s in solutions.Split(new string[] { "," }, System.StringSplitOptions.RemoveEmptyEntries))
                {
                    this.SolutionsToBeMerged.Add(s);
                }
            }

            this.Solution = solution;
        }
예제 #2
0
 /// <summary>
 /// method resets local directory
 /// </summary>
 public static void ResetLocalDirectory()
 {
     // LocalDirectory = @"\\?\" + Path.GetTempFileName().Replace(".","") + "devopsTmp\\";
     LocalDirectory = Path.GetTempFileName().Replace(".", string.Empty) + "devopsTmp\\";
     CrmSolutionHelper.CreateEmptyFolder(LocalDirectory);
     SubstTempDirectory();
 }