Exemplo n.º 1
0
            static AbcVersion CalculateVersion(AbcVersion baseVersion, AbcVersionGitSubData data, Config config)
            {
                var branch = data.GitBranch;

                if (config.Branches.ContainsKey(branch))
                {
                    var configBranch      = config.Branches[branch];
                    var firstParentNumber = GitTool.GetCommitNumberCurrentBranchFirstParent(configBranch.ParentSha);
                    var sem           = SemVersion.Parse(configBranch.Version);
                    var patchNewValue = sem.Patch + firstParentNumber - 1;
                    var pathNewValue2 = patchNewValue < 0 ? 0 : patchNewValue;
                    var simple        = new AbcVersionSimple(sem.Major, sem.Minor,
                                                             pathNewValue2,
                                                             baseVersion.Special, baseVersion.BuildCounter, baseVersion.DateTime, baseVersion.Env);
                    return(new AbcVersion(data, simple));
                }
                else
                {
                    var firstParentNumber = data.GitCommitsCurrentBranchFirstParent;
                    var simple            = new AbcVersionSimple(baseVersion.Major, baseVersion.Minor,
                                                                 firstParentNumber, baseVersion.Special, baseVersion.BuildCounter, baseVersion.DateTime,
                                                                 baseVersion.Env);

                    return(new AbcVersion(data, simple));
                }
            }
Exemplo n.º 2
0
            static AbcVersion GetBaseAbcVersion(string special, int buildCounter, DateTime dateTime, string env)
            {
                var data        = GitTool.GetAllGitData();
                var simple      = new AbcVersionSimple(0, 0, 0, special, buildCounter, dateTime, env);
                var baseVersion = new AbcVersion(data, simple);

                return(baseVersion);
            }
Exemplo n.º 3
0
 public static AbcVersion Create(int buildCounter, DateTime buildDate)
 {
     if (AbcVersion != null)
     {
         return(AbcVersion);
     }
     lock (_padlock)
     {
         return(AbcVersion ?? (AbcVersion = AbcVersionFactoryInternal.CreateInternal(buildCounter, buildDate)));
     }
 }
Exemplo n.º 4
0
 public static AbcVersion Create()
 {
     if (AbcVersion != null)
     {
         return(AbcVersion);
     }
     lock (_padlock)
     {
         return(AbcVersion ?? (AbcVersion = AbcVersionFactoryInternal.CreateInternal()));
     }
 }
Exemplo n.º 5
0
 public static AbcVersion CreateLegacy(int major, int minor, int buildCounter, DateTime buildDate)
 {
     if (AbcVersion != null)
     {
         return(AbcVersion);
     }
     lock (_padlock)
     {
         return(AbcVersion ?? (AbcVersion = AbcVersionFactoryInternal.
                                            CreateLegacyInternal(major, minor, buildCounter, buildDate)));
     }
 }