Subversion Repositories DevTools

Rev

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

Rev 864 Rev 908
Line 79... Line 79...
79
  private boolean mJava1_6 = false;
79
  private boolean mJava1_6 = false;
80
  
80
  
81
  private boolean mJatsNone = false;
81
  private boolean mJatsNone = false;
82
  
82
  
83
  private boolean mAntNone = false;
83
  private boolean mAntNone = false;
-
 
84
  
-
 
85
  private boolean mSupported = true;
84
 
86
 
85
  /**constructor
87
  /**constructor
86
   */
88
   */
87
  BuildStandard(RippleEngine rippleEngine)
89
  BuildStandard(RippleEngine rippleEngine)
88
  {
90
  {
89
    mLogger.debug("BuildStandard");
91
    mLogger.debug("BuildStandard");
90
    mRippleEngine = rippleEngine;
92
    mRippleEngine = rippleEngine;
91
  }
93
  }
92
 
94
 
-
 
95
  /**constructor
-
 
96
   */
-
 
97
  BuildStandard(RippleEngine rippleEngine, String buildMachine, String buildStandardAddendum)
-
 
98
  {
-
 
99
    mLogger.debug("BuildStandard");
-
 
100
    mRippleEngine = rippleEngine;
-
 
101
 
-
 
102
    if ( buildMachine.compareTo("Solaris") == 0 )
-
 
103
    {
-
 
104
      setSolaris();
-
 
105
    }
-
 
106
    else if ( buildMachine.compareTo("Win32") == 0 )
-
 
107
    {
-
 
108
      setWin32();
-
 
109
    }
-
 
110
    else if ( buildMachine.compareTo("Linux") == 0 )
-
 
111
    {
-
 
112
      setLinux();
-
 
113
    }
-
 
114
    else if ( buildMachine.compareTo("Generic") == 0 )
-
 
115
    {
-
 
116
      setGeneric();
-
 
117
    }
-
 
118
    else
-
 
119
    {
-
 
120
      mSupported = false;
-
 
121
    }
-
 
122
     
-
 
123
    if ( buildStandardAddendum.compareTo("Production") == 0 )
-
 
124
    {
-
 
125
      setProduction();
-
 
126
    }
-
 
127
    else if ( buildStandardAddendum.compareTo("Debug") == 0 )
-
 
128
    {
-
 
129
      setDebug();
-
 
130
    }
-
 
131
    else if ( buildStandardAddendum.compareTo("Production and Debug") == 0 )
-
 
132
    {
-
 
133
      setAll();
-
 
134
    }
-
 
135
    else if ( buildStandardAddendum.compareTo("Java 1.4") == 0 )
-
 
136
    {
-
 
137
      set1_4();
-
 
138
    }
-
 
139
    else if ( buildStandardAddendum.compareTo("Java 1.5") == 0 )
-
 
140
    {
-
 
141
      set1_5();
-
 
142
    }
-
 
143
    else if ( buildStandardAddendum.compareTo("Java 1.6") == 0 )
-
 
144
    {
-
 
145
      set1_6();
-
 
146
    }
-
 
147
    else
-
 
148
    {
-
 
149
      mSupported = false;
-
 
150
    }
-
 
151
  }
-
 
152
 
-
 
153
  /**returns for xml purposes
93
  /**returns "<platform gbe_machtype="win32"/>",
154
   * "<platform gbe_machtype="win32"/>",
94
   *         "<platform gbe_machtype="solaris10_sparc32"/>"
155
   * "<platform gbe_machtype="solaris10_sparc32"/>"
95
   *         "<platform gbe_machtype="solaris10_x86"/>"
156
   * "<platform gbe_machtype="solaris10_x86"/>"
96
   *         "<platform gbe_machtype="sparc"/>"
157
   * "<platform gbe_machtype="sparc"/>"
97
   *         "<platform gbe_machtype="linux_i386"/>"
158
   * "<platform gbe_machtype="linux_i386"/>"
-
 
159
   * 
-
 
160
   * returns for non xml purposes
-
 
161
   * "win32",
-
 
162
   * "solaris10_sparc32"
-
 
163
   * "solaris10_x86"
-
 
164
   * "sparc"
-
 
165
   * "linux_i386"
98
   */
166
   */
99
  String getPlatform(boolean utf)
167
  String getPlatform(boolean utf, boolean xml)
