Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
814 mhunt 1
package com.erggroup.buildtool.ripple;
2
 
3
import java.io.File;
4
 
5
import java.util.Iterator;
6
import java.util.Vector;
7
 
8
import org.apache.log4j.Logger;
9
 
10
public class Package
11
{
12
  /**name of package, must not contain spaces
13
   * @attribute
14
   */
15
  String mName = new String();
16
 
17
  /**package scope
18
   * @attribute
19
   */
20
  String mExtension = new String();
21
 
22
  /**instance identifier
23
   * @attribute
24
   */
25
  String mVersion = new String();
26
 
27
  /**unique identifier
28
   * for daemon builds = mName + mExtension
29
   * for escrow builds = mName + mVersion + mExtension
30
   * @attribute
31
   */
32
  String mAlias = new String();
33
 
34
  /**clearcase vob location, must not contain spaces
35
   * @attribute
36
   */
37
  String mLocation = new String();
38
 
39
  /**clearcase source file instance identifier
40
   * @attribute
41
   */
42
  String mLabel = new String();
43
 
44
  /**build standards
45
   * @attribute
46
   */
864 mhunt 47
  Vector<BuildStandard> mBuildStandardCollection = new Vector<BuildStandard>();
814 mhunt 48
 
49
  /**GBE_MACHTYPE used to build generic packages for this baseline
50
   * only has meaning in the daemon build, not the escrow build
51
   * accessed by BuildStandard::getPlatform, getBuildStandard
52
   * @attribute
53
   */
54
  public static final String mGenericMachtype = System.getenv("GBE_MACHTYPE");
55
 
56
  /**build dependencies by package alias
57
   * @attribute
58
   */
864 mhunt 59
  Vector<String> mDependencyCollection = new Vector<String>();
814 mhunt 60
 
61
  /**primary package version key pv_id in database
62
   * @attribute
63
   */
64
  int mId;
65
 
66
  /**indication of the nature of change
67
   * @attribute
68
   */
69
  Package.VersionNumberingStandard mChangeType = new VersionNumberingStandard();
70
 
71
  /**determines what field is rippled on a package version whose dependencies have changed
72
   * @attribute
73
   */
74
  Package.VersionNumberingStandard mRippleField = new VersionNumberingStandard();
75
 
76
  /**interested owners
77
   * @attribute
78
   */
864 mhunt 79
  private Vector<String> mBuildFailureEmailCollection = new Vector<String>();
814 mhunt 80
 
81
  /**when true will trigger unit tests as part of the package build phase in daemon mode
82
   * @attribute
83
   */
84
  boolean mHasAutomatedUnitTests = false;
85
 
86
  /**when true, do not ripple this package through packages which are dependent upon it in daemon mode
87
   * @attribute
88
   */
89
  boolean mAdvisoryRipple = false;
90
 
91
  /**determines the build file the package is built in, or not
92
   *  1 buildfile 1 etc
93
   *  0 not yet processed (initial value)
94
   * -1 not reproducible
95
   * -2 not reproducible on the build platforms configured for this release
96
   * -3 do not ripple
97
   * -4 directly dependent on package versions not in the baseline
98
   * -5 indirectly dependent on package versions which are not reproducible
99
   *    because of -1, -2 (escrow), -3 (daemon), -4
100
   * @attribute
101
   */
102
  int mBuildFile = 0;
103
 
104
  /**build dependencies by package
105
   * @attribute
106
   */
864 mhunt 107
  Vector<Package> mPackageDependencyCollection = new Vector<Package>();
814 mhunt 108
 
109
  /**used for escrow build purposes
110
   * set true when a package has been processed
111
   * @attribute
112
   */
113
  boolean mProcessed = false;
114
 
115
  /**set true for WIP package versions
116
   * only used in daemon mode
117
   * @attribute
118
   */
119
  boolean mDirectlyPlanned = false;
120
 
121
  /**set true when it is determined to be ripple built
122
   * @attribute
123
   */
124
  boolean mIndirectlyPlanned = false;
125
 
126
  /**build dependencies by pv_id (-1 or not used for planned dependencies)
127
   * @attribute
128
   */
864 mhunt 129
  Vector<Integer> mDependencyIDCollection = new Vector<Integer>();
814 mhunt 130
 
131
  /**unique pkg_id in the database
132
   * used for querying package version existence in the database in daemon mode
133
   * @attribute
134
   */
135
  int mPid;
136
 
874 mhunt 137
  /**maximum major number supported for determining ripple number
138
   * @attribute
139
   */
140
  int mMajorLimit;
141
 
142
  /**maximum minor number supported for determining ripple number
143
   * @attribute
144
   */
145
  int mMinorLimit;
146
 
147
  /**maximum patch number supported for determining ripple number
148
   * @attribute
149
   */
150
  int mPatchLimit;
151
 
152
  /**maximum build number number supported for determining ripple number
153
   * @attribute
154
   */
155
  int mBuildLimit;
156
 
814 mhunt 157
  /**Logger
158
   * @attribute
159
   */
160
  private static final Logger mLogger = Logger.getLogger(Package.class);
161
 
162
  /**dpkg archive location
163
   * @attribute
164
   */
165
  public static final String mGbeDpkg = System.getenv("GBE_DPKG");
166
 
167
  /**deploy archive location
168
   * @attribute
169
   */
170
  public static final String mGbeDply = System.getenv("GBE_DPLY");
171
 
172
  /**true if the package exists in the dpkg or deploy archive
173
   * @attribute
174
   */
175
  private boolean mArchivalExistence = true;
176
 
852 mhunt 177
  /**when true will trigger source control interaction eg labelling
178
   * @attribute
179
   */
180
  public boolean mRequiresSourceControlInteraction = true;
181
 
814 mhunt 182
  /**constructor
183
   */
184
  Package(int pv_id, String pkg_name, String v_ext, String alias, 
185
          String pkg_label, String src_path, char change_type)
186
  {
187
    mLogger.debug("Package 1: pv_id " + pv_id + " pkg_name " + pkg_name + " v_ext " + v_ext + " alias " + alias + " pkg_label " + pkg_label + " src_path " + src_path + " change_type " + change_type);
188
    mId = pv_id;
189
    mName = pkg_name;
190
    mVersion = "0.0.0000";
191
    mExtension = v_ext;
192
    mAlias = alias;
193
    mLabel = pkg_label;
194
    mLocation = src_path;
195
 
196
    if (change_type == 'M')
197
    {
198
      mChangeType.setMajor();
199
    }
200
    else if (change_type == 'N')
201
    {
202
      mChangeType.setMinor();
203
    }
204
    else
205
    {
206
      mChangeType.setPatch();
207
    }
208
  }
209
 
210
  /**constructor
211
   */
212
  Package(int pv_id, String pkg_name, String pkg_version, String v_ext, 
213
          String alias, String pkg_label, String src_path, 
214
          char ripple_field)
215
  {
216
    mLogger.debug("Package 2: pv_id " + pv_id + " pkg_name " + pkg_name + " pkg_version " + pkg_version + " v_ext " + v_ext + " alias " + alias + " pkg_label " + pkg_label + " src_path " + src_path + " ripple_field " + ripple_field);
217
    mId = pv_id;
218
    mName = pkg_name;
219
    mVersion = pkg_version;
220
    int endindex = mVersion.length() - v_ext.length();
221
 
222
    if ( endindex > 0 )
223
    {
224
      mVersion = mVersion.substring(0, endindex);
225
    }
226
 
227
    mExtension = v_ext;
228
    mAlias = alias;
229
    mLabel = pkg_label;
230
    mLocation = src_path;
231
 
874 mhunt 232
    // setBuild is the default
814 mhunt 233
    if (ripple_field == 'M')
234
    {
235
      mRippleField.setMajor();
236
    }
237
    else if (ripple_field == 'm')
238
    {
239
      mRippleField.setMinor();
240
    }
241
    else if (ripple_field == 'p')
242
    {
243
      mRippleField.setPatch();
244
    }
874 mhunt 245
    else if (ripple_field == 'L')
246
    {
247
      mRippleField.setLimit();
248
    }
814 mhunt 249
  }
250
 
251
  /**constructor
252
   */
253
  Package()
254
  {
255
    mLogger.debug("Package 3");
256
    mId = 0;
257
    mName = "null";
258
    mExtension = "null";
259
    mAlias = "null";
260
    mLabel = "null";
261
    mLocation = "null";
262
  }
263
 
874 mhunt 264
  /**constructor for unit test purposes
265
  */
266
  public Package(ReleaseManager rm, String version, int majorLimit, int minorLimit, int patchLimit, int buildNumberLimit)
267
  {
268
    mId = -1;
269
    mRippleField.setLimit();
270
    mVersion = version;
271
    mMajorLimit = majorLimit;
272
    mMinorLimit = minorLimit;
273
    mPatchLimit = patchLimit;
274
    mBuildLimit = buildNumberLimit;
275
    try
276
    {
277
      mId = applyPV( rm, 0 );
278
    }
279
    catch(Exception e)
280
    {
281
    }
282
  }
283
 
284
  /**accessor for unit test purposes
285
   */
286
  public int getId()
287
  {
288
    return mId;
289
  }
290
 
291
  /**accessor for unit test purposes
292
   */
293
  public String getVersion()
294
  {
295
    return mVersion;
296
  }
297
 
814 mhunt 298
  /**returns true if mBuildStandardCollection is not empty
299
   */
300
  boolean isReproducible()
301
  {
302
    mLogger.debug("isReproducible on Package " + mName);
303
    boolean retVal = false;
304
 
305
    if ( mBuildStandardCollection.size() > 0 )
306
    {
307
      retVal = true;
308
    }
309
 
310
    mLogger.info("isReproducible returned " + retVal);
311
    return retVal;
312
  }
313
 
314
  /**returns true if at least one of its BuildStandards has mWin32 or mGeneric true
315
   */
316
  boolean isWin32Built()
317
  {
318
    mLogger.debug("isWin32Built on Package " + mName);
319
    boolean retVal = false;
864 mhunt 320
    for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext(); )
814 mhunt 321
    {
864 mhunt 322
      BuildStandard buildStandard = it.next();
814 mhunt 323
 
324
      if (buildStandard.getWin32() || buildStandard.getGeneric())
325
      {
326
        retVal = true;
327
        break;
328
      }
329
    }
330
 
331
    mLogger.info("isWin32Built returned " + retVal);
332
    return retVal;
333
  }
