Subversion Repositories DevTools

Rev

Rev 862 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 862 Rev 864
Line 1... Line 1...
1
package com.erggroup.buildtool.ripple;
1
package com.erggroup.buildtool.ripple;
2
 
2
 
3
import java.io.File;
3
import java.io.File;
4
 
4
 
5
import java.io.FileOutputStream;
-
 
6
 
-
 
7
import java.io.FileWriter;
5
import java.io.FileWriter;
8
 
6
 
9
import java.sql.SQLException;
7
import java.sql.SQLException;
10
 
8
 
11
import java.util.Iterator;
9
import java.util.Iterator;
Line 22... Line 20...
22
  /**collection of gbemachtypes in String form associated with the baseline
20
  /**collection of gbemachtypes in String form associated with the baseline
23
   * limited to the following items "win32", "sparc", "solaris10_sparc32", "solaris10_x86", "linux_i386"
21
   * limited to the following items "win32", "sparc", "solaris10_sparc32", "solaris10_x86", "linux_i386"
24
   * accessed by Package::isLinuxBuilt, isSolarisBuilt, isWin32Built
22
   * accessed by Package::isLinuxBuilt, isSolarisBuilt, isWin32Built
25
   * @attribute
23
   * @attribute
26
   */
24
   */
27
  Vector mGbeMachtypeCollection = new Vector();
25
  Vector<String> mGbeMachtypeCollection = new Vector<String>();
28
 
26
 
29
  /**configured mail server
27
  /**configured mail server
30
   * @attribute
28
   * @attribute
31
   */
29
   */
32
  String mMailServer = new String();
30
  String mMailServer = new String();
Line 42... Line 40...
42
  String mBaselineName = new String();
40
  String mBaselineName = new String();
43
 
41
 
44
  /**collection of released pv_ids associated with the release
42
  /**collection of released pv_ids associated with the release
45
   * @attribute
43
   * @attribute
46
   */
44
   */
47
  Vector mReleasedPvIDCollection = new Vector();
45
  Vector<Integer> mReleasedPvIDCollection = new Vector<Integer>();
48
 
46
 
49
  /**timestamp associated with build file generation
47
  /**timestamp associated with build file generation
50
   * @attribute
48
   * @attribute
51
   */
49
   */
52
  long mTimestamp = 0;
50
  long mTimestamp = 0;
Line 62... Line 60...
62
  private static final Logger mLogger = Logger.getLogger(RippleEngine.class);
60
  private static final Logger mLogger = Logger.getLogger(RippleEngine.class);
63
 
61
 
64
  /**collection of escrow clearcase support file content in String form, set_up
62
  /**collection of escrow clearcase support file content in String form, set_up
65
   * @attribute
63
   * @attribute
66
   */
64
   */
67
  private Vector mEscrowClearcaseSupportCollection = new Vector();
65
  private Vector<String> mEscrowClearcaseSupportCollection = new Vector<String>();
68
 
66
 
69
  /**package versions representing the baseline
67
  /**package versions representing the baseline
70
   * @aggregation shared
68
   * @aggregation shared
71
   * @attribute
69
   * @attribute
72
   */
70
   */
73
  private Vector mPackageCollection = new Vector();
71
  private Vector<Package> mPackageCollection = new Vector<Package>();
74
 
72
 
75
  /**index to current String item
73
  /**index to current String item
76
   * @attribute
74
   * @attribute
77
   */
75
   */
78
  private int mBuildIndex;
76
  private int mBuildIndex;
Line 95... Line 93...
95
  boolean mDaemon;
93
  boolean mDaemon;
96
 
94
 
97
  /**collection of build file content in String form
95
  /**collection of build file content in String form
98
   * @attribute
96
   * @attribute
99
   */
97
   */
100
  private Vector mBuildCollection = new Vector();
98
  private Vector<String> mBuildCollection = new Vector<String>();
101
 
99
 
102
  /**constructor
100
  /**constructor
103
   */
101
   */
104
  public RippleEngine(ReleaseManager releaseManager, int rtag_id, 
102
  public RippleEngine(ReleaseManager releaseManager, int rtag_id, 
105
                      boolean isDaemon)
103
                      boolean isDaemon)
Line 137... Line 135...
137
    collectMetaData();
135
    collectMetaData();
138
    
136
    
139
    mReleaseManager.queryPackageVersions(this, mPackageCollection, mDaemon, mBaseline);
137
    mReleaseManager.queryPackageVersions(this, mPackageCollection, mDaemon, mBaseline);
140
    
138
    
141
    // set up mPackageDependencyCollection
139
    // set up mPackageDependencyCollection
142
    for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
140
    for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