100
  {
168
  {
101
     mLogger.debug("getPlatform");  
169
     mLogger.debug("getPlatform");  
102
     String retVal = new String();
170
     String retVal = new String();
103
     
171
     
104
     if (mGeneric && mRippleEngine.mDaemon)
172
     if (mGeneric && mRippleEngine.mDaemon)
105
     {
173
     {
106
       mLogger.info("getPlatform mGeneric && mRippleEngine.mDaemon");
174
       mLogger.info("getPlatform mGeneric && mRippleEngine.mDaemon");
-
 
175
       
-
 
176
       if ( xml )
-
 
177
       {
107
       retVal = "  <platform gbe_machtype=\"";
178
         retVal = "  <platform gbe_machtype=\"";
-
 
179
       }
108
       
180
       
109
       if ( utf )
181
       if ( utf )
110
       {
182
       {
111
         mLogger.info("getPlatform utf");
183
         mLogger.info("getPlatform utf");
112
         // avoid reliance on environment variables
184
         // avoid reliance on environment variables
Line 120... Line 192...
120
           || Package.mGenericMachtype.compareTo("solaris10_x86") == 0
192
           || Package.mGenericMachtype.compareTo("solaris10_x86") == 0
121
           || Package.mGenericMachtype.compareTo("sparc") == 0
193
           || Package.mGenericMachtype.compareTo("sparc") == 0
122
           || Package.mGenericMachtype.compareTo("linux_i386") == 0 )
194
           || Package.mGenericMachtype.compareTo("linux_i386") == 0 )
123
         {
195
         {
124
           retVal += Package.mGenericMachtype;
196
           retVal += Package.mGenericMachtype;
-
 
197
           
-
 
198
           if ( xml )
-
 
199
           {
125
           retVal += "\"/>";
200
             retVal += "\"/>";
-
 
201
           }
126
         }
202
         }
127
       }
203
       }
128
     }
204
     }
129
     else if (mGeneric)
205
     else if (mGeneric)
130
     {
206
     {
Line 141... Line 217...
141
         {
217
         {
142
           if ( retVal.length() > 0 )
218
           if ( retVal.length() > 0 )
143
           {
219
           {
144
             retVal += System.getProperty("line.separator");
220
             retVal += System.getProperty("line.separator");
145
           }
221
           }
-
 
222
           
-
 
223
           if ( xml )
-
 
224
           {
146
           retVal += "  <platform gbe_machtype=\"";
225
             retVal += "  <platform gbe_machtype=\"";
-
 
226
           }
-
 
227
           
147
           retVal += gbemachtype;
228
           retVal += gbemachtype;
-
 
229
           
-
 
230
           if ( xml )
-
 
231
           {
148
           retVal += "\"/>";
232
             retVal += "\"/>";
-
 
233
           }
149
         }
234
         }
150
       }
235
       }
151
     }
236
     }
152
     else if (mWin32)
237
     else if (mWin32)
153
     {
238
     {
Line 156... Line 241...
156
       {
241
       {
157
         String gbemachtype = it.next();
242
         String gbemachtype = it.next();
158
 
243
 
159
         if ( gbemachtype.compareTo("win32") == 0 )
244
         if ( gbemachtype.compareTo("win32") == 0 )
160
         {
245
         {
-
 
246
           if ( xml )
-
 
247
           {
161
           retVal = "  <platform gbe_machtype=\"win32\"/>";
248
             retVal = "  <platform gbe_machtype=\"win32\"/>";
-
 
249
           }
-
 
250
           else
-
 
251
           {
-
 
252
             retVal = "win32";
-
 
253
           }
162
           break;
254
           break;
163
         }
255
         }
164
       }
256
       }
165
     }
257
     }
166
     else if (mSolaris)
258
     else if (mSolaris)
Line 172... Line 264...
172
 
264
 
173
         if ( gbemachtype.compareTo("sparc") == 0 || gbemachtype.compareTo("solaris10_x86") == 0 || gbemachtype.compareTo("solaris10_sparc32") == 0 )
265
         if ( gbemachtype.compareTo("sparc") == 0 || gbemachtype.compareTo("solaris10_x86") == 0 || gbemachtype.compareTo("solaris10_sparc32") == 0 )