334
 
335
  /**returns true if at least one of its BuildStandards has mSolaris or mGeneric true
336
   */
337
  boolean isSolarisBuilt()
338
  {
339
    mLogger.debug("isSolarisBuilt on Package " + mName);
340
    boolean retVal = false;
864 mhunt 341
    for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext(); )
814 mhunt 342
    {
864 mhunt 343
      BuildStandard buildStandard = it.next();
814 mhunt 344
 
345
      if (buildStandard.getSolaris() || buildStandard.getGeneric())
346
      {
347
        retVal = true;
348
        break;
349
      }
350
    }
351
 
352
    mLogger.info("isSolarisBuilt returned " + retVal);
353
    return retVal;
354
  }
355
 
356
  /**returns true if at least one of its BuildStandards has mLinux or mGeneric true
357
   */
358
  boolean isLinuxBuilt()
359
  {
360
    mLogger.debug("isLinuxBuilt on Package " + mName);
361
    boolean retVal = false;
864 mhunt 362
    for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext(); )
814 mhunt 363
    {
864 mhunt 364
      BuildStandard buildStandard = it.next();
814 mhunt 365
 
366
      if (buildStandard.getLinux() || buildStandard.getGeneric())
367
      {
368
        retVal = true;
369
        break;
370
      }
371
    }
