Subversion Repositories DevTools

Rev

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

Rev 7106 Rev 7122
Line 289... Line 289...
289
            //	Query package versions
289
            //	Query package versions
290
            //
290
            //
291
            phase.setPhase("queryPackageVersions");
291
            phase.setPhase("queryPackageVersions");
292
            mLogger.debug("planRelease queryPackageVersions");
292
            mLogger.debug("planRelease queryPackageVersions");
293
            mReleaseManager.queryPackageVersions(this, mPackageCollection, mBaseline);
293
            mReleaseManager.queryPackageVersions(this, mPackageCollection, mBaseline);
-
 
294
            
-
 
295
            phase.setPhase("queryPackageWips");
294
            mReleaseManager.queryWips(this, mPackageCollectionWip, mBaseline);
296
            mReleaseManager.queryWips(this, mPackageCollectionWip, mBaseline);
295
            mReleaseManager.queryTest(this, mPackageCollectionTest, mBaseline);
297
            mReleaseManager.queryTest(this, mPackageCollectionTest, mBaseline);
296
            mReleaseManager.queryRipples(this, mPackageCollectionRipple, mBaseline);
298
            mReleaseManager.queryRipples(this, mPackageCollectionRipple, mBaseline);
-
 
299
            
297
            mPackageCollectionAll.addAll(mPackageCollection);
300
            mPackageCollectionAll.addAll(mPackageCollection);
298
            mPackageCollectionAll.addAll(mPackageCollectionWip);
301
            mPackageCollectionAll.addAll(mPackageCollectionWip);
299
            mPackageCollectionAll.addAll(mPackageCollectionTest);
302
            mPackageCollectionAll.addAll(mPackageCollectionTest);
300
            mPackageCollectionAll.addAll(mPackageCollectionRipple);
303
            mPackageCollectionAll.addAll(mPackageCollectionRipple);
301
            
304
            
Line 377... Line 380...
377
 
380
 
378
        // Deal with test builds here as they may impact upon package attributes
381
        // Deal with test builds here as they may impact upon package attributes
379
        //    eg: dependency collection and build standard differences
382
        //    eg: dependency collection and build standard differences
380
        //    Note: Done before mPackageDependencyCollection is setup
383
        //    Note: Done before mPackageDependencyCollection is setup
381
        //
384
        //
-
 
385
        Phase phase = new Phase("processPackages");
382
        if ( mDaemon )
386
        if ( mDaemon )
383
        {
387
        {
384
            // Process test builds - they are in their own collection
388
            // Process test builds - they are in their own collection
-
 
389
            phase.setPhase("TestBuilds");
385
            for (Iterator<Package> it = mPackageCollectionTest.iterator(); it.hasNext(); )
390
            for (Iterator<Package> it = mPackageCollectionTest.iterator(); it.hasNext(); )
386
            {
391
            {
387
                Package p = it.next();
392
                Package p = it.next();
388
                mLogger.info("planRelease package test build {}", p.mAlias);
393
                mLogger.info("planRelease package test build {}", p.mAlias);
389
 
394
 
Line 411... Line 416...
411
            }
416
            }
412
        }
417
        }
413
 
418
 
414
        // Set up mPackageDependencyCollection on each package
419
        // Set up mPackageDependencyCollection on each package
415
        //    Examine the dependencies by alias and convert this to a 'package' selected from the released package set
420
        //    Examine the dependencies by alias and convert this to a 'package' selected from the released package set
-
 
421
        phase.setPhase("setPackageDependencyCollection");
416
        mLogger.debug("planRelease setup setPackageDependencyCollection");
422
        mLogger.debug("planRelease setup setPackageDependencyCollection");
417
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
423
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
418
        {
424
        {
419
            Package p = it.next();
425
            Package p = it.next();
420
 
426
 
Line 427... Line 433...
427
        }    
433
        }    
428
 
434
 
429
        // Detect and deal with circular dependencies
435
        // Detect and deal with circular dependencies
430
        // Examine all packages under consideration
436
        // Examine all packages under consideration
431
        //
437
        //
-
 
438
        phase.setPhase("Detect Circular Dependencies");
432
        mLogger.debug("planRelease deal with circular dependencies");
439
        mLogger.debug("planRelease deal with circular dependencies");
433
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
440
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
434
        {
441
        {
435
            Package p = it.next();
442
            Package p = it.next();
436
 
443
 
Line 451... Line 458...
451
            }
458
            }
452
        }
459
        }
453
 
460
 
454
        // Scan for packages with missing dependencies
461
        // Scan for packages with missing dependencies
455
        //    ie: The dependent package is not in the package Collection
462
        //    ie: The dependent package is not in the package Collection
-
 
463
        phase.setPhase("Scan missing dpendencies");
456
        mLogger.debug("planRelease use the fully built mPackageDependencyCollection");