174
         {
266
         {
175
           if ( retVal.length() > 0 )
267
           if ( retVal.length() > 0 )
176
           {
268
           {
-
 
269
             if ( xml )
-
 
270
             {
177
             retVal += System.getProperty("line.separator");
271
               retVal += System.getProperty("line.separator");
-
 
272
             }
-
 
273
             else
-
 
274
             {
-
 
275
               retVal += "<br>";
-
 
276
             }
178
           }
277
           }
-
 
278
           
-
 
279
           if ( xml )
-
 
280
           {
179
           retVal += "  <platform gbe_machtype=\"";
281
             retVal += "  <platform gbe_machtype=\"";
-
 
282
           }
-
 
283
           
180
           retVal += gbemachtype;
284
           retVal += gbemachtype;
-
 
285
           
-
 
286
           if ( xml )
-
 
287
           {
181
           retVal += "\"/>";
288
             retVal += "\"/>";
-
 
289
           }
182
         }
290
         }
183
       }
291
       }
184
     }
292
     }
185
     else
293
     else
186
     {
294
     {
Line 189... Line 297...
189
       {
297
       {
190
         String gbemachtype = it.next();
298
         String gbemachtype = it.next();
191
 
299
 
192
         if ( gbemachtype.compareTo("linux_i386") == 0 )
300
         if ( gbemachtype.compareTo("linux_i386") == 0 )
193
         {
301
         {
-
 
302
           if ( xml )
-
 
303
           {
194
           retVal = "  <platform gbe_machtype=\"linux_i386\"/>";
304
             retVal = "  <platform gbe_machtype=\"linux_i386\"/>";
-
 
305
           }
-
 
306
           else
-
 
307
           {
-
 
308
             retVal = "linux_i386";
-
 
309
           }
195
           break;
310
           break;
196
         }
311
         }
197
       }
312
       }
198
     }
313
     }
199
     
314
     
200
     mLogger.info("getPlatform returned " + retVal);
315
     mLogger.info("getPlatform returned " + retVal);
201
     return retVal;
316
     return retVal;
202
   }
317
   }
203
 
318
 
-
 
319
  /**returns for xml purposes
204
  /**returns "<ant java="1.4"/>,
320
   * "<ant java="1.4"/>",
205
   *         "<ant java="1.5"/>,
321
   * "<ant java="1.5"/>",
206
   *         "<ant java="1.6"/>,
322
   * "<ant java="1.6"/>",
207
   *         "<ant java="none"/>,
323
   * "<ant java="none"/>",
208
   *         "<jats target="production"/>,
324
   * "<jats target="production"/>",
209
   *         "<jats target="debug"/>,
325
   * "<jats target="debug"/>",
210
   *         "<jats target="all"/>
326
   * "<jats target="all"/>",
211
   *         "<jats target="none"/>
327
   * "<jats target="none"/>"
-
 
328
   * 
-
 
329
   * returns for non xml purposes
-
 
330
   * "ant java 1.4",
-
 
331
   * "ant java 1.5",
-
 
332
   * "ant java 1.6",
-
 
333
   * "ant none",
-
 
334
   * "jats production",
-
 
335
   * "jats debug",
-
 
336
   * "jats all",
-
 
337
   * "jats none"
212
   */
338
   */
213
  String getBuildStandard(boolean utf)
339
  String getBuildStandard(boolean utf, boolean xml)