372
 
373
    mLogger.info("isLinuxBuilt returned " + retVal);
374
    return retVal;
375
  }
376
 
377
  /**returns true if at least one of its BuildStandards has mGeneric true
378
   */
379
  boolean isGeneric()
380
  {
381
    mLogger.debug("isGeneric on Package " + mName);
382
    boolean retVal = false;
864 mhunt 383
    for (Iterator<BuildStandard> it = mBuildStandardCollection.iterator(); it.hasNext(); )
814 mhunt 384
    {
864 mhunt 385
      BuildStandard buildStandard = it.next();
814 mhunt 386
 
387
      if (buildStandard.getGeneric())
388
      {
389
        retVal = true;
390
        break;
391
      }
392
    }
393
 
394
    mLogger.info("isGeneric returned " + retVal);
395
    return retVal;
396
  }
397
 
398
  /**applies the required version number change
874 mhunt 399
   * returns 0 on success
400
   *         1 on cannot work with non standard versioning
401
   *         2 on ripple field limitations prevent a ripple build
814 mhunt 402
   */
874 mhunt 403
  int applyPV(ReleaseManager releaseManager, int rtag_id) throws Exception
814 mhunt 404
  {
405
    mLogger.debug("applyPV on Package " + mName);
406
    // three scenarios, only applyPV for 2 of them
407
    // WIP exists:                      mDirectlyPlanned == true;   mIndirectlyPlanned == true; mArchivalExistence don't care - applyPV
408
    // Package version is out of date:  mDirectlyPlanned == false;  mIndirectlyPlanned == true; mArchivalExistence == true    - applyPV
409
    // Package version does not exist:  mDirectlyPlanned == false;  mIndirectlyPlanned == true; mArchivalExistence == false   - do not applyPV
410
    if ( !mDirectlyPlanned && mIndirectlyPlanned && !mArchivalExistence )
411
    {
412
      // the package has an mIndirectlyPlanned flag set true in daemon mode because the package does not exist in an archive
413
      // do not apply a different package version
414
      mLogger.info("applyPV !mDirectlyPlanned && mIndirectlyPlanned && !mArchivalExistence on Package " + mName);
836 mhunt 415
      releaseManager.claimVersion(mPid, mVersion + mExtension, rtag_id);
874 mhunt 416
      mLogger.info("applyPv returned 0");
417
      return 0;
814 mhunt 418
    }
419
 
420
    int major = 0;
421
    int minor = 0;
422
    int patch = 1000;
423
 
424
    String field[] = mVersion.split("\\D");
425
 
426
    if ( field.length == 3 )
427
    {
428
      major = Integer.parseInt(field[0]);
429
      minor = Integer.parseInt(field[1]);
430
      patch = Integer.parseInt(field[2]);
431
    }
432
    else
433
    {
434
      // cannot work with non standard versioning
435
      mLogger.error("applyPV cannot work with non standard versioning");
874 mhunt 436
      mLogger.info("applyPv returned 1");
437
      return 1;
814 mhunt 438
    }
439
 
440
    if ( patch < 1000 && field[2].substring(0, 1).compareTo("0") != 0 )
441
    {
442
      mLogger.info("applyPV accomodate old style mVersion of the form 1.0.1");
443
      patch = patch * 1000;
444
    }
445
 
446
    // mChangeType overrides mRippleField
447
    do
448
    {
449
      if ( mChangeType.mMajor )
450
      {
451
        major++;
452
        mLogger.info("applyPV mChangeType.mMajor " + major);
453
        minor = 0;
454
        patch = 0;
455
      }
456
      else if ( mChangeType.mMinor )
457
      {
458
        minor++;
459
        mLogger.info("applyPV mChangeType.mMinor " + minor);
460
        patch = 0;
461
      }
462
      else if ( mChangeType.mPatch )
463
      {
464
        do
465
        {
466
          patch++;
467
        } while ( ( patch / 1000 ) * 1000 != patch );
468
        mLogger.info("applyPV mChangeType.mPatch " + patch);
469
      }
470
      else
471
      {
472
        if ( mRippleField.mMajor )
473
        {
474
          major++;
475
          mLogger.info("applyPV mRippleField.mMajor " + major);
476
          minor = 0;
477
          patch = 0;
478
        }
479
        else if ( mRippleField.mMinor )
480
        {
481
          minor++;
482
          mLogger.info("applyPV mRippleField.mMinor " + minor);
483
          patch = 0;
484
        }
485
        else if ( mRippleField.mPatch )
486
        {
487
          do
488
          {
489
            patch++;
490
          } while ( ( patch / 1000 ) * 1000 != patch );
491
          mLogger.info("applyPV mRippleField.mPatch " + patch);
492
        }
874 mhunt 493
        else if ( mRippleField.mBuild )
814 mhunt 494
        {
495
          patch++;
874 mhunt 496
          mLogger.info("applyPV mRippleField.mBuild " + patch);
814 mhunt 497
        }
874 mhunt 498
        else
499
        {
500
          // increment fields according to limits
501
          boolean changeOccurred = false;
502
          boolean incrementField = true;
503
 
504
          if ( mBuildLimit != 0 )
505
          {
506
            // increment or reset the patch build number
507
            if ( patch < mBuildLimit )
508
            {
509
              // can increment the patch build number
510
              patch++;
511
              mLogger.info("applyPv mRippleField.mLimit build number " + patch);
512
              changeOccurred = true;
513
              incrementField = false;
514
            }
515
            else
516
            {
517
              if ( mPatchLimit == 0 )
518
              {
519
                // reset the patch number and patch build number
520
                patch = 0;
521
              }
522
            }
523
          }
524
 
525
          if ( mPatchLimit != 0 && incrementField )
526
          {
527
            // increment or reset the patch number
528
            if ( ( patch / 1000 ) < mPatchLimit )
529
            {
530
              do
531
              {
532
                patch++;
533
              } while ( ( patch / 1000 ) * 1000 != patch );
534
 
535
              mLogger.info("applyPv mRippleField.mLimit patch " + patch);
536
              changeOccurred = true;
537
              incrementField = false;
538
            }
539
            else
540
            {
541
              // reset the patch number and patch build number
542
              patch = 0;
543
            }
544
          }
545
 
546
          if ( mMinorLimit != 0 && incrementField )
547
          {
548
            // increment or reset the minor number
549
            if ( minor < mMinorLimit )
550
            {
551
              minor++;
552
              mLogger.info("applyPv mRippleField.mLimit minor " + minor);
553
              changeOccurred = true;
554
              incrementField = false;
555
            }
556
            else
557
            {
558
              // reset the minor number
559
              minor = 0;
560
            }
561
          }
562
 
563
          if ( mMajorLimit != 0 && incrementField )
564
          {
565
            // increment or reset the major number
566
            if ( major < mMajorLimit )
567
            {
568
              // increment the major number
569
              changeOccurred = true;
570
              major++;
571
              mLogger.info("applyPv mRippleField.mLimit major " + major);
572
            }
573
          }
574
 
575
          if ( !changeOccurred )
576
          {
577
            // unable to increment a field due to field limitations
578
            mLogger.error("applyPV ripple field limitations prevent a ripple build");
579
            mLogger.info("applyPv returned 2");
580
            return 2;
581
          }
582
        }
814 mhunt 583
      }
584
 
585
      mVersion = String.valueOf(major) + "." + String.valueOf(minor) + ".";
586
 
587
      if ( patch < 10 )
588
      {
589
        mVersion += "000";
590
      }
591
      else if ( patch < 100 )
592
      {
593
        mVersion += "00";
594
      }
595
      else if ( patch < 1000 )
596
      {
597
        mVersion += "0";
598
      }
599
 
600
      mVersion += String.valueOf(patch);
601
    } while ( exists(releaseManager, rtag_id) );
602
 
603
    releaseManager.claimVersion(mPid, mVersion + mExtension, rtag_id);
874 mhunt 604
    mLogger.info("applyPv returned 0");
605
    return 0;
814 mhunt 606
  }