143
    {
141
    {
144
      Package p = (Package) it.next();
142
      Package p = it.next();
145
       
143
       
146
      for (Iterator it2 = p.mDependencyCollection.iterator(); it2.hasNext(); )
144
      for (Iterator<String> it2 = p.mDependencyCollection.iterator(); it2.hasNext(); )
147
      {
145
      {
148
        String alias = (String) it2.next();
146
        String alias = it2.next();
149
        Package dependency = findPackage(alias);
147
        Package dependency = findPackage(alias);
150
        
148
        
151
        if (dependency == ReleaseManager.NULL_PACKAGE)
149
        if (dependency == ReleaseManager.NULL_PACKAGE)
152
        {
150
        {
153
          mLogger.info("planRelease dependency is not in the baseline " + alias);
151
          mLogger.info("planRelease dependency is not in the baseline " + alias);
Line 163... Line 161...
163
        p.mPackageDependencyCollection.add(dependency);
161
        p.mPackageDependencyCollection.add(dependency);
164
      }
162
      }
165
    }
163
    }
166
    
164
    
167
    // process packages which are not reproducible, and all packages dependent upon them      
165
    // process packages which are not reproducible, and all packages dependent upon them      
168
    for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
166
    for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
169
    {
167
    {
170
      Package p = (Package) it.next();
168
      Package p = it.next();
171
 
169
 
172
      if (p.mBuildFile == 0)
170
      if (p.mBuildFile == 0)
173
      {
171
      {
174
        // package has yet to be processed
172
        // package has yet to be processed
175
        if (!p.isReproducible())
173
        if (!p.isReproducible())
Line 187... Line 185...
187
        }
185
        }
188
      }
186
      }
189
    }
187
    }
190
    
188
    
191
    // process packages which are not reproducible on the build platforms configured for this baseline
189
    // process packages which are not reproducible on the build platforms configured for this baseline
192
    for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
190
    for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