214
  {
340
  {
215
    mLogger.debug("getBuildStandard");
341
    mLogger.debug("getBuildStandard");
216
    boolean validPlatform = false;
342
    boolean validPlatform = false;
217
    int numberOfPlatforms = 0;
343
    int numberOfPlatforms = 0;
218
    String retVal = new String();
344
    String retVal = new String();
Line 308... Line 434...
308
    if (validPlatform)
434
    if (validPlatform)
309
    {
435
    {
310
     
436
     
311
      if (mJava1_4)
437
      if (mJava1_4)
312
      {
438
      {
-
 
439
        if ( xml )
-
 
440
        {
313
        retVal = "  <ant java=\"1.4\"/>";
441
          retVal = "  <ant java=\"1.4\"/>";
-
 
442
        }
-
 
443
        else
-
 
444
        {
-
 
445
          retVal = "ant java 1.4";
-
 
446
        }
314
      }
447
      }
315
      else if (mJava1_5)
448
      else if (mJava1_5)
316
      {
449
      {
-
 
450
        if ( xml )
-
 
451
        {
317
        retVal = "  <ant java=\"1.5\"/>";
452
          retVal = "  <ant java=\"1.5\"/>";
-
 
453
        }
-
 
454
        else
-
 
455
        {
-
 
456
          retVal = "ant java 1.5";
-
 
457
        }
318
      }
458
      }
319
      else if (mJava1_6)
459
      else if (mJava1_6)
320
      {
460
      {
-
 
461
        if ( xml )
-
 
462
        {
321
        retVal = "  <ant java=\"1.6\"/>";
463
          retVal = "  <ant java=\"1.6\"/>";
-
 
464
        }
-
 
465
        else
-
 
466
        {
-
 
467
          retVal = "ant java 1.6";
-
 
468
        }
322
      }
469
      }
323
      else if (mAntNone)
470
      else if (mAntNone)
324
      {
471
      {
-
 
472
        if ( xml )
-
 
473
        {
325
        retVal = "  <ant java=\"none\"/>";
474
          retVal = "  <ant java=\"none\"/>";
-
 
475
        }
-
 
476
        else
-
 
477
        {
-
 
478
          retVal = "ant none";
-
 
479
        }
326
      }
480
      }
327
      else if (mJatsNone)
481
      else if (mJatsNone)
328
      {
482
      {
-
 
483
        if ( xml )
-
 
484
        {
329
        retVal = "  <jats target=\"none\"/>";
485
          retVal = "  <jats target=\"none\"/>";
-
 
486
        }
-
 
487
        else
-
 
488
        {
-
 
489
          retVal = "jats none";
-
 
490
        }
330
      }
491
      }
331
      else
492
      else
332
      {
493
      {
333
        if (mProduction)
494
        if (mProduction)
334
        {
495
        {
335
          if (mDebug)
496
          if (mDebug)
336
          {
497
          {
-
 
498
            if ( xml )
-
 
499
            {
337
            retVal = "  <jats target=\"all\"/>";
500
              retVal = "  <jats target=\"all\"/>";
-
 
501
            }
-
 
502
            else
-
 
503
            {
-
 
504
              retVal = "jats all";
-
 
505
            }
338
          }
506
          }
339
          else
507
          else
340
          {
508
          {
-
 
509
            if ( xml )
-
 
510
            {
341
            retVal = "  <jats target=\"production\"/>";
511
              retVal = "  <jats target=\"production\"/>";
-
 
512
            }
-
 
513
            else
-
 
514
            {
-
 
515
              retVal = "jats production";
-
 
516
            }
342
          }
517
          }
343
        }
518
        }
344
        else
519
        else
345
        {
520
        {
-
 
521
          if ( xml )
-
 
522
          {
346
          retVal = "  <jats target=\"debug\"/>";
523
            retVal = "  <jats target=\"debug\"/>";
-
 
524
          }
-
 
525
          else
-
 
526
          {
-
 
527
            retVal = "jats debug";
-
 
528
          }
347
        }
529
        }
348
      }
530
      }
349
  
531
 
350
      String line = new String(retVal);
532
      String line = new String(retVal);
351
       
533
       
352
      for ( int i = 1; i < numberOfPlatforms; i++ )
534
      for ( int i = 1; i < numberOfPlatforms; i++ )
353
      {
535
      {
-
 
536
        if ( xml )
-
 
537
        {
354
        retVal += System.getProperty("line.separator");
538
          retVal += System.getProperty("line.separator");
-
 
539
        }
-
 
540
        else
-
 
541
        {
-
 
542
          retVal += "<br>";
-
 
543
        }
355
        retVal += line;
544
        retVal += line;
356
      }
545
      }
357
    }
546
    }
358
     
547
     
359
    mLogger.info("getBuildStandard returned " + retVal);
548
    mLogger.info("getBuildStandard returned " + retVal);
Line 550... Line 739...
550
  {
739
  {
551
    mLogger.debug("getLinux");
740
    mLogger.debug("getLinux");
552
    mLogger.info("getLinux returned " + mLinux);
741
    mLogger.info("getLinux returned " + mLinux);
553
    return mLinux;
742
    return mLinux;
554
  }
743
  }
-
 
744
 
-
 
745
  /**accessor method
-
 
746
   */
-
 
747
  boolean supportedBuildStandard()
-
 
748
  {
-
 
749
    mLogger.debug("supportedBuildStandard");
-
 
750
    mLogger.info("supportedBuildStandard returned " + mSupported);
-
 
751
    return mSupported;
-
 
752
  }
555
}
753
}