Exemple #1
0
 public string Generate(IIntegrationResult integrationResult)
 {
     try
     {
         int rebuild  = 0;
         int revision = SvnProcessHelper.GetSvnRevision(SvnOptions);
         IntegrationSummary lastIntegration = integrationResult.LastIntegration;
         if ((integrationResult != null) && (!lastIntegration.IsInitial()))
         {
             string   lastLabel    = lastIntegration.Label;
             string[] labelParsed  = StringHelper.ParseLabel(lastLabel);
             int      lastRevision = Int32.Parse(labelParsed[2]);
             if (lastRevision == revision)
             {
                 rebuild = Int32.Parse(labelParsed[3]) + 1;
             }
         }
         string resultLabel = Major.ToString() + "." + Minor.ToString() + "."
                              + revision.ToString() + "." + rebuild.ToString();
         return(resultLabel);
     }
     catch (Exception ex)
     {
         throw new Exception("Failed during svn revision labelling " + ex.ToString());
     }
 }
Exemple #2
0
        private string GetLabel(string sourceLabel)
        {
            string label = sourceLabel;

            if (Version != null)
            {
                string[] labelParsed = StringHelper.ParseLabel(sourceLabel);
                labelParsed[0] = Version.Major.ToString();
                labelParsed[1] = Version.Minor.ToString();
                labelParsed[2] = SvnProcessHelper.GetSvnRevision(Version.SvnOptions).ToString();
                label          = labelParsed[0] + "." + labelParsed[1] + "." + labelParsed[2] + "." + labelParsed[3];
            }
            return(label);
        }