464
        mLogger.debug("planRelease use the fully built mPackageDependencyCollection");
457
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
465
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
458
        {
466
        {
459
            Package p = it.next();
467
            Package p = it.next();
460
 
468
 
Line 488... Line 496...
488
                }
496
                }
489
            }
497
            }
490
        }
498
        }
491
 
499
 
492
        // Detect packages with no build standard and exclude them from the build
500
        // Detect packages with no build standard and exclude them from the build
-
 
501
        phase.setPhase("Scan not reproducible");
493
        mLogger.debug("planRelease process packages which are not reproducible");
502
        mLogger.debug("planRelease process packages which are not reproducible");
494
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
503
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
495
        {
504
        {
496
            Package p = it.next();
505
            Package p = it.next();
497
 
506
 
Line 534... Line 543...
534
        //    ie: Package: Win32:Production and we have a BM with a class of 'Win32'
543
        //    ie: Package: Win32:Production and we have a BM with a class of 'Win32'
535
        //
544
        //
536
        //    Only exclude the failing package and not its dependents
545
        //    Only exclude the failing package and not its dependents
537
        //    May be legitimate in the release
546
        //    May be legitimate in the release
538
        //
547
        //
-
 
548
        phase.setPhase("Scan not reproducible2");
539
        mLogger.debug("planRelease process packages which are not reproducible2");
549
        mLogger.debug("planRelease process packages which are not reproducible2");
540
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
550
        for (Iterator<Package> it = mPackageCollectionAll.iterator(); it.hasNext(); )
541
        {
551
        {
542
            Package p = it.next();
552
            Package p = it.next();
543
 
553
 
Line 590... Line 600...
590
        if (mDaemon )
600
        if (mDaemon )
591
        {
601
        {
592
 
602
 
593
            //  Daemon Mode Only
603
            //  Daemon Mode Only
594
            //  Process packages which need to be ripple built
604
            //  Process packages which need to be ripple built
-
 
605
            phase.setPhase("Scan for ripples");
595
            mLogger.debug("planRelease process packages which need to be ripple built");
606
            mLogger.debug("Process packages which need to be ripple built");
596
            for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
607
            for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
597
            {
608
            {
598
                Package p = it.next();
609
                Package p = it.next();
599
 
610
 
600
                if (p.mBuildFile == 0)
611
                if (p.mBuildFile == 0)
Line 656... Line 667...
656
 
667
 
657
            //  Daemon Mode Only
668
            //  Daemon Mode Only
658
            //  Process packages which do not exist in the archive
669
            //  Process packages which do not exist in the archive
659
            //  For unit test purposes, assume all packages exist in the archive if released
670
            //  For unit test purposes, assume all packages exist in the archive if released
660
            mLogger.debug("planRelease process packages which do not exist in the archive");
671
            mLogger.debug("planRelease process packages which do not exist in the archive");
-
 
672
            phase.setPhase("Scan dpkg_archive");
661
            if ( mReleaseManager.mUseDatabase )
673
            if ( mReleaseManager.mUseDatabase )
662
            {
674
            {
663
                for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
675
                for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
664
                {
676
                {
665
                    Package p = it.next();
677
                    Package p = it.next();
Line 738... Line 750...
738
            }
750
            }
739
 
751
 
740
            //  Daemon Mode Only
752
            //  Daemon Mode Only
741
            //  Detect bad forced ripples requests and reject them
753
            //  Detect bad forced ripples requests and reject them
742
            mLogger.debug("planRelease process forced ripples");
754
            mLogger.debug("planRelease process forced ripples");
-
 
755
            phase.setPhase("Test bad ripple requests");
743
            for (Iterator<Package> it = mPackageCollectionRipple.iterator(); it.hasNext(); )
756
            for (Iterator<Package> it = mPackageCollectionRipple.iterator(); it.hasNext(); )
744
            {
757
            {
745
                Package p = it.next();
758
                Package p = it.next();
746
 
759
 
747
                if (p.mBuildFile == 0)
760
                if (p.mBuildFile == 0)
Line 769... Line 782...
769
            //  Mark Pegged and SDK packages as not to be built
782
            //  Mark Pegged and SDK packages as not to be built
770
            //  Mark RippleStoped packages as not to be build
783
            //  Mark RippleStoped packages as not to be build
771
            //  Have previously detected conflicts between pegged/sdk packages and daemon instructions
784
            //  Have previously detected conflicts between pegged/sdk packages and daemon instructions
772
            //
785
            //
773
            mLogger.debug("planRelease remove pegged and SDK packages from the build set");
786
            mLogger.debug("planRelease remove pegged and SDK packages from the build set");
-
 
787
            phase.setPhase("Remove Pegged and SDKs");
774
            for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
788
            for (Iterator<Package> it = mPackageCollection.iterator(); it.hasNext(); )
775
            {
789
            {
776
                Package p = it.next();
790
                Package p = it.next();
777
 
791
 
778
                if (p.mBuildFile == 0)
792
                if (p.mBuildFile == 0)
Line 801... Line 815...
801
 
815
 
802
            //  Daemon Mode Only
816
            //  Daemon Mode Only
803
            //  Locate Test Build Requests that cannot be satisfied - will not be built due to
817
            //  Locate Test Build Requests that cannot be satisfied - will not be built due to
804
            //  errors in dependent packages. Report the error to the user and remove the request
818
            //  errors in dependent packages. Report the error to the user and remove the request
805
            //
819
            //
-
 
820
            phase.setPhase("Scan unsatisfied test build requests");
806
            for (Iterator<Package> it = mPackageCollectionTest.iterator(); it.hasNext(); )
821
            for (Iterator<Package> it = mPackageCollectionTest.iterator(); it.hasNext(); )
807
            {
822
            {
808
                Package p = it.next();
823
                Package p = it.next();
809
 
824
 
810
                if (p.mBuildFile < 0)
825
                if (p.mBuildFile < 0)
Line 847... Line 862...
847
                    standardOut(mDependent, p.mAlias, mDependentFlag);
862
                    standardOut(mDependent, p.mAlias, mDependentFlag);
848
                    mDependentFlag = false;
863
                    mDependentFlag = false;
849
                }
864
                }
850
            }
865
            }
851
        }
866
        }
-
 
867
        phase.setPhase("End");
852
    }
868
    }
853
    
869
    
854
    /** Plan the build order.
870
    /** Plan the build order.
855
         *  Assumes that a great deal of work has been done.
871
         *  Assumes that a great deal of work has been done.
856
         *  This is a stand alone method to contain the work
872
         *  This is a stand alone method to contain the work
Line 1068... Line 1084...
1068
                    
1084
                    
1069
                    //  Now that we know which package we are building
1085
                    //  Now that we know which package we are building
1070
                    //      Set the previously calculated nextVersion as the packages version number
1086
                    //      Set the previously calculated nextVersion as the packages version number
1071
                    //      Claim the version number to prevent other builds from using it. Even if doing a test build
1087
                    //      Claim the version number to prevent other builds from using it. Even if doing a test build
1072
                    //
1088
                    //
1073
                    mLogger.error("Update mVersion: {}", build);
1089
                    mLogger.debug("Update mVersion: {}", build);
1074
                    if (build.mNextVersion != null)
1090
                    if (build.mNextVersion != null)
1075
                    {
1091
                    {
1076
                        mReleaseManager.claimVersion(build.mPid, build.mNextVersion + build.mExtension, mBaseline);
1092
                        mReleaseManager.claimVersion(build.mPid, build.mNextVersion + build.mExtension, mBaseline);
1077
                        build.mVersion = build.mNextVersion;
1093
                        build.mVersion = build.mNextVersion;
1078
                        mLogger.error("Update mVersion: {} to {}", build, build.mVersion);
1094
                        mLogger.error("Update mVersion: {} to {}", build, build.mVersion);
Line 1223... Line 1239...
1223
                //  Escrow
1239
                //  Escrow
1224
                //  The basic plan is the escrow build order
1240
                //  The basic plan is the escrow build order
1225
                mBuildOrder = basicPlan.planCollection;
1241
                mBuildOrder = basicPlan.planCollection;
1226
            }
1242
            }
1227
    
1243
    
1228
            mLogger.error("Final Plan");
1244
            mLogger.warn("Final Plan");
1229
            for (Iterator<PlannedPackage> it = mBuildOrder.iterator(); it.hasNext(); )
1245
            for (Iterator<PlannedPackage> it = mBuildOrder.iterator(); it.hasNext(); )
1230
            {
1246
            {
1231
                PlannedPackage p = it.next();
1247
                PlannedPackage p = it.next();
1232
                mLogger.error("Plan: {} {} {}", p.mBuildLevel, p.mPkg.mAlias, p.mPkg.mId);
1248
                mLogger.warn("Plan: {} {} {}", p.mBuildLevel, p.mPkg.mAlias, p.mPkg.mId);
1233
            }
1249
            }
1234
               
1250
               
1235
    
1251
    
1236
        }
1252
        }
1237
 
1253
 
Line 1258... Line 1274...
1258
     * 
1274
     * 
1259
     * @return
1275
     * @return
1260
     */
1276
     */
1261
    private PlanResults planCollection(String name, ArrayList<Package> packageCollection, boolean mode)
1277
    private PlanResults planCollection(String name, ArrayList<Package> packageCollection, boolean mode)
1262
    {
1278
    {
1263
        Phase phase = new Phase("PlanCollection"); 
1279
        Phase phase = new Phase("Plan-" + name); 
1264
        ArrayList<PlannedPackage> ripplePlan = new ArrayList<PlannedPackage>();
1280
        ArrayList<PlannedPackage> ripplePlan = new ArrayList<PlannedPackage>();
1265
        PlanResults results = new PlanResults();
1281
        PlanResults results = new PlanResults();
1266
 
1282
 
1267
        //  Reset flags used in the calculations
1283
        //  Reset flags used in the calculations
1268
        Package.resetProcessed(packageCollection);
1284
        Package.resetProcessed(packageCollection);
Line 1315... Line 1331...
1315
        //  Add to the list packages that depend on the excluded package that have not already been excluded
1331
        //  Add to the list packages that depend on the excluded package that have not already been excluded
1316
        phase.setPhase("ExcludeAllUsed");
1332
        phase.setPhase("ExcludeAllUsed");
1317
        while( !exclude.isEmpty() )
1333
        while( !exclude.isEmpty() )
1318
        {
1334
        {
1319
            Package p = exclude.remove(0);
1335
            Package p = exclude.remove(0);
-
 
1336
            mLogger.info("planCollection package not buildable {}. {},{}", p, p.mProcessed, p.mIsProcessed);
1320
            p.mProcessed = true;
1337
            
1321
            p.mIsProcessed = true;
1338
            p.mProcessed = true;                        // Used to indicate pkg has had its dependencies scanned
1322
            mLogger.error("planCollection package not buildable {}", p.mName);
1339
            p.mIsProcessed = true;                      // Used to indicate pkg has been added to list to process 
-
 
1340
 
1323
            
1341
            
1324
            for (Iterator<Package> it1 = packageCollection.iterator(); it1.hasNext(); )
1342
            for (Iterator<Package> it1 = packageCollection.iterator(); it1.hasNext(); )
1325
            {
1343
            {
1326
                Package pkg = it1.next();
1344
                Package pkg = it1.next();
1327
                if (pkg.mProcessed) {
1345
                if (pkg.mProcessed) {
Line 1330... Line 1348...
1330
                
1348
                
1331
                for (Iterator<String> it = pkg.mDependencyCollection.iterator(); it.hasNext(); )
1349
                for (Iterator<String> it = pkg.mDependencyCollection.iterator(); it.hasNext(); )
1332
                {
1350
                {
1333
                    String alias = it.next();
1351
                    String alias = it.next();
1334
                    if ( p.mAlias.compareTo( alias ) == 0 ) {
1352
                    if ( p.mAlias.compareTo( alias ) == 0 ) {
-
 
1353
                        if (!pkg.mIsProcessed) {
-
 
1354
                            pkg.mIsProcessed = true;
1335
                        exclude.add(pkg);
1355
                            exclude.add(pkg);
-
 
1356
                        }
1336
                    }
1357
                    }
1337
                }
1358
                }
1338
            }
1359
            }
1339
        }
1360
        }
1340
        
1361
        
Line 1567... Line 1588...
1567
                
1588
                
1568
                //  Sort the packages by buildOrder and buildTime
1589
                //  Sort the packages by buildOrder and buildTime
1569
                phase.setPhase("Sort Plan");
1590
                phase.setPhase("Sort Plan");
1570
                Collections.sort(ripplePlan, PlannedPackage.BuildOrderComparitor);
1591
                Collections.sort(ripplePlan, PlannedPackage.BuildOrderComparitor);
1571
                
1592
                
1572
                phase.setPhase("Display Build Order");
1593
                if (mLogger.isInfoEnabled() )
1573
                mLogger.error("Plan Build {} Time: {}", name, results.planTime);
-
 
1574
                for (Iterator<PlannedPackage> it = ripplePlan.iterator(); it.hasNext(); )
-
 
1575
                {
1594
                {
-
 
1595
                    phase.setPhase("Display Build Order");
-
 
1596
                    mLogger.info("Plan Build {} Time: {}", name, results.planTime);
-
 
1597
                    for (Iterator<PlannedPackage> it = ripplePlan.iterator(); it.hasNext(); )
-
 
1598
                    {
1576
                    PlannedPackage p = it.next();
1599
                        PlannedPackage p = it.next();
1577
                    mLogger.error("Plan: {} {} t:{}", p.mBuildLevel, p.mPkg.mAlias, p.mPkg.mBuildTime);
1600
                        mLogger.info("Plan: {} {} t:{}", p.mBuildLevel, p.mPkg.mAlias, p.mPkg.mBuildTime);
-
 
1601
                    }
1578
                }
1602
                }
1579
            }
1603
            }
1580
            
1604
            
1581
            //  Daemon mode: Returning calculated plan
1605
            //  Daemon mode: Returning calculated plan
1582
            results.planCollection = ripplePlan;
1606
            results.planCollection = ripplePlan;