Subversion Repositories DevTools

Rev

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

Rev 4231 Rev 4280
Line 37... Line 37...
37
  // System
37
  // System
38
  private String fs = System.getProperty( "file.separator" );
38
  private String fs = System.getProperty( "file.separator" );
39
  private String ls = System.getProperty( "line.separator" );
39
  private String ls = System.getProperty( "line.separator" );
40
  private String gbeMachtype = System.getenv("GBE_MACHTYPE");
40
  private String gbeMachtype = System.getenv("GBE_MACHTYPE");
41
  private String dpkg_archive = System.getenv("GBE_DPKG");
41
  private String dpkg_archive = System.getenv("GBE_DPKG");
-
 
42
  private String gatherMetricsOnly = System.getenv("GBE_GATHER_METRICS");
-
 
43
 
42
  // ant built in
44
  // ant built in
43
  private Project project;
45
  private Project project;
44
  private String basedir;
46
  private String basedir;
45
  // global
47
  // global
46
  private boolean master;
48
  private boolean master = false;
47
  private String gbebuildfilter;
49
  private String gbebuildfilter;
48
  private String mailServer;
50
  private String mailServer;
49
  private String mailSender;
51
  private String mailSender;
50
  // project related
52
  // project related
51
  private String rtagId;
53
  private String rtagId;
Line 59... Line 61...
59
  private Target target;
61
  private Target target;
60
  private String packageVersionID;
62
  private String packageVersionID;
61
  private String packageAlias;
63
  private String packageAlias;
62
  private String packageName;
64
  private String packageName;
63
  private String packageVersion;
65
  private String packageVersion;
-
 
66
  private String packageFullVersion;
64
  private String packageExtension;
67
  private String packageExtension;
65
  private String packageLoc;
68
  private String packageLoc;
66
  private String packageVcsTag;
69
  private String packageVcsTag;
67
  private String directChange;
70
  private String directChange;
68
  private String doesNotRequireSourceControlInteraction;
71
  private String doesNotRequireSourceControlInteraction;
Line 72... Line 75...
72
  private String unittests;
75
  private String unittests;
73
  private Vector<Depend> dependCollection = new Vector<Depend>();
76
  private Vector<Depend> dependCollection = new Vector<Depend>();
74
  private Vector<Platform> platformCollection = new Vector<Platform>();
77
  private Vector<Platform> platformCollection = new Vector<Platform>();
75
  private Vector<Jats> jatsCollection = new Vector<Jats>();
78
  private Vector<Jats> jatsCollection = new Vector<Jats>();
76
  private Vector<Ant> antCollection = new Vector<Ant>();
79
  private Vector<Ant> antCollection = new Vector<Ant>();
77
  private Vector<Owner> ownerCollection = new Vector<Owner>();
-
 
78
  private String owners;
80
  private String owners;
-
 
81
  private Machine mMachine;
-
 
82
 
79
  // set up in execute
83
  // set up in execute
80
  private BuildStandards buildStandard = BuildStandards.JATS;
84
  private BuildStandards buildStandard = BuildStandards.JATS;
81
  private JavaVersions javaVersion = JavaVersions.NONE;
85
  private JavaVersions javaVersion = JavaVersions.NONE;
82
  private CompileTargets compileTarget = CompileTargets.NONE;
86
  private CompileTargets compileTarget = CompileTargets.NONE;
83
  // abt task result property
87
  // abt task result property
Line 209... Line 213...
209
    }
213
    }
210
 
214
 
211
    return retVal;
215
    return retVal;
212
  }
216
  }
213
 
217
 
-
 
218
  /**
-
 
219
   * Check that one marker file has been published into dpkg_archive
-
 
220
   * 
-
 
221
   * @param archive     - Archive to test
-
 
222
   * @param tag         - Marker suffix
-
 
223
   * 
-
 
224
   * @return "yes" or "no" as text 
-
 
225
   */
214
  private String published(String archive, String machtype) throws Exception
226
  private String checkPublished(String archive, String tag) throws Exception
215
  {
227
  {
216
    String retVal = "no";
228
    String retVal = "no";
217
    
229
    
218
    if (archive == null)
230
    if (archive == null)
219
    {
231
    {
220
      reportErrorException( "GBE_DPKG environment variable not set", 256 );
232
      reportErrorException( "GBE_DPKG environment variable not set", 256 );
221
    }
233
    }
222
    
234
    
223
    String destination = archive + fs + packageName + fs + packageVersion;
235
    String destination = archive + fs + packageName + fs + packageFullVersion;
224
    
-
 
225
    if ( packageExtension.length() > 0 )
-
 
226
    {
-
 
227
      destination += "." + packageExtension;
-
 
228
    }
-
 
229
 
236
 
230
    String filename = "built.";
237
    String filename = "built." + tag;
231
    
-
 
232
    if ( generic != null )
-
 
233
    {
-
 
234
      filename += "generic";
-
 
235
    }
-
 
236
    else
-
 
237
    {
-
 
238
      filename += machtype;
-
 
239
    }
-
 
240
    
238
    
241
    //
239
    //
242
    //  Due to NFS caching of small file requests the file may take
240
    //  Due to NFS caching of small file requests the file may take
243
    //  a few seconds to appear. Try several times
241
    //  a few seconds to appear. Try several times
244
    //    5 seconds does not appear to be enough
242
    //    5 seconds does not appear to be enough
Line 296... Line 294...
296
    }
294
    }
297
 
295
 
298
    return retVal;
296
    return retVal;
299
  }
297
  }
300
 
298
 
301
  private void printPackage( FileWriter file, String packageName, String packageVersion, String packageExtension ) throws IOException
299
  private void printPackage( FileWriter file, String packageName, String packageFullVersion ) throws IOException
302
  {
300
  {
303
    String line = packageName;
301
    String line = packageName;
304
    
-
 
305
    if ( packageVersion != null )
302
    if ( packageFullVersion != null )
306
    {
303
    {
307
      // packageName not in form name version.ext
-
 
308
      line += " " + packageVersion;
304
      line += " " + packageFullVersion;
309
    
-
 
310
      if ( packageExtension != null  && packageExtension.length() > 0 )
-
 
311
      {
-
 
312
        line += "." + packageExtension;
-
 
313
      }
-
 
314
    }
305
    }
315
    
306
    
316
    line += ls;
307
    line += ls;
317
    
-
 
318
    file.write( line );
308
    file.write( line );
319
  }
309
  }
320
  
310
  
321
  private void copyFile( File source, File copy )
311
  private void copyFile( File source, File copy )