607
 
608
  /**returns true if the version exists in the dpkg_archive, deploy_archive or release manager database
609
   * claims the version in the release manager database
610
   */
611
  private boolean exists(ReleaseManager releaseManager, int rtag_id) throws Exception
612
  {
613
    mLogger.debug("exists 1 on Package " + mName + " version " + mVersion + " extension " + mExtension);
614
    boolean retVal = false;
615
 
864 mhunt 616
    if ( !ReleaseManager.mUseDatabase )
814 mhunt 617
    {
618
      mLogger.info("exists 1 !releaseManager.mUseDatabase");
619
    }
620
    else
621
    {
622
      retVal = exists();
623
 
624
      if ( !retVal )
625
      {
626
        String pkg_version = new String(mVersion);
627
 
628
        if ( mExtension.length() > 0 )
629
        {
630
          pkg_version += mExtension;
631
        }
632
 
633
        retVal = releaseManager.queryPackageVersions(mPid, pkg_version);
634
      }
635
    }
636
 
637
    mLogger.info("exists 1 returned " + retVal);
638
    return retVal;
639
  }
640
 
641
  /**returns true if the version exists in the dpkg_archive or deploy_archive
642
   */
643
  boolean exists()
644
    throws Exception
645
  {
646
    mLogger.debug("exists 2 on Package " + mName);
647
    boolean retVal = false;
648
 
649
    String Release = mGbeDpkg;
650
    String Deploy = mGbeDply;
651
 
652
    if (Release == null || Deploy == null)
653
    {
868 mhunt 654
      mLogger.fatal("exists 2 Release == null || Deploy == null");
655
      throw new Exception("exists 2 Release == null || Deploy == null");
814 mhunt 656
    }
657
 
658
    String fs = System.getProperty( "file.separator" );
659
    String name = new String(Release);
660
    name += fs + mName + fs + mVersion + mExtension;
661
    File release = new File(name);
662
 
663
    if (release.exists())
664
    {
665
      mLogger.info("exists 2 release.exists()");
666
      retVal = true;
667
    }
668
 
669
    if (!retVal && (Release != Deploy))
670
    {
671
      name = Deploy + fs + mName + fs + mVersion + mExtension;
672
 
673
      File deploy = new File(name);
674
 
675
      if (deploy.exists())
676
      {
677
        mLogger.info("exists 2 deploy.exists()");
678
        retVal = true;
679
      }
680
    }
681
 
682
    mArchivalExistence = retVal;
683
    mLogger.info("exists 2 returned " + retVal);
684
    return retVal;
685
  }