193
    {
191
    {
194
      Package p = (Package) it.next();
192
      Package p = it.next();
195
       
193
       
196
      if (p.mBuildFile == 0)
194
      if (p.mBuildFile == 0)
197
      {
195
      {
198
        // package has yet to be processed
196
        // package has yet to be processed
199
        // assume it does not need to be reproduced for this baseline
197
        // assume it does not need to be reproduced for this baseline
200
        boolean reproduce = false;
198
        boolean reproduce = false;
201
         
199
         
202
        for (Iterator it2 = mGbeMachtypeCollection.iterator(); it2.hasNext(); )
200
        for (Iterator<String> it2 = mGbeMachtypeCollection.iterator(); it2.hasNext(); )
203
        {
201
        {
204
          String machtype = (String) it2.next();
202
          String machtype = it2.next();
205
          
203
          
206
          if ( machtype.compareTo("linux_i386") == 0 )
204
          if ( machtype.compareTo("linux_i386") == 0 )
207
          {
205
          {
208
            if ( p.isLinuxBuilt() )
206
            if ( p.isLinuxBuilt() )
209
            {
207
            {
Line 251... Line 249...
251
    }      
249
    }      
252
      
250
      
253
    if (mDaemon)
251
    if (mDaemon)
254
    {
252
    {
255
      // process packages which are not ripple buildable, and all packages dependent upon them      
253
      // process packages which are not ripple buildable, and all packages dependent upon them      
256
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
254
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
257
      {
255
      {
258
        Package p = (Package) it.next();
256
        Package p = it.next();
259
 
257
 
260
        if (p.mBuildFile == 0)
258
        if (p.mBuildFile == 0)
261
        {
259
        {
262
          // package has yet to be processed
260
          // package has yet to be processed
263
          if (p.mDoNotRipple)
261
          if (p.mDoNotRipple)
Line 272... Line 270...
272
          }
270
          }
273
        }
271
        }
274
      }
272
      }
275
      
273
      
276
      // process packages which need to be ripple built
274
      // process packages which need to be ripple built
277
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
275
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
278
      {
276
      {
279
        Package p = (Package) it.next();
277
        Package p = it.next();
280
 
278
 
281
        if (p.mBuildFile == 0)
279
        if (p.mBuildFile == 0)
282
        {
280
        {
283
          // package has yet to be processed
281
          // package has yet to be processed
284
          if (p.mDirectlyPlanned)
282
          if (p.mDirectlyPlanned)
Line 288... Line 286...
288
            mLogger.info("planRelease package has WIP " + p.mName);
286
            mLogger.info("planRelease package has WIP " + p.mName);
289
            rippleIndirectlyPlanned(p);
287
            rippleIndirectlyPlanned(p);
290
          }
288
          }
291
          else
289
          else
292
          {
290
          {
293
            Iterator it2 = p.mDependencyIDCollection.iterator();
291
            Iterator<Integer> it2 = p.mDependencyIDCollection.iterator();
294
            Iterator it3 = p.mPackageDependencyCollection.iterator();
292
            Iterator<Package> it3 = p.mPackageDependencyCollection.iterator();
295
            for ( ; it2.hasNext() && it3.hasNext(); )
293
            for ( ; it2.hasNext() && it3.hasNext(); )
296
            {
294
            {
297
              Integer dpv_id = (Integer) it2.next();
295
              Integer dpv_id = it2.next();
298
              Package dependency = (Package) it3.next();
296
              Package dependency = it3.next();
299
 
297
 
300
              if ( !dependency.mAdvisoryRipple )
298
              if ( !dependency.mAdvisoryRipple )
301
              {
299
              {
302
                // not advisory, ie has ripple build impact
300
                // not advisory, ie has ripple build impact
303
                boolean found = false;
301
                boolean found = false;
304
                 
302
                 
305
                for ( Iterator it4 = mReleasedPvIDCollection.iterator(); it4.hasNext(); )
303
                for ( Iterator<Integer> it4 = mReleasedPvIDCollection.iterator(); it4.hasNext(); )
306
                {
304
                {
307
                  Integer pv_id = (Integer) it4.next();
305
                  Integer pv_id = it4.next();
308
 
306
 
309
                  if ( pv_id.compareTo(dpv_id) == 0 )
307
                  if ( pv_id.compareTo(dpv_id) == 0 )
310
                  {
308
                  {
311
                    found = true;
309
                    found = true;
312
                    break;
310
                    break;
Line 326... Line 324...
326
          }
324
          }
327
        }
325
        }
328
      }
326
      }
329
      
327
      
330
      // process packages which do not exist in the archive
328
      // process packages which do not exist in the archive
331
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
329
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
332
      {
330
      {
333
        Package p = (Package) it.next();
331
        Package p = it.next();
334
 
332
 
335
        if (p.mBuildFile == 0)
333
        if (p.mBuildFile == 0)
336
        {
334
        {
337
          // package has yet to be processed
335
          // package has yet to be processed
338
          // for unit test purposes, assume all packages exist in the archive if released
336
          // for unit test purposes, assume all packages exist in the archive if released
339
          if ( mReleaseManager.mUseDatabase )
337
          if ( ReleaseManager.mUseDatabase )
340
          {
338
          {
341
            // only check existence outside the unit test
339
            // only check existence outside the unit test
342
            if (!p.mDirectlyPlanned && !p.mIndirectlyPlanned)
340
            if (!p.mDirectlyPlanned && !p.mIndirectlyPlanned)
343
            {
341
            {
344
              // check package version archive existence
342
              // check package version archive existence
Line 400... Line 398...
400
      do
398
      do
401
      {
399
      {
402
        // assume all dependencies have been processed
400
        // assume all dependencies have been processed
403
        allDependenciesProcessed = true;
401
        allDependenciesProcessed = true;
404
        
402
        
405
        for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
403
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
406
        {
404
        {
407
          Package p = (Package) it.next();
405
          Package p = it.next();
408
          
406
          
409
          if ( mDaemon && ( ( !p.mDirectlyPlanned && !p.mIndirectlyPlanned ) || p.mBuildFile < 0 ) )
407
          if ( mDaemon && ( ( !p.mDirectlyPlanned && !p.mIndirectlyPlanned ) || p.mBuildFile < 0 ) )
410
          {
408
          {
411
            // flag packages with no build requirement as processed in daemon mode
409
            // flag packages with no build requirement as processed in daemon mode
412
            p.mProcessed = true;
410
            p.mProcessed = true;
Line 420... Line 418...
420
              // in daemon mode has a build requirement or
418
              // in daemon mode has a build requirement or
421
              // in escrow mode
419
              // in escrow mode
422
              boolean canBeBuiltNow = true;
420
              boolean canBeBuiltNow = true;
423
              boolean allDependenciesForThisPackageProcessed = true;
421
              boolean allDependenciesForThisPackageProcessed = true;
424
              
422
              
425
              for ( Iterator it2 = p.mPackageDependencyCollection.iterator(); it2.hasNext(); )
423
              for ( Iterator<Package> it2 = p.mPackageDependencyCollection.iterator(); it2.hasNext(); )
426
              {
424
              {
427
                Package dependency = (Package) it2.next();
425
                Package dependency = it2.next();
428
                
426
                
429
                if ( !dependency.mProcessed )
427
                if ( !dependency.mProcessed )
430
                {
428
                {
431
                  // cannot determine canBeBuiltNow until this dependency has been processed
429
                  // cannot determine canBeBuiltNow until this dependency has been processed
432
                  allDependenciesForThisPackageProcessed = false;
430
                  allDependenciesForThisPackageProcessed = false;
Line 526... Line 524...
526
        }
524
        }
527
      } while( !allDependenciesProcessed );
525
      } while( !allDependenciesProcessed );
528
 
526
 
529
      if ( mDaemon )
527
      if ( mDaemon )
530
      {
528
      {
531
        for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
529
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
532
        {
530
        {
533
          Package p = (Package) it.next();
531
          Package p = it.next();
534
          
532
          
535
          if ( p.mProcessed && p.mBuildFile == 1 )
533
          if ( p.mProcessed && p.mBuildFile == 1 )
536
          {
534
          {
537
            p.mBuildFile = buildFile;
535
            p.mBuildFile = buildFile;
538
            mLogger.warn("planRelease 2 set mBuildFile to " + buildFile + " for package " + p.mAlias );
536
            mLogger.warn("planRelease 2 set mBuildFile to " + buildFile + " for package " + p.mAlias );
Line 559... Line 557...
559
                  rtagIdOfficialFileWriter.append("packageVersion=" + version + lf);
557
                  rtagIdOfficialFileWriter.append("packageVersion=" + version + lf);
560
                  
558
                  
561
                  // depends in the form 'cs','25.1.0000.cr';'Dinkumware_STL','1.0.0.cots'
559
                  // depends in the form 'cs','25.1.0000.cr';'Dinkumware_STL','1.0.0.cots'
562
                  String depends = new String();
560
                  String depends = new String();
563
                  
561
                  
564
                  for (Iterator it3=p.mPackageDependencyCollection.iterator(); it3.hasNext(); )
562
                  for (Iterator<Package> it3 = p.mPackageDependencyCollection.iterator(); it3.hasNext(); )
565
                  {
563
                  {
566
                    Package depend = (Package)it3.next();
564
                    Package depend = it3.next();
567
                    
565
                    
568
                    if ( depends.compareTo( "" ) != 0 )
566
                    if ( depends.compareTo( "" ) != 0 )
569
                    {
567
                    {
570
                      depends += ";";
568
                      depends += ";";
571
                    }
569
                    }
Line 620... Line 618...
620
      // are more build files required
618
      // are more build files required
621
      allProcessed = true;
619
      allProcessed = true;
622
      
620
      
623
      if (mDaemon)
621
      if (mDaemon)
624
      {
622
      {
625
        for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
623
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
626
        {
624
        {
627
          Package p = (Package) it.next();
625
          Package p = it.next();
628
         
626
         
629
          if ( p.mBuildFile < 0 || ( !p.mDirectlyPlanned && !p.mIndirectlyPlanned ) )
627
          if ( p.mBuildFile < 0 || ( !p.mDirectlyPlanned && !p.mIndirectlyPlanned ) )
630
          {
628
          {
631
            // at this point...
629
            // at this point...
632
            // only 1 package with a build requirement has a mBuildFile of 1,
630
            // only 1 package with a build requirement has a mBuildFile of 1,
Line 638... Line 636...
638
        }
636
        }
639
      }
637
      }
640
      else
638
      else
641
      {
639
      {
642
        // this is escrow mode centric
640
        // this is escrow mode centric
643
        for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
641
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
644
        {
642
        {
645
          Package p = (Package) it.next();
643
          Package p = it.next();
646
         
644
         
647
          if ( p.mBuildFile == 0 )
645
          if ( p.mBuildFile == 0 )
648
          {
646
          {
649
            // more build files are required
647
            // more build files are required
650
            allProcessed = false;
648
            allProcessed = false;
Line 667... Line 665...
667
      buildFile = 3;
665
      buildFile = 3;
668
    }
666
    }
669
 
667
 
670
    mTimestamp = System.currentTimeMillis();
668
    mTimestamp = System.currentTimeMillis();
671
 
669
 
672
    if ( !mReleaseManager.mUseDatabase )
670
    if ( !ReleaseManager.mUseDatabase )
673
    {
671
    {
674
      mTimestamp = 123456789;
672
      mTimestamp = 123456789;
675
    }
673
    }
676
 
674
 
677
    do
675
    do
678
    {
676
    {
679
      String buildFileContent = new String( generateBuildFileHeader() );
677
      String buildFileContent = new String( generateBuildFileHeader() );
680
      
678
      
681
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
679
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
682
      {
680
      {
683
        Package p = (Package) it.next();
681
        Package p = it.next();
684
      
682
      
685
        if ( ( p.mBuildFile > 0 ) && ( p.mBuildFile <= buildFile ) )
683
        if ( ( p.mBuildFile > 0 ) && ( p.mBuildFile <= buildFile ) )
686
        {
684
        {
687
          buildFileContent += generatePackageProperty(p);
685
          buildFileContent += generatePackageProperty(p);
688
        }
686
        }
Line 690... Line 688...
690
      
688
      
691
      buildFileContent += generateTaskdef();
689
      buildFileContent += generateTaskdef();
692
      
690
      
693
      String set_up = new String("");
691
      String set_up = new String("");
694
      
692
      
695
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
693
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
696
      {
694
      {
697
        Package p = (Package) it.next();
695
        Package p = it.next();
698
      
696
      
699
        if ( p.mBuildFile > 0 && p.mBuildFile <= buildFile )
697
        if ( p.mBuildFile > 0 && p.mBuildFile <= buildFile )
700
        {
698
        {
701
          buildFileContent += generateTarget(p, buildFile);
699
          buildFileContent += generateTarget(p, buildFile);
702
        }
700
        }
Line 738... Line 736...
738
      allProcessed = true;
736
      allProcessed = true;
739
      
737
      
740
      if (!mDaemon)
738
      if (!mDaemon)
741
      {
739
      {
742
        // this is escrow mode centric
740
        // this is escrow mode centric
743
        for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
741
        for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
744
        {
742
        {
745
          Package p = (Package) it.next();
743
          Package p = it.next();
746
         
744
         
747
          if ( p.mBuildFile > buildFile )
745
          if ( p.mBuildFile > buildFile )
748
          {
746
          {
749
            // more build files are required
747
            // more build files are required
750
            allProcessed = false;
748
            allProcessed = false;
Line 826... Line 824...
826
  private Package findPackage(String alias)
824
  private Package findPackage(String alias)
827
  {
825
  {
828
    mLogger.debug("findPackage");
826
    mLogger.debug("findPackage");
829
    Package retVal = ReleaseManager.NULL_PACKAGE;
827
    Package retVal = ReleaseManager.NULL_PACKAGE;
830
 
828
 
831
    for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
829
    for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
832
    {
830
    {
833
      Package p = (Package) it.next();
831
      Package p = it.next();
834
      
832
      
835
      if ( p.mAlias.compareTo( alias ) == 0 )
833
      if ( p.mAlias.compareTo( alias ) == 0 )
836
      {
834
      {
837
        retVal = p;
835
        retVal = p;
838
        break;
836
        break;
Line 851... Line 849...
851
    if ( p.mBuildFile == 0 )
849
    if ( p.mBuildFile == 0 )
852
    {
850
    {
853
      p.mBuildFile = -5;
851
      p.mBuildFile = -5;
854
      mLogger.warn("rippleBuildExclude set mBuildFile to -5 for package " + p.mAlias );
852
      mLogger.warn("rippleBuildExclude set mBuildFile to -5 for package " + p.mAlias );
855
          
853
          
856
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
854
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
857
      {
855
      {
858
        Package pkg = (Package) it.next();
856
        Package pkg = it.next();
859
        
857
        
860
        if ( pkg != p )
858
        if ( pkg != p )
861
        {
859
        {
862
          for (Iterator it2 = pkg.mPackageDependencyCollection.iterator(); it2.hasNext(); )
860
          for (Iterator<Package> it2 = pkg.mPackageDependencyCollection.iterator(); it2.hasNext(); )
863
          {
861
          {
864
            Package dependency = (Package) it2.next();
862
            Package dependency = it2.next();
865
            
863
            
866
            if ( dependency == p )
864
            if ( dependency == p )
867
            {
865
            {
868
              rippleBuildExclude( pkg );
866
              rippleBuildExclude( pkg );
869
              break;
867
              break;
Line 900... Line 898...
900
      "<property name=\"abt_rtag_id\" value=\"-1\"/>" + lf;
898
      "<property name=\"abt_rtag_id\" value=\"-1\"/>" + lf;
901
    }
899
    }
902
    
900
    
903
    String majorVersionNumber = this.getClass().getPackage().getSpecificationVersion();
901
    String majorVersionNumber = this.getClass().getPackage().getSpecificationVersion();
904
    
902
    
905
    if ( !mReleaseManager.mUseDatabase )
903
    if ( !ReleaseManager.mUseDatabase )
906
    {
904
    {
907
        // hard code 11 for unit test purposes
905
        // hard code 11 for unit test purposes
908
         majorVersionNumber = "11";
906
         majorVersionNumber = "11";
909
    }
907
    }
910
    
908
    
Line 969... Line 967...
969
      boolean linux = false;
967
      boolean linux = false;
970
      boolean win32 = false;
968
      boolean win32 = false;
971
      boolean jats = false;
969
      boolean jats = false;
972
      boolean determinedBuildStandard = false;
970
      boolean determinedBuildStandard = false;
973
      
971
      
974
      for (Iterator it = p.mBuildStandardCollection.iterator(); it.hasNext(); )
972
      for (Iterator<BuildStandard> it = p.mBuildStandardCollection.iterator(); it.hasNext(); )
975
      {
973
      {
976
        BuildStandard bs = (BuildStandard)it.next();
974
        BuildStandard bs = it.next();
977
        
975
        
978
        if ( bs.getSolaris() )
976
        if ( bs.getSolaris() )
979
        {
977
        {
980
          solaris = true;
978
          solaris = true;
981
        }
979
        }
Line 988... Line 986...
988
        if ( bs.getWin32() )
986
        if ( bs.getWin32() )
989
        {
987
        {
990
          win32 = true;
988
          win32 = true;
991
        }
989
        }
992
 
990
 
993
        if ( !determinedBuildStandard && bs.getBuildStandard(!mReleaseManager.mUseDatabase).contains("<jats") )
991
        if ( !determinedBuildStandard && bs.getBuildStandard(!ReleaseManager.mUseDatabase).contains("<jats") )
994
        {
992
        {
995
          jats = true;
993
          jats = true;
996
          determinedBuildStandard = true;
994
          determinedBuildStandard = true;
997
        }
995
        }
998
      }
996
      }
Line 1066... Line 1064...
1066
      if ( p.mPackageDependencyCollection.size() > 0 )
1064
      if ( p.mPackageDependencyCollection.size() > 0 )
1067
      {
1065
      {
1068
        retVal +=" depends=\"";
1066
        retVal +=" depends=\"";
1069
        boolean comma = false;
1067
        boolean comma = false;
1070
        
1068
        
1071
        for (Iterator it = p.mPackageDependencyCollection.iterator(); it.hasNext(); )
1069
        for (Iterator<Package> it = p.mPackageDependencyCollection.iterator(); it.hasNext(); )
1072
        {
1070
        {
1073
          if (comma)
1071
          if (comma)
1074
          {
1072
          {
1075
            retVal += ",";
1073
            retVal += ",";
1076
          }
1074
          }
1077
          comma = true;
1075
          comma = true;
1078
          
1076
          
1079
          Package dependency = (Package) it.next();
1077
          Package dependency = it.next();
1080
          retVal += dependency.mAlias;
1078
          retVal += dependency.mAlias;
1081
        }
1079
        }
1082
        
1080
        
1083
        retVal += "\"";
1081
        retVal += "\"";
1084
      }
1082
      }
Line 1087... Line 1085...
1087
      if ( !mDaemon )
1085
      if ( !mDaemon )
1088
      {
1086
      {
1089
        boolean hasDependenciesBuiltInThisIteration = false;
1087
        boolean hasDependenciesBuiltInThisIteration = false;
1090
        if ( ( p.mPackageDependencyCollection.size() > 0 ) )
1088
        if ( ( p.mPackageDependencyCollection.size() > 0 ) )
1091
        {
1089
        {
1092
          for (Iterator it = p.mPackageDependencyCollection.iterator(); it.hasNext(); )
1090
          for (Iterator<Package> it = p.mPackageDependencyCollection.iterator(); it.hasNext(); )
1093
          {
1091
          {
1094
            Package dependency = (Package) it.next();
1092
            Package dependency = it.next();
1095
            
1093
            
1096
            if ( dependency.mBuildFile == buildFile )
1094
            if ( dependency.mBuildFile == buildFile )
1097
            {
1095
            {
1098
              hasDependenciesBuiltInThisIteration = true;
1096
              hasDependenciesBuiltInThisIteration = true;
1099
              break;
1097
              break;
Line 1105... Line 1103...
1105
        {
1103
        {
1106
          retVal +=
1104
          retVal +=
1107
          "  <condition property=\"" + p.mAlias + ".build\">" + lf +
1105
          "  <condition property=\"" + p.mAlias + ".build\">" + lf +
1108
          "    <and>" + lf;
1106
          "    <and>" + lf;
1109
          
1107
          
1110
          for (Iterator it = p.mPackageDependencyCollection.iterator(); it.hasNext(); )
1108
          for (Iterator<Package> it = p.mPackageDependencyCollection.iterator(); it.hasNext(); )
1111
          {
1109
          {
1112
            Package dependency = (Package) it.next();
1110
            Package dependency = it.next();
1113
            
1111
            
1114
            if ( dependency.mBuildFile == buildFile )
1112
            if ( dependency.mBuildFile == buildFile )
1115
            {
1113
            {
1116
              retVal +=
1114
              retVal +=
1117
              "      <or>" + lf +
1115
              "      <or>" + lf +
Line 1198... Line 1196...
1198
      
1196
      
1199
      retVal += "<abt>" + lf;
1197
      retVal += "<abt>" + lf;
1200
      
1198
      
1201
      if ( ( mDaemon && p.mBuildFile == 1 ) || !mDaemon )
1199
      if ( ( mDaemon && p.mBuildFile == 1 ) || !mDaemon )
1202
      {
1200
      {
1203
        for (Iterator it = p.mPackageDependencyCollection.iterator(); it.hasNext(); )
1201
        for (Iterator<Package> it = p.mPackageDependencyCollection.iterator(); it.hasNext(); )
1204
        {
1202
        {
1205
          Package dependency = (Package) it.next();
1203
          Package dependency = it.next();
1206
          retVal +=
1204
          retVal +=
1207
          "  <depend package_alias=\"${" + dependency.mAlias + "}\"/>" + lf;
1205
          "  <depend package_alias=\"${" + dependency.mAlias + "}\"/>" + lf;
1208
        }
1206
        }
1209
 
1207
 
1210
        retVal += buildInfo(p, lf, false);
1208
        retVal += buildInfo(p, lf, false);
Line 1320... Line 1318...
1320
    if (buildFile == 1)
1318
    if (buildFile == 1)
1321
    {
1319
    {
1322
      retVal +=
1320
      retVal +=
1323
      "<echo message=\"${line.separator}The following package versions are not reproducible on any build platform:${line.separator}${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1321
      "<echo message=\"${line.separator}The following package versions are not reproducible on any build platform:${line.separator}${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1324
      
1322
      
1325
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
1323
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1326
      {
1324
      {
1327
        Package p = (Package)it.next();
1325
        Package p = it.next();
1328
        
1326
        
1329
        if ( p.mBuildFile == -1 )
1327
        if ( p.mBuildFile == -1 )
1330
        {
1328
        {
1331
          retVal +=
1329
          retVal +=
1332
          "<echo message=\"${line.separator}" + p.mAlias + "${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1330
          "<echo message=\"${line.separator}" + p.mAlias + "${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
Line 1334... Line 1332...
1334
      }
1332
      }
1335
 
1333
 
1336
      retVal +=
1334
      retVal +=
1337
      "<echo message=\"${line.separator}The following package versions are not reproducible on the build platforms associated with this baseline:${line.separator}${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1335
      "<echo message=\"${line.separator}The following package versions are not reproducible on the build platforms associated with this baseline:${line.separator}${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1338
      
1336
      
1339
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
1337
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1340
      {
1338
      {
1341
        Package p = (Package)it.next();
1339
        Package p = it.next();
1342
        
1340
        
1343
        if ( p.mBuildFile == -2 )
1341
        if ( p.mBuildFile == -2 )
1344
        {
1342
        {
1345
          retVal +=
1343
          retVal +=
1346
          "<echo message=\"${line.separator}" + p.mAlias + "${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1344
          "<echo message=\"${line.separator}" + p.mAlias + "${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
Line 1348... Line 1346...
1348
      }
1346
      }
1349
 
1347
 
1350
      retVal +=
1348
      retVal +=
1351
      "<echo message=\"${line.separator}The following package versions are not reproducible as they are directly dependent upon package versions not in the baseline:${line.separator}${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1349
      "<echo message=\"${line.separator}The following package versions are not reproducible as they are directly dependent upon package versions not in the baseline:${line.separator}${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1352
      
1350
      
1353
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
1351
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1354
      {
1352
      {
1355
        Package p = (Package)it.next();
1353
        Package p = it.next();
1356
        
1354
        
1357
        if ( p.mBuildFile == -4 )
1355
        if ( p.mBuildFile == -4 )
1358
        {
1356
        {
1359
          retVal +=
1357
          retVal +=
1360
          "<echo message=\"${line.separator}" + p.mAlias + "${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1358
          "<echo message=\"${line.separator}" + p.mAlias + "${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
Line 1362... Line 1360...
1362
      }
1360
      }
1363
 
1361
 
1364
      retVal +=
1362
      retVal +=
1365
      "<echo message=\"${line.separator}The following package versions are not reproducible as they are directly/indirectly dependent upon not reproducible package versions:${line.separator}${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1363
      "<echo message=\"${line.separator}The following package versions are not reproducible as they are directly/indirectly dependent upon not reproducible package versions:${line.separator}${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1366
      
1364
      
1367
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
1365
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1368
      {
1366
      {
1369
        Package p = (Package)it.next();
1367
        Package p = it.next();
1370
        
1368
        
1371
        if ( p.mBuildFile == -5 )
1369
        if ( p.mBuildFile == -5 )
1372
        {
1370
        {
1373
          retVal +=
1371
          retVal +=
1374
          "<echo message=\"${line.separator}" + p.mAlias + "${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
1372
          "<echo message=\"${line.separator}" + p.mAlias + "${line.separator}\" file=\"publish.log\" append=\"true\"/>" + lf;
Line 1383... Line 1381...
1383
    
1381
    
1384
    retVal +=
1382
    retVal +=
1385
    "</target>" + lf +
1383
    "</target>" + lf +
1386
    "<target name=\"full\" depends=\"fullstart";
1384
    "<target name=\"full\" depends=\"fullstart";
1387
    
1385
    
1388
    for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
1386
    for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1389
    {
1387
    {
1390
      Package p = (Package)it.next();
1388
      Package p = it.next();
1391
      
1389
      
1392
      if ( ( p.mBuildFile > 0 ) && ( p.mBuildFile <= buildFile ) )
1390
      if ( ( p.mBuildFile > 0 ) && ( p.mBuildFile <= buildFile ) )
1393
      {
1391
      {
1394
        retVal += "," + p.mAlias;
1392
        retVal += "," + p.mAlias;
1395
      }
1393
      }
Line 1425... Line 1423...
1425
    mLogger.debug("rippleIndirectlyPlanned");
1423
    mLogger.debug("rippleIndirectlyPlanned");
1426
    if ( !p.mIndirectlyPlanned && p.mBuildFile == 0 )
1424
    if ( !p.mIndirectlyPlanned && p.mBuildFile == 0 )
1427
    {
1425
    {
1428
      p.mIndirectlyPlanned = true;
1426
      p.mIndirectlyPlanned = true;
1429
      
1427
      
1430
      for (Iterator it = mPackageCollection.iterator(); it.hasNext(); )
1428
      for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
1431
      {
1429
      {
1432
        Package pkg = (Package) it.next();
1430
        Package pkg = it.next();
1433
        
1431
        
1434
        if ( pkg != p )
1432
        if ( pkg != p )
1435
        {
1433
        {
1436
          for (Iterator it2 = pkg.mPackageDependencyCollection.iterator(); it2.hasNext(); )
1434
          for (Iterator<Package> it2 = pkg.mPackageDependencyCollection.iterator(); it2.hasNext(); )
1437
          {
1435
          {
1438
            Package dependency = (Package) it2.next();
1436
            Package dependency = it2.next();
1439
            
1437
            
1440
            if ( dependency == p )
1438
            if ( dependency == p )
1441
            {
1439
            {
1442
              rippleIndirectlyPlanned( pkg );
1440
              rippleIndirectlyPlanned( pkg );
1443
              break;
1441
              break;
Line 1518... Line 1516...
1518
  {
1516
  {
1519
    mLogger.debug("loc");
1517
    mLogger.debug("loc");
1520
    String retVal = new String();
1518
    String retVal = new String();
1521
    String loc = new String("\\");
1519
    String loc = new String("\\");
1522
    
1520
    
1523
    for (Iterator it = mGbeMachtypeCollection.iterator(); it.hasNext(); )
1521
    for (Iterator<String> it = mGbeMachtypeCollection.iterator(); it.hasNext(); )
1524
    {
1522
    {
1525
      String machtype = (String) it.next();
1523
      String machtype = it.next();
1526
      
1524
      
1527
      if ( machtype.compareTo("win32") == 0 )
1525
      if ( machtype.compareTo("win32") == 0 )
1528
      {
1526
      {
1529
        if ( target.compareTo("AbtSetUppackagelocation") != 0 )
1527
        if ( target.compareTo("AbtSetUppackagelocation") != 0 )
1530
        {
1528
        {
Line 1554... Line 1552...
1554
    "  <os family=\"windows\"/>" + lf +
1552
    "  <os family=\"windows\"/>" + lf +
1555
    "</condition>" + lf;
1553
    "</condition>" + lf;
1556
    
1554
    
1557
    loc = "/";
1555
    loc = "/";
1558
    
1556
    
1559
    for (Iterator it = mGbeMachtypeCollection.iterator(); it.hasNext(); )
1557
    for (Iterator<String> it = mGbeMachtypeCollection.iterator(); it.hasNext(); )
1560
    {
1558
    {
1561
      String machtype = (String) it.next();
1559
      String machtype = it.next();
1562
      
1560
      
1563
      if ( machtype.compareTo("linux_i386") == 0 )
1561
      if ( machtype.compareTo("linux_i386") == 0 )
1564
      {
1562
      {
1565
        if ( target.compareTo("AbtSetUppackagelocation") != 0 )
1563
        if ( target.compareTo("AbtSetUppackagelocation") != 0 )
1566
        {
1564
        {
Line 1636... Line 1634...
1636
    mLogger.debug("buildInfo");
1634
    mLogger.debug("buildInfo");
1637
 
1635
 
1638
    String platforms = new String();
1636
    String platforms = new String();
1639
    String standards = new String();
1637
    String standards = new String();
1640
    
1638
    
1641
    for (Iterator it = p.mBuildStandardCollection.iterator(); it.hasNext(); )
1639
    for (Iterator<BuildStandard> it = p.mBuildStandardCollection.iterator(); it.hasNext(); )
1642
    {
1640
    {
1643
      BuildStandard bs = (BuildStandard)it.next();
1641
      BuildStandard bs = it.next();
1644
      
1642
      
1645
      if ( !filter )
1643
      if ( !filter )
1646
      {
1644
      {
1647
        String platform = bs.getPlatform(!mReleaseManager.mUseDatabase);
1645
        String platform = bs.getPlatform(!ReleaseManager.mUseDatabase);
1648
      
1646
      
1649
        if ( platform.length() > 0 )
1647
        if ( platform.length() > 0 )
1650
        {
1648
        {
1651
          platforms += platform + lf;
1649
          platforms += platform + lf;
1652
        }
1650
        }
1653
 
1651
 
1654
        String standard = bs.getBuildStandard(!mReleaseManager.mUseDatabase);
1652
        String standard = bs.getBuildStandard(!ReleaseManager.mUseDatabase);
1655
        
1653
        
1656
        if ( standard.length() > 0 )
1654
        if ( standard.length() > 0 )
1657
        {
1655
        {
1658
          standards += standard + lf;
1656
          standards += standard + lf;
1659
        }
1657
        }
1660
      }
1658
      }
1661
      else
1659
      else
1662
      {
1660
      {
1663
        if ( !bs.getBuildStandard(!mReleaseManager.mUseDatabase).contains("\"none\"") )
1661
        if ( !bs.getBuildStandard(!ReleaseManager.mUseDatabase).contains("\"none\"") )
1664
        {
1662
        {
1665
          String platform = bs.getPlatform(!mReleaseManager.mUseDatabase);
1663
          String platform = bs.getPlatform(!ReleaseManager.mUseDatabase);
1666
          
1664
          
1667
          if ( platform.length() > 0 )
1665
          if ( platform.length() > 0 )
1668
          {
1666
          {
1669
            platforms += platform + lf;
1667
            platforms += platform + lf;
1670
          }
1668
          }
1671
          
1669
          
1672
          String standard = bs.getBuildStandard(!mReleaseManager.mUseDatabase);
1670
          String standard = bs.getBuildStandard(!ReleaseManager.mUseDatabase);
1673
          
1671
          
1674
          if ( standard.length() > 0 )
1672
          if ( standard.length() > 0 )
1675
          {
1673
          {
1676
            standards += standard + lf;
1674
            standards += standard + lf;
1677
          }
1675
          }