322
  {
312
  {
Line 362... Line 352...
362
    {
352
    {
363
      // cannot happen, GBE_LOG is checked in BuildDaemon at startup
353
      // cannot happen, GBE_LOG is checked in BuildDaemon at startup
364
      return false;
354
      return false;
365
    }
355
    }
366
    
356
    
367
    try
-
 
368
    {
-
 
369
      InetAddress local = InetAddress.getLocalHost();
-
 
370
      hostname = local.getHostName();
-
 
371
    }
-
 
372
    catch( UnknownHostException e )
-
 
373
    {
-
 
374
      // do nothing, shouldn't happen, but hostname will be "unknown" if it does
-
 
375
    }
-
 
376
    
-
 
377
    File destinationLog = new File( log );
357
    File destinationLog = new File( log );
378
    File destinationHostname = new File( destinationLog, hostname );
358
    File destinationHostname = new File( destinationLog, hostname );
379
    File destinationRtagId = new File( destinationHostname, rtagId );
359
    File destinationRtagId = new File( destinationHostname, rtagId );
380
    // create directories
360
    // create directories
381
    new File( destinationRtagId, daemon).mkdirs();
361
    new File( destinationRtagId, daemon).mkdirs();
Line 408... Line 388...
408
    if ( ! saveLogs() )
388
    if ( ! saveLogs() )
409
    {
389
    {
410
        return;
390
        return;
411
    }
391
    }
412
    
392
    
413
    if ( !ownerCollection.isEmpty() )
393
    if ( !ABTData.ownerCollection.isEmpty() || mailServer == null || mailSender == null )
414
    {
394
    {
415
      String unc = System.getenv("GBE_UNC");
395
      String unc = System.getenv("GBE_UNC");
416
      
396
      
417
      if ( unc == null )
397
      if ( unc == null )
418
      {
398
      {
Line 456... Line 436...
456
  {
436
  {
457
    reportError( error, retVal );
437
    reportError( error, retVal );
458
    throw new Exception( hostname );
438
    throw new Exception( hostname );
459
  }
439
  }
460
  
440
  
461
  private void genbuild(String gatherMetricsOnly) throws Exception
441
  private void genbuild() throws Exception
462
  {
442
  {
463
    if ( master )
443
    if ( master )
464
    {
444
    {
465
      // gather metrics
445
      // gather metrics
466
      // jats -locatefile=.jats.packageroot etool jats_metrics -mode=init -rootdir=.
446
      // jats -locatefile=.jats.packageroot etool jats_metrics -mode=init -rootdir=.
Line 512... Line 492...
512
      }
492
      }
513
      
493
      
514
      try
494
      try
515
      {
495
      {
516
        FileWriter cfgfw = new FileWriter(cfg);
496
        FileWriter cfgfw = new FileWriter(cfg);
517
        printPackage( cfgfw, packageName, packageVersion, packageExtension );
497
        printPackage( cfgfw, packageName, packageFullVersion );
518
        
498
        
519
        // provide releasemanager.projectname=<name[0]> and releasemanager.releasename=<name[1]>
499
        // provide releasemanager.projectname=<name[0]> and releasemanager.releasename=<name[1]>
520
        String[] name = release.split( " > ", 2 );
500
        String[] name = release.split( " > ", 2 );
521
        
501
        
522
        if ( name.length == 2 )
502
        if ( name.length == 2 )
523
        {
503
        {
524
          printPackage( cfgfw, "releasemanager.projectname=" + name[0], null, null );
504
          printPackage( cfgfw, "releasemanager.projectname=" + name[0], null );
525
          printPackage( cfgfw, "releasemanager.releasename=" + name[1], null, null );
505
          printPackage( cfgfw, "releasemanager.releasename=" + name[1], null );
526
        }
506
        }
527
    
507
    
528
        for (Iterator<Depend> it=dependCollection.iterator(); it.hasNext(); )
508
        for (Iterator<Depend> it=dependCollection.iterator(); it.hasNext(); )
529
        {
509
        {
530
          Depend depend = it.next();
510
          Depend depend = it.next();
531
          printPackage( cfgfw, depend.getPackage_Alias(), null, null );
511
          printPackage( cfgfw, depend.getPackage_Alias(), null );
532
        }
512
        }
533
    
513
    
534
        cfgfw.close();
514
        cfgfw.close();
535
      }
515
      }
536
      catch( IOException e )
516
      catch( IOException e )
Line 600... Line 580...
600
  
580
  
601
      runCommand( "Failure to generate auto.pl potentially caused by missing dependencies in the Release Manager database" );
581
      runCommand( "Failure to generate auto.pl potentially caused by missing dependencies in the Release Manager database" );
602
    }
582
    }
603
  }
583
  }
604
    
584
    
605
  private void jwrap() throws Exception
585
  private void jatsBuildPackage() throws Exception
606
  {
586
  {
607
    //--------------------------------------------------------------------------
587
    //--------------------------------------------------------------------------
608
    //  Build Phase
588
    //  Build Phase
609
    //  Create build environment
589
    //  Create build environment
610
 
590
 
Line 748... Line 728...
748
    addCommand( "-o" );
728
    addCommand( "-o" );
749
    addCommand( "-m" );
729
    addCommand( "-m" );
750
    addCommand( "-pname" );
730
    addCommand( "-pname" );
751
    addCommand( packageName );
731
    addCommand( packageName );
752
    addCommand( "-pversion" );
732
    addCommand( "-pversion" );
753
    if ( packageExtension.length() > 0 )
-
 
754
    {
-
 
755
      addCommand( packageVersion + "." + packageExtension );
-
 
756
    }
-
 
757
    else
-
 
758
    {
-
 
759
      addCommand( packageVersion );
733
    addCommand( packageFullVersion );
760
    }
-
 
761
    
734
    
762
    if ( generic != null )
735
    if ( generic != null )
763
    {
736
    {
764
      addCommand( "-generic" );
737
      addCommand( "-generic" );
765
    }
738
    }
766
    
739
    
767
    runCommand( "Failure to publish to archive" );
740
    runCommand( "Failure to publish to archive" );
768
  }
741
  }
-
 
742
  
-
 
743
  /**   Check if the package has been Published on all the required machines
-
 
744
   *    If its a 'generic' package then a tag of built.generic will have been placed in the package
-
 
745
   *    Otherwise each build machine will place a built.<MachName> file in the package
-
 
746
   *  
-
 
747
   *    All we know is which MachTypes we build for. This needs to be expanded into
-
 
748
   *    a list of MachineNames. Thus a build-set with multiple machines of the same MachType
-
 
749
   *    can indicate build failures.
-
 
750
   */
-
 
751
  private void publish() throws Exception
-
 
752
  {  
769
    
753
    
770
  private void publish(String gatherMetricsOnly) throws Exception
754
    //  Metrics gathering (only) does not create anything in dpkg_archive
771
  {    
-
 
772
    // check dpkg_archive    
755
    if ( gatherMetricsOnly != null )
773
    for (Iterator<Platform> it=platformCollection.iterator(); it.hasNext(); )
-
 
774
    {
756
    {
-
 
757
        fullyPublished = "yes";
-
 
758
        return;
-
 
759
    }
-
 
760
        
-
 
761
    if ( generic != null )
-
 
762
    {
-
 
763
        //  Generic - only one maker file
-
 
764
        fullyPublished = checkPublished( dpkg_archive, "generic" );
-
 
765
    }
-
 
766
    else
-
 
767
    {
-
 
768
        //  Multi machine package
-
 
769
        //  Scan required target machines artifacts
-
 
770
        //  Expand from MachType to one or more MachName's
-
 
771
        for (Iterator<Platform> ip=platformCollection.iterator(); ip.hasNext(); )
-
 
772
        {
775
      Platform platform = it.next();
773
          Platform platform = ip.next();
-
 
774
          for (Iterator<Machine> it=ABTData.machineCollection.iterator(); it.hasNext(); )
-
 
775
          {
-
 
776
            Machine ma = it.next();
776
      fullyPublished = published( dpkg_archive, platform.getGbe_Machtype() );
777
            if (ma.getMachtype().compareTo(platform.getGbe_Machtype()) == 0 )
777
      
778
            {
-
 
779
                fullyPublished = checkPublished( dpkg_archive, ma.getName() );
778
      if ( fullyPublished.compareTo("no") == 0 )
780
                if ( fullyPublished.compareTo("no") == 0 )
-
 
781
                {
-
 
782
                  break;
-
 
783
                }
779
      {
784
            }
780
        break;
785
          }
781
      }
786
        }
782
    }
787
    }
783
 
788
 
-
 
789
    //  Detect problem with zero length descpkg file
-
 
790
    //      May be caused by write clash from multiple machines
-
 
791
    //      Don't know
-
 
792
    //
784
    if ( gatherMetricsOnly != null )
793
    if ( fullyPublished.compareTo("yes") == 0 )
785
    {
794
    {
-
 
795
        if (dpkg_archive == null)
-
 
796
        {
-
 
797
          reportErrorException( "GBE_DPKG environment variable not set", 256 );
-
 
798
        }
-
 
799
 
-
 
800
        String destination = dpkg_archive + fs + packageName + fs + packageFullVersion;
-
 
801
        String filename = "descpkg";
-
 
802
 
-
 
803
        File flag = new File( destination, filename );
-
 
804
 
-
 
805
        //  File Must
-
 
806
        //      Exist
-
 
807
        //      Be a File
-
 
808
        //      Have a length. Problem appers to be zero length file
786
      return;
809
        //
-
 
810
        boolean found = false;
-
 
811
        if (!flag.exists() ) {
-
 
812
            Log( "published. Descpkg Sanity Test: File not found", fatal );
-
 
813
 
-
 
814
        } else if ( !flag.isFile()) {
-
 
815
            Log( "published. Descpkg Sanity Test: Is not a file", fatal );
-
 
816
 
-
 
817
        } else if ( flag.length() <= 0 ) {
-
 
818
            Log( "published. Descpkg Sanity Test: Zero length File", fatal );
-
 
819
 
-
 
820
        } else {
-
 
821
            Log( "published. Descpkg Sanity Test: Passed", info );
-
 
822
            found = true;
-
 
823
        }
-
 
824
 
-
 
825
        if (!found) {
-
 
826
            fullyPublished = "no";
-
 
827
        }
787
    }
828
    }
788
 
829
 
789
    if ( fullyPublished.compareTo("yes") == 0 && daemon != null )
830
    if ( fullyPublished.compareTo("yes") == 0 && daemon != null )
790
    {
831
    {
791
      if ( doesNotRequireSourceControlInteraction == null )
832
      if ( doesNotRequireSourceControlInteraction == null )
Line 842... Line 883...
842
        
883
        
843
        addCommand( "-pname" );
884
        addCommand( "-pname" );
844
        addCommand( packageName );
885
        addCommand( packageName );
845
 
886
 
846
        addCommand( "-pversion" );
887
        addCommand( "-pversion" );
847
        if ( packageExtension.length() > 0 )
-
 
848
        {
-
 
849
          addCommand( packageVersion + "." + packageExtension );
-
 
850
        }
-
 
851
        else
-
 
852
        {
-
 
853
          addCommand( packageVersion );
888
        addCommand( packageFullVersion );
854
        }
-
 
855
 
889
 
856
        if ( directChange != null )
890
        if ( directChange != null )
857
        {
891
        {
858
          addCommand( "-isawip" );
892
          addCommand( "-isawip" );
859
        }
893
        }
Line 901... Line 935...
901
        Log("publish read info file. Label:" + newVcsTag , info);
935
        Log("publish read info file. Label:" + newVcsTag , info);
902
      }
936
      }
903
    }
937
    }
904
  }
938
  }
905
 
939
 
-
 
940
/** determineBuildStandard
-
 
941
 *  Process the current target and set up
-
 
942
 *      buildStandard
-
 
943
 *      compileTarget
-
 
944
 *      javaVersion
-
 
945
 */
-
 
946
  private void determineBuildStandard() throws Exception
-
 
947
  {
-
 
948
      // Scan the platform collection looking for an entry that matches the current machine
-
 
949
      // Remember the index - as it used to locate a matching entry in the 
-
 
950
      // jatsCollection or jatsCollection
-
 
951
      // 
-
 
952
      // Just wanting to set up
-
 
953
      //    buildStandard and one of
-
 
954
      //        compileTarget
-
 
955
      //    OR  javaVersion
-
 
956
      //
-
 
957
      int platformIndex = 0;
-
 
958
      for ( Iterator<Platform> it = platformCollection.iterator(); it.hasNext(); )
-
 
959
      {
-
 
960
        Platform platform = it.next();
-
 
961
        platformIndex++;
-
 
962
        
-
 
963
        if ( gbeMachtype.compareTo( platform.getGbe_Machtype() ) == 0 )
-
 
964
        {
-
 
965
          break;
-
 
966
        }
-
 
967
      }
-
 
968
      
-
 
969
      int index = 0;
-
 
970
      for (Iterator<Jats> it=jatsCollection.iterator(); it.hasNext(); )
-
 
971
      {
-
 
972
        Jats j = it.next();
-
 
973
        index++;
-
 
974
        
-
 
975
        if ( platformIndex == index )
-
 
976
        {
-
 
977
          String target = j.getTarget();
-
 
978
          if ( target.compareTo( "none" ) == 0 )
-
 
979
          {
-
 
980
            compileTarget = CompileTargets.NONE;
-
 
981
          }
-
 
982
          else
-
 
983
          if ( target.compareTo( "production" ) == 0 )
-
 
984
          {
-
 
985
            compileTarget = CompileTargets.PROD;
-
 
986
          }
-
 
987
          else
-
 
988
          if ( target.compareTo( "debug") == 0 )
-
 
989
          {
-
 
990
            compileTarget = CompileTargets.DEBUG;
-
 
991
          }
-
 
992
          else
-
 
993
          if ( target.compareTo( "all" ) == 0 )
-
 
994
          {
-
 
995
            compileTarget = CompileTargets.ALL;
-
 
996
          }
-
 
997
          else
-
 
998
          {
-
 
999
            reportErrorException( "Failure, unsupported build environment " + target + ", internal ABT problem", 256 );
-
 
1000
          }
-
 
1001
          Log( "execute buildStandard: ", buildStandard.getBuildStandard() );
-
 
1002
          Log( "execute compileTarget: ", compileTarget.getCompileTarget() );
-
 
1003
          break;
-
 
1004
        }
-
 
1005
      }
-
 
1006
      
-
 
1007
      for (Iterator<Ant> it=antCollection.iterator(); it.hasNext(); )
-
 
1008
      {
-
 
1009
        Ant a = it.next();
-
 
1010
        index++;
-
 
1011
        
-
 
1012
        if ( platformIndex == index )
-
 
1013
        {
-
 
1014
          buildStandard = BuildStandards.ANT;
-
 
1015
          String version = a.getJava();
-
 
1016
          if ( version.compareTo( "none" ) == 0 )
-
 
1017
          {
-
 
1018
            javaVersion = JavaVersions.NONE;
-
 
1019
          }
-
 
1020
          else
-
 
1021
          if ( version.compareTo( "1.4" ) == 0 )
-
 
1022
          {
-
 
1023
            javaVersion = JavaVersions.FOUR;
-
 
1024
          }
-
 
1025
          else
-
 
1026
          if ( version.compareTo( "1.5" ) == 0 )
-
 
1027
          {
-
 
1028
            javaVersion = JavaVersions.FIVE;
-
 
1029
          }
-
 
1030
          else
-
 
1031
          if ( version.compareTo( "1.6" ) == 0 )
-
 
1032
          {
-
 
1033
            javaVersion = JavaVersions.SIX;
-
 
1034
          }
-
 
1035
          else
-
 
1036
          if ( version.compareTo( "1.7" ) == 0 )
-
 
1037
          {
-
 
1038
            javaVersion = JavaVersions.SEVEN;
-
 
1039
          }
-
 
1040
          else
-
 
1041
          {
-
 
1042
            reportErrorException( "Failure, unsupported build environment " + version + ", internal ABT problem", 256 );
-
 
1043
          }
-
 
1044
          Log( "execute buildStandard: ", buildStandard.getBuildStandard() );
-
 
1045
          Log( "execute javaVersion: ", javaVersion.getJavaVersion() );
-
 
1046
          break;
-
 
1047
        }
-
 
1048
      }
-
 
1049
  }
-
 
1050
 
-
 
1051
  /** execute
-
 
1052
   *  The Aant Task entry point. This is invoked to perform the
-
 
1053
   *  targets action
-
 
1054
   */
906
  public void execute()
1055
  public void execute()
907
  {
1056
  {
908
    boolean errorReported = false;
1057
    boolean errorReported = false;
909
    boolean benign = false;
1058
    boolean benign = false;
-
 
1059
 
-
 
1060
 
910
    try
1061
    try
911
    {
1062
    {
912
      re = new Redirector(this);
1063
      re = new Redirector(this);
913
      
1064
      
914
      // early ant built in
1065
      // early ant built in
915
      project = getProject();
1066
      project = getProject();
916
      // required by the Execute API on non win32 platforms, don't ask because I don't know
1067
      // required by the Execute API on non win32 platforms, don't ask because I don't know
917
      project.setProperty("ant.home", System.getenv("ANT_HOME"));
1068
      project.setProperty("ant.home", System.getenv("ANT_HOME"));
918
  
1069
 
919
      daemon = project.getProperty("abt_daemon");
1070
      daemon = project.getProperty("abt_daemon");
920
      
-
 
921
      if ( daemon != null )
1071
      if ( daemon != null )
922
      {
1072
      {
923
        Log("execute daemon: yes", info);
1073
        Log("execute daemon: yes", info);
924
      }
1074
      }
-
 
1075
 
-
 
1076
      // Get the current hostname
-
 
1077
      // Perhaps this should be injected by the calling task
-
 
1078
      // Daemon Mode:
-
 
1079
      //    When sending emails
-
 
1080
      //    Identify the target machine parameters
-
 
1081
      // Escrow Mode:
-
 
1082
      //    Deterime escrow build components    
925
          
1083
      try
-
 
1084
      {
-
 
1085
        InetAddress local = InetAddress.getLocalHost();
-
 
1086
        hostname = local.getHostName();
-
 
1087
      }
-
 
1088
      catch( UnknownHostException e )
-
 
1089
      {
-
 
1090
        // do nothing, shouldn't happen, but hostname will be "unknown" if it does
-
 
1091
      }
-
 
1092
 
926
      // early target related
1093
      // early target related
927
      target = getOwningTarget();
1094
      target = getOwningTarget();
928
      packageAlias = target.getName();
1095
      packageAlias = target.getName();
929
      packageVcsTag = project.getProperty(packageAlias + "packagevcstag");
1096
      packageVcsTag = project.getProperty(packageAlias + "packagevcstag");
930
      Log("execute packageVcsTag: ", packageVcsTag);
1097
      Log("execute packageVcsTag: ", packageVcsTag);
Line 942... Line 1109...
942
      // ant built in
1109
      // ant built in
943
      basedir = project.getProperty("basedir");
1110
      basedir = project.getProperty("basedir");
944
      Log("execute basedir: ", basedir);
1111
      Log("execute basedir: ", basedir);
945
  
1112
  
946
      // global
1113
      // global
947
      master = false;
-
 
948
      
-
 
949
      String mode = project.getProperty("abt_MASTER");
-
 
950
      
-
 
951
      if ( mode != null && mode.compareTo("yes") == 0 )
-
 
952
      {
-
 
953
      	master = true;
-
 
954
      }
-
 
955
      
1114
 
956
      gbebuildfilter = project.getProperty("abt_GBE_BUILDFILTER");
-
 
957
      if ( gbebuildfilter != null )
1115
      if ( gbeMachtype == null ) {
958
      {
-
 
959
        //
-
 
960
        // Ensure the Execute task passes gbebuildfilter as one parameter...
1116
        reportErrorException( "GBE_MACHTYPE environment variable not set", 256 );
961
        // Replace spaces with commas
-
 
962
        //
-
 
963
        gbebuildfilter = gbebuildfilter.replace( " ", ",");
-
 
964
        Log("execute gbebuildfilter: ", gbebuildfilter);
-
 
965
      }
1117
      }
966
  
1118
 
967
      mailServer = project.getProperty("abt_mail_server");
1119
      mailServer = project.getProperty("abt_mail_server");
968
      
-
 
969
      if ( mailServer == null )
1120
      if ( mailServer == null )
970
      {
1121
      {
971
        mailServer = new String( "auperadom10.aupera.erggroup.com" );
1122
          reportErrorException( "Missing ANT property: abt_mail_server", 256 );
972
      }
1123
      }
973
      
-
 
974
      Log("execute mailServer: ", mailServer);
1124
      Log("execute mailServer: ", mailServer);
975
  
1125
  
976
      mailSender = project.getProperty( "abt_mail_sender" );
1126
      mailSender = project.getProperty( "abt_mail_sender" );
977
      
-
 
978
      if ( mailSender == null )
1127
      if ( mailSender == null )
979
      {
1128
      {
980
        mailSender = new String( "buildadm@vixtechnology.com" );
1129
          reportErrorException( "Missing ANT property: abt_mail_sender", 256 );
981
      }
1130
      }
982
      
-
 
983
      Log("execute mailSender: ", mailSender);
1131
      Log("execute mailSender: ", mailSender);
-
 
1132
 
-
 
1133
      for (Iterator<Owner> it=ABTData.ownerCollection.iterator(); it.hasNext(); )
-
 
1134
      {
-
 
1135
        Owner owner = it.next();
-
 
1136
        
-
 
1137
        if ( owners == null )
-
 
1138
        {
-
 
1139
          owners = new String();
-
 
1140
        }
-
 
1141
        else
-
 
1142
        {
-
 
1143
          owners += ",";
-
 
1144
        }
-
 
1145
        owners += owner.getEmail();
-
 
1146
        Log("execute owner: ", owner.getEmail());
-
 
1147
      }
-
 
1148
      Log("execute owners: ", owners);
-
 
1149
 
984
  
1150
  
985
      // project related
1151
      // project related
986
      rtagId = project.getProperty("abt_rtag_id");
1152
      rtagId = project.getProperty("abt_rtag_id");
987
      Log("execute rtagId: ", rtagId);
1153
      Log("execute rtagId: ", rtagId);
988
      
1154
      
Line 1001... Line 1167...
1001
      newExtension = project.getProperty("abt_new_extension");
1167
      newExtension = project.getProperty("abt_new_extension");
1002
      Log("execute newExtension: ", newExtension);
1168
      Log("execute newExtension: ", newExtension);
1003
 
1169
 
1004
      testBuildInstruction = project.getProperty("abt_test_build_instruction");
1170
      testBuildInstruction = project.getProperty("abt_test_build_instruction");
1005
      Log("execute testBuildInstruction: ", testBuildInstruction);
1171
      Log("execute testBuildInstruction: ", testBuildInstruction);
-
 
1172
 
-
 
1173
      // Locate Machine Information for this machine
-
 
1174
      //    It contains the build filter for the current machine
-
 
1175
      //    Only present in daemon builds
-
 
1176
      //
-
 
1177
      for (Iterator<Machine> it=ABTData.machineCollection.iterator(); it.hasNext(); )
-
 
1178
      {
-
 
1179
        Machine ma = it.next();
-
 
1180
        if (ma.getName().compareTo(hostname) == 0 )
-
 
1181
        {
-
 
1182
            mMachine = ma;
-
 
1183
            Log("execute machine: ", mMachine.getName() + ", Type:" + mMachine.getMachtype() + ", Class:" + mMachine.getMachclass() + ", Master:" + mMachine.getMaster() ); 
-
 
1184
            break;
-
 
1185
        }
-
 
1186
      }
-
 
1187
 
-
 
1188
      if ( (daemon != null) && (mMachine == null) ) {
-
 
1189
          reportErrorException( "Cannot find Machine entry for: " + hostname, 256 );
-
 
1190
      }
1006
      
1191
      
-
 
1192
      //  Setup machine specific information
-
 
1193
      //    Build Filter
-
 
1194
      //    Master Mode
-
 
1195
      if (mMachine != null) 
-
 
1196
      {
-
 
1197
          if (mMachine.getMaster() != null)
-
 
1198
          {
-
 
1199
            master = true;
-
 
1200
            Log("execute master: ", "true");
-
 
1201
          }
-
 
1202
 
-
 
1203
          gbebuildfilter = mMachine.getBuildfilter(); 
-
 
1204
          if ( gbebuildfilter != null )
-
 
1205
          {
-
 
1206
            //
-
 
1207
            // Ensure the Execute task passes gbebuildfilter as one parameter...
-
 
1208
            // Replace spaces with commas
-
 
1209
            //
-
 
1210
            gbebuildfilter = gbebuildfilter.replace( " ", ",");
-
 
1211
            Log("execute gbebuildfilter: ", gbebuildfilter);
-
 
1212
          }
-
 
1213
      }
-
 
1214
 
1007
      if ( testBuildInstruction == null )
1215
      if ( testBuildInstruction == null )
1008
      {
1216
      {
1009
        // use a meaningful default
1217
        // use a meaningful default
1010
        testBuildInstruction = "0";
1218
        testBuildInstruction = "0";
1011
      }
1219
      }
Line 1032... Line 1240...
1032
 
1240
 
1033
      // must set up package name and owners before reportError
1241
      // must set up package name and owners before reportError
1034
      packageName = project.getProperty(packageAlias + "packagename");
1242
      packageName = project.getProperty(packageAlias + "packagename");
1035
      Log("execute packageName: ", packageName);
1243
      Log("execute packageName: ", packageName);
1036
      
1244
      
1037
      for (Iterator<Owner> it=ownerCollection.iterator(); it.hasNext(); )
1245
      //-----------------------------------------------------------------------
1038
      {
-
 
1039
        Owner owner = it.next();
-
 
1040
        
-
 
1041
        if ( owners == null )
-
 
1042
        {
-
 
1043
          owners = new String();
-
 
1044
        }
-
 
1045
        else
1246
      //    AbtSetUp
1046
        {
-
 
1047
          owners += ",";
-
 
1048
        }
-
 
1049
        owners += owner.getEmail();
-
 
1050
        Log("execute owner: ", owner.getEmail());
-
 
1051
      }
1247
      //
1052
      
-
 
1053
      Log("execute owners: ", owners);
-
 
1054
 
-
 
1055
      if ( packageAlias.compareTo("AbtSetUp") == 0 )
1248
      if ( packageAlias.compareTo("AbtSetUp") == 0 )
1056
      {
1249
      {
1057
        // create rtag_id directory from scratch
1250
        // create rtag_id directory from scratch
1058
        File rId = new File( rtagId );
1251
        File rId = new File( rtagId );
1059
        deleteDirectory( rId );
1252
        deleteDirectory( rId );
Line 1072... Line 1265...
1072
 
1265
 
1073
        runCommand( "Failure to extract source code from source control" );
1266
        runCommand( "Failure to extract source code from source control" );
1074
        return;
1267
        return;
1075
      }
1268
      }
1076
 
1269
 
1077
      // target related    
-
 
1078
      packageVersion = project.getProperty(packageAlias + "packageversion");
-
 
1079
      Log("execute packageVersion: ", packageVersion);
-
 
1080
      packageExtension = project.getProperty(packageAlias + "packageextension");
1270
      //-----------------------------------------------------------------------
1081
      Log("execute packageExtension: ", packageExtension);
-
 
1082
      packageLoc = packageName;
-
 
1083
      
-
 
1084
      if ( packageExtension.length() > 0 )
-
 
1085
      {
-
 
1086
        packageLoc += "." + packageExtension;
-
 
1087
      }
-
 
1088
 
-
 
1089
      generic = project.getProperty(packageAlias + "generic");
-
 
1090
 
-
 
1091
      if ( generic != null )
-
 
1092
      {
-
 
1093
        Log("execute generic: yes", info);  
-
 
1094
      }
-
 
1095
      
-
 
1096
      int platformIndex = 0;
-
 
1097
      
-
 
1098
      for ( Iterator<Platform> it = platformCollection.iterator(); it.hasNext(); )
-
 
1099
      {
-
 
1100
        Platform platform = it.next();
-
 
1101
        platformIndex++;
-
 
1102
        
-
 
1103
        if ( gbeMachtype.compareTo( platform.getGbe_Machtype() ) == 0 )
-
 
1104
        {
-
 
1105
          break;
-
 
1106
        }
-
 
1107
      }
-
 
1108
      
-
 
1109
      int index = 0;
-
 
1110
      
-
 
1111
      for (Iterator<Jats> it=jatsCollection.iterator(); it.hasNext(); )
-
 
1112
      {
-
 
1113
        Jats j = it.next();
-
 
1114
        index++;
-
 
1115
        
-
 
1116
        if ( platformIndex == index )
-
 
1117
        {
-
 
1118
          String target = j.getTarget();
-
 
1119
          if ( target.compareTo( "none" ) == 0 )
-
 
1120
          {
-
 
1121
            compileTarget = CompileTargets.NONE;
-
 
1122
          }
-
 
1123
          else
-
 
1124
          if ( target.compareTo( "production" ) == 0 )
-
 
1125
          {
-
 
1126
            compileTarget = CompileTargets.PROD;
-
 
1127
          }
-
 
1128
          else
-
 
1129
          if ( target.compareTo( "debug") == 0 )
-
 
1130
          {
-
 
1131
            compileTarget = CompileTargets.DEBUG;
-
 
1132
          }
-
 
1133
          else
-
 
1134
          if ( target.compareTo( "all" ) == 0 )
-
 
1135
          {
-
 
1136
            compileTarget = CompileTargets.ALL;
-
 
1137
          }
-
 
1138
          else
-
 
1139
          {
-
 
1140
            reportErrorException( "Failure, unsupported build environment " + target + ", internal ABT problem", 256 );
-
 
1141
          }
-
 
1142
          Log( "execute buildStandard: ", buildStandard.getBuildStandard() );
-
 
1143
          Log( "execute compileTarget: ", compileTarget.getCompileTarget() );
-
 
1144
          break;
1271
      //    AbtTearDown
1145
        }
-
 
1146
      }
-
 
1147
      
-
 
1148
      for (Iterator<Ant> it=antCollection.iterator(); it.hasNext(); )
-
 
1149
      {
-
 
1150
        Ant a = it.next();
-
 
1151
        index++;
-
 
1152
        
1272
      //
1153
        if ( platformIndex == index )
-
 
1154
        {
-
 
1155
          buildStandard = BuildStandards.ANT;
-
 
1156
          String version = a.getJava();
-
 
1157
          if ( version.compareTo( "none" ) == 0 )
-
 
1158
          {
-
 
1159
            javaVersion = JavaVersions.NONE;
-
 
1160
          }
-
 
1161
          else
-
 
1162
          if ( version.compareTo( "1.4" ) == 0 )
-
 
1163
          {
-
 
1164
            javaVersion = JavaVersions.FOUR;
-
 
1165
          }
-
 
1166
          else
-
 
1167
          if ( version.compareTo( "1.5" ) == 0 )
-
 
1168
          {
-
 
1169
            javaVersion = JavaVersions.FIVE;
-
 
1170
          }
-
 
1171
          else
-
 
1172
          if ( version.compareTo( "1.6" ) == 0 )
-
 
1173
          {
-
 
1174
            javaVersion = JavaVersions.SIX;
-
 
1175
          }
-
 
1176
          else
-
 
1177
          if ( version.compareTo( "1.7" ) == 0 )
-
 
1178
          {
-
 
1179
            javaVersion = JavaVersions.SEVEN;
-
 
1180
          }
-
 
1181
          else
-
 
1182
          {
-
 
1183
            reportErrorException( "Failure, unsupported build environment " + version + ", internal ABT problem", 256 );
-
 
1184
          }
-
 
1185
          Log( "execute buildStandard: ", buildStandard.getBuildStandard() );
-
 
1186
          Log( "execute javaVersion: ", javaVersion.getJavaVersion() );
-
 
1187
          break;
-
 
1188
        }
-
 
1189
      }
-
 
1190
 
-
 
1191
      if ( packageAlias.compareTo("AbtTearDown") == 0 )
1273
      if ( packageAlias.compareTo("AbtTearDown") == 0 )
1192
      {
1274
      {
1193
        // tear the build view down, regardless of build error
1275
        // tear the build view down, regardless of build error
1194
        wd = new File( basedir );
1276
        wd = new File( basedir );
1195
          
1277
          
Line 1221... Line 1303...
1221
        saveLogs();
1303
        saveLogs();
1222
 
1304
 
1223
        return;      
1305
        return;      
1224
      }
1306
      }
1225
    
1307
    
-
 
1308
      // target related    
-
 
1309
      packageVersion = project.getProperty(packageAlias + "packageversion");
-
 
1310
      Log("execute packageVersion: ", packageVersion);
-
 
1311
 
1226
      directChange = project.getProperty(packageAlias + "directchange");
1312
      packageExtension = project.getProperty(packageAlias + "packageextension");
-
 
1313
      Log("execute packageExtension: ", packageExtension);
-
 
1314
 
-
 
1315
      packageFullVersion = packageVersion + packageExtension;
-
 
1316
      Log("execute packageFullVersion: ", packageFullVersion);
-
 
1317
 
-
 
1318
      packageLoc = packageName + packageExtension;
-
 
1319
      Log("execute packageLoc: ", packageLoc);
1227
      
1320
      
-
 
1321
      generic = project.getProperty(packageAlias + "generic");
-
 
1322
      if ( generic != null ) {
-
 
1323
        Log("execute generic: yes", info);  
-
 
1324
      }
-
 
1325
      
-
 
1326
      // Extract the build standard information from the abt element
-
 
1327
      determineBuildStandard();
-
 
1328
 
-
 
1329
      directChange = project.getProperty(packageAlias + "directchange");
1228
      if ( directChange != null )
1330
      if ( directChange != null )
1229
      {
1331
      {
1230
        Log("execute directChange: yes", info);  
1332
        Log("execute directChange: yes", info);  
1231
      }
1333
      }
1232
      
1334
      
1233
      doesNotRequireSourceControlInteraction = project.getProperty(packageAlias + "doesnotrequiresourcecontrolinteraction");
1335
      doesNotRequireSourceControlInteraction = project.getProperty(packageAlias + "doesnotrequiresourcecontrolinteraction");
1234
      
-
 
1235
      if ( doesNotRequireSourceControlInteraction != null )
1336
      if ( doesNotRequireSourceControlInteraction != null )
1236
      {
1337
      {
1237
        Log("execute doesNotRequireSourceControlInteraction: true", info);  
1338
        Log("execute doesNotRequireSourceControlInteraction: true", info);  
1238
      }
1339
      }
1239
      
1340
      
-
 
1341
      //    Display details of the Platform Jats and Ant elements within the
-
 
1342
      //    current ABT element
-
 
1343
      //
1240
      for (Iterator<Platform> it=platformCollection.iterator(); it.hasNext(); )
1344
      for (Iterator<Platform> it=platformCollection.iterator(); it.hasNext(); )
1241
      {
1345
      {
1242
        Platform platform = it.next();
1346
        Platform platform = it.next();
1243
        Log("execute platform: ", platform.getGbe_Machtype());
1347
        Log("execute platform: ", platform.getGbe_Machtype());
1244
      }
1348
      }
Line 1259... Line 1363...
1259
      // Will be used when rebuilding a package that already exists
1363
      // Will be used when rebuilding a package that already exists
1260
      newVcsTag = packageVcsTag;
1364
      newVcsTag = packageVcsTag;
1261
 
1365
 
1262
      loc = project.getProperty(packageAlias + "loc");
1366
      loc = project.getProperty(packageAlias + "loc");
1263
      Log("execute loc: ", loc);
1367
      Log("execute loc: ", loc);
-
 
1368
 
1264
      cwd = basedir + loc;
1369
      cwd = basedir + loc;
1265
      Log("execute cwd: ", cwd);
1370
      Log("execute cwd: ", cwd);
-
 
1371
 
1266
      wd = new File( cwd );
1372
      wd = new File( cwd );
1267
        
-
 
1268
      if ( !wd.exists() )
1373
      if ( !wd.exists() )
1269
      {
1374
      {
1270
        reportErrorException( "Failure " + cwd + " does not exist", 265 );
1375
        reportErrorException( "Failure " + cwd + " does not exist", 265 );
1271
      }
1376
      }
1272
      
1377
      
1273
      String gatherMetricsOnly = System.getenv("GBE_GATHER_METRICS");
-
 
1274
      
-
 
1275
      // only now change the thread working directory
1378
      // only now change the thread working directory
1276
      thread.setWorkingDirectory( wd );
1379
      thread.setWorkingDirectory( wd );
1277
      
1380
      
-
 
1381
      //-----------------------------------------------------------------------
-
 
1382
      //    AbtPublish
-
 
1383
      //    Note: Have changed directory to the working directory
-
 
1384
      //
1278
      if ( packageAlias.compareTo("AbtPublish") == 0 )
1385
      if ( packageAlias.compareTo("AbtPublish") == 0 )
1279
      {
1386
      {
1280
        publish(gatherMetricsOnly);
1387
        publish();
1281
        if ( daemon != null )
1388
        if ( daemon != null )
1282
        {
1389
        {
1283
          // set properties to drive BuildThread attributes
1390
          // set properties to drive BuildThread attributes
1284
          // these are used to determine what ant did
1391
          // these are used to determine what ant did
1285
          getProject().setProperty("abt_fully_published", fullyPublished);
1392
          getProject().setProperty("abt_fully_published", fullyPublished);
Line 1287... Line 1394...
1287
        }
1394
        }
1288
        
1395
        
1289
        return;
1396
        return;
1290
      }
1397
      }
1291
      
1398
      
-
 
1399
      //-----------------------------------------------------------------------
-
 
1400
      //    Build Target
-
 
1401
      //    Note: Have changed directory to the working directory
-
 
1402
      //
1292
      packageVersionID = project.getProperty(packageAlias + "pv_id");
1403
      packageVersionID = project.getProperty(packageAlias + "pv_id");
1293
      Log("execute packageVersionID: ", packageVersionID);
1404
      Log("execute packageVersionID: ", packageVersionID);
1294
      unittests = project.getProperty(packageAlias + "unittests");
1405
      unittests = project.getProperty(packageAlias + "unittests");
1295
      
1406
      
1296
      if ( unittests != null )
1407
      if ( unittests != null )
Line 1302... Line 1413...
1302
      {
1413
      {
1303
        Depend depend = it.next();
1414
        Depend depend = it.next();
1304
        Log("execute depend: ", depend.getPackage_Alias());
1415
        Log("execute depend: ", depend.getPackage_Alias());
1305
      }
1416
      }
1306
            
1417
            
1307
      // check platform
-
 
1308
      if ( gbeMachtype == null )
-
 
1309
      {
-
 
1310
        reportErrorException( "GBE_MACHTYPE environment variable not set", 256 );
-
 
1311
      }
-
 
1312
            
-
 
1313
      if ( daemon == null )
1418
      if ( daemon == null )
1314
      {
1419
      {
1315
        // escrow centric
1420
        // escrow centric
1316
        // recognise an escrow will be run multiple times on a build stage
1421
        // recognise an escrow will be run multiple times on a build stage
1317
        // do not force continuous rebuilding each time
1422
        // do not force continuous rebuilding each time
1318
        // has this package version already been published on this platform
1423
        // has this package version already been published on this platform
1319
        String published = published( dpkg_archive, gbeMachtype );
1424
        String published = checkPublished( dpkg_archive, ( generic != null ) ? "generic" : hostname );
1320
        
1425
 
1321
        if ( published.compareTo("no") != 0 )
1426
        if ( published.compareTo("no") != 0 )
1322
        {
1427
        {
1323
          Log( "execute package has been published on this platform - skipping", info);
1428
          Log( "execute package has been published on this platform - skipping", info);
1324
          propertyValue = "257";
1429
          propertyValue = "257";
1325
          throw new Exception();
1430
          throw new Exception();
Line 1337... Line 1442...
1337
      }
1442
      }
1338
      
1443
      
1339
      if ( ( buildStandard == BuildStandards.ANT && javaVersion == JavaVersions.NONE ) ||
1444
      if ( ( buildStandard == BuildStandards.ANT && javaVersion == JavaVersions.NONE ) ||
1340
           ( buildStandard == BuildStandards.JATS && compileTarget == CompileTargets.NONE ) )
1445
           ( buildStandard == BuildStandards.JATS && compileTarget == CompileTargets.NONE ) )
1341
      {
1446
      {
1342
        // flag a benign build is good
1447
        //  Flag a benign build is good
-
 
1448
        //  A benign is a no-operation. The build is not rquired on the current machine
-
 
1449
        //  Issue: We have already extracted the source and will need to tear it down
-
 
1450
        //
1343
        benign = true;
1451
        benign = true;
1344
      }
1452
      }
1345
      
1453
      
-
 
1454
      // Pre Build processing
-
 
1455
      //    Init metrics gathering
-
 
1456
      //    Generate auto.pl or <PackageName>depends.xml file
-
 
1457
      //
1346
      genbuild( gatherMetricsOnly );
1458
      genbuild();
1347
      
1459
      
1348
      if ( !benign )
1460
      if ( !benign && gatherMetricsOnly == null )
1349
      {
1461
      {
1350
        if ( gatherMetricsOnly != null )
-
 
1351
        {
-
 
1352
          // special for metrics
-
 
1353
          String archive = dpkg_archive;
-
 
1354
          
-
 
1355
          if (archive != null)
-
 
1356
          {
1462
          //
1357
            String fs = System.getProperty( "file.separator" );
-
 
1358
            String destination = archive + fs + getProject().getProperty("abt_package_name") + fs + getProject().getProperty("abt_package_version");
-
 
1359
 
-
 
1360
            // do this for the win32 and generic based platforms
-
 
1361
            new File( destination ).mkdirs();
1463
          //    Build the target package
1362
            new File( destination, "built.win32" ).createNewFile();
-
 
1363
            new File( destination, "built.generic" ).createNewFile();
-
 
1364
          }
1464
          //
1365
          
-
 
1366
        }
-
 
1367
        else
-
 
1368
        {
-
 
1369
          jwrap();
1465
          jatsBuildPackage();
1370
        }
-
 
1371
      }
1466
      }
1372
      
1467
      
1373
      if ( master )
1468
      if ( master )
1374
      {
1469
      {
1375
        File metrics = new File(basedir + fs + rtagId + "abtmetrics.txt");
1470
        File metrics = new File(basedir + fs + rtagId + "abtmetrics.txt");
1376
        
-
 
1377
        if ( metrics.exists() )
1471
        if ( metrics.exists() )
1378
        {
1472
        {
1379
          metrics.delete();
1473
          metrics.delete();
1380
        }
1474
        }
1381
 
1475
 
Line 1425... Line 1519...
1425
          // do not write to publish.log
1519
          // do not write to publish.log
1426
          throw new IOException();
1520
          throw new IOException();
1427
        }
1521
        }
1428
        
1522
        
1429
        FileWriter publish = new FileWriter( basedir + fs + "publish.log", true );
1523
        FileWriter publish = new FileWriter( basedir + fs + "publish.log", true );
1430
        String friendlyVersion = packageVersion;
-
 
1431
        if ( packageExtension.length() > 0 )
-
 
1432
        {
-
 
1433
          friendlyVersion += "." + packageExtension;
-
 
1434
        }
-
 
1435
        
-
 
1436
        if ( propertyValue.compareTo( "0" ) == 0 )
1524
        if ( propertyValue.compareTo( "0" ) == 0 )
1437
        {
1525
        {
1438
          if ( benign )
1526
          if ( benign )
1439
          {
1527
          {
1440
            publish.write( "successfully published " + packageName + " at " + friendlyVersion + ", no action required on this platform" );
1528
            publish.write( "successfully published " + packageName + " at " + packageFullVersion + ", no action required on this platform" );
1441
          }
1529
          }
1442
          else
1530
          else
1443
          {
1531
          {
1444
            publish.write( "successfully published " + packageName + " at " + friendlyVersion );
1532
            publish.write( "successfully published " + packageName + " at " + packageFullVersion );
1445
          }
1533
          }
1446
          
1534
          
1447
          publish.write( ls );
1535
          publish.write( ls );
1448
        }
1536
        }
1449
        else
1537
        else
1450
        if ( propertyValue.compareTo( "256" ) == 0 )
1538
        if ( propertyValue.compareTo( "256" ) == 0 )
1451
        {
1539
        {
1452
          publish.write( "failed to publish " + packageName + " at " + friendlyVersion +  ", internal abt issue" + ls );
1540
          publish.write( "failed to publish " + packageName + " at " + packageFullVersion +  ", internal abt issue" + ls );
1453
        }
1541
        }
1454
        else
1542
        else
1455
        if ( propertyValue.compareTo( "257" ) == 0 )
1543
        if ( propertyValue.compareTo( "257" ) == 0 )
1456
        {
1544
        {
1457
          errorReported = false;
1545
          errorReported = false;
1458
          publish.write( "previously published " + packageName + " at " + friendlyVersion + ls );
1546
          publish.write( "previously published " + packageName + " at " + packageFullVersion + ls );
1459
        }
1547
        }
1460
        else
1548
        else
1461
        if ( propertyValue.compareTo( "262" ) == 0 )
1549
        if ( propertyValue.compareTo( "262" ) == 0 )
1462
        {
1550
        {
1463
          publish.write( "failed to publish " + packageName + " at " + friendlyVersion + ", couldn't process save_build info" + ls );
1551
          publish.write( "failed to publish " + packageName + " at " + packageFullVersion + ", couldn't process save_build info" + ls );
1464
        }
1552
        }
1465
        else
1553
        else
1466
        if ( propertyValue.compareTo( "263" ) == 0 )
1554
        if ( propertyValue.compareTo( "263" ) == 0 )
1467
        {
1555
        {
1468
          publish.write( "failed to publish " + packageName + " at " + friendlyVersion + ", couldn't write to auto.cfg" + ls );
1556
          publish.write( "failed to publish " + packageName + " at " + packageFullVersion + ", couldn't write to auto.cfg" + ls );
1469
        }
1557
        }
1470
        else
1558
        else
1471
        if ( propertyValue.compareTo( "265" ) == 0 )
1559
        if ( propertyValue.compareTo( "265" ) == 0 )
1472
        {
1560
        {
1473
          publish.write( "failed to publish " + packageName + " at " + friendlyVersion + ", " + cwd + " does not exist" + ls );
1561
          publish.write( "failed to publish " + packageName + " at " + packageFullVersion + ", " + cwd + " does not exist" + ls );
1474
        }
1562
        }
1475
        else
1563
        else
1476
        {
1564
        {
1477
          // nb jats or ant can presumably return a value 1 to 255
1565
          // nb jats or ant can presumably return a value 1 to 255
1478
          publish.write( "failed to publish " + packageName + " at " + friendlyVersion + ", jats or ant failed" + ls );
1566
          publish.write( "failed to publish " + packageName + " at " + packageFullVersion + ", jats or ant failed" + ls );
1479
        }
1567
        }
1480
 
1568
 
1481
        publish.close();
1569
        publish.close();
1482
      }
1570
      }
1483
      catch( IOException e )
1571
      catch( IOException e )
Line 1549... Line 1637...
1549
      // this can be thrown by exists and delete
1637
      // this can be thrown by exists and delete
1550
       Log("deleteDirectory caught SecurityException", warn);
1638
       Log("deleteDirectory caught SecurityException", warn);
1551
    }
1639
    }
1552
  }
1640
  }
1553
 
1641
 
-
 
1642
  //---------------------------------------------------------------------------
-
 
1643
  //    Extend the <abt> task with several new elements
-
 
1644
  // //
-
 
1645
  //        <depend package_alias="${debian_dpkg.cots}"/>
-
 
1646
  //        <platform gbe_machtype="solaris10_x86"/>
-
 
1647
  //        <jats target="all"/>
-
 
1648
  //        <ant java="java 1.6"/>
-
 
1649
  //
1554
  public Depend createDepend()
1650
  public Depend createDepend()
1555
  {
1651
  {
1556
    Depend depend = new Depend();
1652
    Depend depend = new Depend();
1557
    dependCollection.add(depend);
1653
    dependCollection.add(depend);
1558
    return depend;
1654
    return depend;
Line 1576... Line 1672...
1576
  {
1672
  {
1577
    Ant ant = new Ant();
1673
    Ant ant = new Ant();
1578
    antCollection.add(ant);
1674
    antCollection.add(ant);
1579
    return ant;
1675
    return ant;
1580
  }
1676
  }
1581
 
-
 
1582
  public Owner createOwner()
-
 
1583
  {
-
 
1584
    Owner owner = new Owner();
-
 
1585
    ownerCollection.add(owner);
-
 
1586
    return owner;
-
 
1587
  }
-
 
1588
}
1677
}