854 mhunt 686
 
687
  /**returns email information
688
   */
689
  String emailInfo( String lf )
690
  {
691
    String retVal = new String();
692
 
864 mhunt 693
    for (Iterator<String> it = mBuildFailureEmailCollection.iterator(); it.hasNext(); )
854 mhunt 694
    {
864 mhunt 695
      String email = it.next();
854 mhunt 696
      retVal +=
697
      "  <owner email=\"" + email +"\"/>" + lf;
698
    }
699
 
700
    return retVal;
701
  }
814 mhunt 702
 
866 mhunt 703
  /**returns email information
704
   */
705
  String emailInfoNonAntTask()
706
  {
707
    String retVal = null;
708
 
709
    for (Iterator<String> it = mBuildFailureEmailCollection.iterator(); it.hasNext(); )
710
    {
711
      String email = it.next();
712
 
713
      if ( retVal == null )
714
      {
715
        retVal = new String();
716
      }
717
      else
718
      {
719
        retVal += ",";
720
      }
721
      retVal += email;
722
    }
723
 
724
    return retVal;
725
  }
726
 
864 mhunt 727
  /**adds email to mBuildFailureEmailCollection if unique
728
   */
729
  void addEmail( String email )
730
  {
731
    boolean alreadyExists = false;
732
 
733
    for (Iterator<String> it = mBuildFailureEmailCollection.iterator(); it.hasNext(); )
734
    {
735
      String existingEmail = it.next();
736
 
737
      if ( existingEmail.compareTo(email) == 0 )
738
      {
739
        alreadyExists = true;
740
        break;
741
      }
742
    }
743
 
744
    if ( !alreadyExists )
745
    {
746
      mBuildFailureEmailCollection.add(email);
747
    }
748
  }
749
 
814 mhunt 750
  /**entity class supporting the ERG version numbering standard:
751
   * <major>.<minor>.<patch/build>
752
   * patch/build is at least a 4 digit number whose last 3 digits represent the build
753
   */
754
  public class VersionNumberingStandard
755
  {
756
    /**in terms of the mChangeType Package field,
757
     * when true indicates the contract of the package has changed in a non backwardly compatible manner
758
     * in terms of the mRippleField Package field,
759
     * when true indicates the major version number will be incremented
760
     * @attribute
761
     */
762
    private boolean mMajor = false;
763
 
764
    /**in terms of the mChangeType Package field,
765
     * when true indicates the contract of the package has changed in a backwardly compatible manner
766
     * in terms of the mRippleField Package field,
767
     * when true indicates the minor version number will be incremented
768
     * @attribute
769
     */
770
    private boolean mMinor = false;
771
 
772
    /**in terms of the mChangeType Package field,
773
     * when true indicates the contract of the package has not changed, but the package has changed internally
774
     * in terms of the mRippleField Package field,
775
     * when true indicates the minor version number will be incremented
776
     * @attribute
777
     */
778
    private boolean mPatch = false;
779
 
780
    /**in terms of the mChangeType Package field,
781
     * when true indicates the package has not changed, its dependencies potentially have
782
     * in terms of the mRippleField Package field,
783
     * when true indicates the build number will be incremented
784
     * @attribute
785
     */
786
    private boolean mBuild = true;
787
 
874 mhunt 788
    /**in terms of the mChangeType Package field,
789
     * always false, does not apply
790
     * in terms of the mRippleField Package field,
791
     * when true indicates the major, minor, patch and build number will be incremented according to field limits
792
     * @attribute
793
     */
794
    private boolean mLimit = false;
795
 
814 mhunt 796
    /**constructor
797
     */
798
    private VersionNumberingStandard()
799
    {
800
      mLogger.debug("VersionNumberingStandard");
801
    }
802
 
874 mhunt 803
    /**sets mBuild true, mMajor false, mMinor false, mPatch false, mLimit false
814 mhunt 804
     */
805
    void setBuild()
806
    {
807
      mLogger.debug("setBuild");
808
      mBuild = true;
809
      mMajor = false;
810
      mMinor = false;
811
      mPatch = false;
874 mhunt 812
      mLimit = false;
814 mhunt 813
    }
814
 
874 mhunt 815
    /**sets mBuild false, mMajor true, mMinor false, mPatch false, mLimit false
814 mhunt 816
     */
817
    void setMajor()
818
    {
819
      mLogger.debug("setMajor");
820
      mBuild = false;
821
      mMajor = true;
822
      mMinor = false;
823
      mPatch = false;
874 mhunt 824
      mLimit = false;
814 mhunt 825
    }
826
 
874 mhunt 827
    /**sets mBuild false, mMajor false, mMinor true, mPatch false, mLimit false
814 mhunt 828
     */
829
    void setMinor()
830
    {
831
      mLogger.debug("setMinor");
832
      mBuild = false;
833
      mMajor = false;
834
      mMinor = true;
835
      mPatch = false;
874 mhunt 836
      mLimit = false;
814 mhunt 837
    }
838
 
874 mhunt 839
    /**sets mBuild false, mMajor false, mMinor false, mPatch true, mLimit false
814 mhunt 840
     */
841
    void setPatch()
842
    {
843
      mLogger.debug("setPatch");
844
      mBuild = false;
845
      mMajor = false;
846
      mMinor = false;
847
      mPatch = true;
874 mhunt 848
      mLimit = false;
814 mhunt 849
    }
850
 
874 mhunt 851
    /**sets mBuild false, mMajor false, mMinor false, mPatch false, mLimit true
852
     */
853
    void setLimit()
854
    {
855
      mLogger.debug("setPatch");
856
      mBuild = false;
857
      mMajor = false;
858
      mMinor = false;
859
      mPatch = false;
860
      mLimit = true;
861
    }
862
 
814 mhunt 863
  }
864
 
865
}