- Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbuild.java
More file actions
Latest commit
604 lines (532 loc) · 25.3 KB
/
Copy pathbuild.java
File metadata and controls
604 lines (532 loc) · 25.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
/*
* Written by Cliff Click and released to the public domain, as explained at
* http://creativecommons.org/licenses/publicdomain
*/
importjava.io.*;
importjava.util.*;
importjava.util.concurrent.*;
/**
* A simple project build routine.
* I hate makefiles, and ANT uses the horrid XML so I'm doing this hack
* instead. Actually, I've used this technique before to great success.
* I ought to make a Real Project out of it someday.
*
* What you see is the 'guts' of make/ANT PLUS the project file dependencies
* at the end - all in pure Java. Thus I can add new features to the make
* (parallel distributed make, shared caching, etc) or add new dependencies.
* Especially for the dependencies, there is no obtuse format to describe
* things - it's all pure Java.
*
*
* @since 1.5
* @author Cliff Click
*/
classbuild {
staticprivateclassBuildErrorextendsError { BuildError( Strings ) { super(s); } }
staticboolean_verbose; // Be noisy
staticboolean_justprint; // Print, do not do any building
staticboolean_clean; // Remove target instead of building
staticboolean_keepontrucking; // Do not stop at errors
staticboolean_allow_timestamp_ties = true;
// Top-level project directory
staticFileTOP;
staticStringTOP_PATH;
staticStringTOP_PATH_SLASH;
// --- main ----------------------------------------------------------------
staticpublicvoidmain( Stringargs[] ) throwsIOException {
// --- First up: find build.java!
// Where we exec'd java.exe from
//String cwd = new File( '.' ).getCanonicalPath();
TOP = newFile(".");
TOP_PATH = TOP.getCanonicalPath();
Filef = newFile(TOP,"build.java");
while( !f.exists() ) {
Filep2 = newFile(TOP,"..");
if( p2.getCanonicalPath().equals(TOP_PATH) )
thrownewBuildError("build.java not found; build.java marks top of project heirarchy");
TOP = p2;
TOP_PATH = TOP.getCanonicalPath();
f = newFile(TOP,"build.java");
}
TOP_PATH_SLASH = TOP_PATH.replaceAll("\\\\","\\\\\\\\");
// --- Next up: always re-make self as needed
if( _build_c.make() ) {
// Since we remade ourself, launch & run self in a nested process to do
// the actual 'build' using the new version of self.
Stringa = "java -cp "+TOP_PATH_SLASH+" build ";
for( inti=0; i<args.length; i++ )
a += args[i]+" ";
ByteArrayOutputStreambuf = sys_exec(a);
buf.writeTo(System.out);
System.exit(0);
}
// --- Strip out any flags; sanity check all targets before doing any of them
intj = 0;
booleanerror = false;
for( inti=0; i<args.length; i++ ) {
if( args[i].charAt(0) == '-' ) {
if( false ) ;
elseif( args[i].equals("-v") ) _verbose = true;
elseif( args[i].equals("-n") ) _justprint = true;
elseif( args[i].equals("-k") ) _keepontrucking = true;
elseif( args[i].equals("-clean") ) _clean = true;
else {
error = true;
System.out.println("Unknown flag "+args[i]);
}
} else {
if( Q.FILES.get(args[i]) == null ) {
error = true;
System.err.println("Unknown target "+args[i]);
}
args[j++] = args[i]; // Compact out flags from target list
}
}
if( error ) thrownewError("Command line errors");
if( _verbose )
System.out.println("Building in "+TOP.getCanonicalPath());
// --- Build all named targets
for( inti=0; i<j; i++ ) { // For all targets
try {
Q.FILES.get(args[i]).make(); // Build top-level target
} catch( BuildErrore ) {
if( !_keepontrucking ) throwe; // Die at first error
error = true; // Else just print and keep going
System.err.println(e);
}
}
if( error )
thrownewBuildError("Some build errors");
// --- All Done!
}
// --- StreamEater ---------------------------------------------------------
staticprivateclassStreamEaterextendsThread {
finalInputStream_is;
finalByteArrayOutputStream_buf = newByteArrayOutputStream();
IOException_e;
StreamEater( InputStreamis ) { _is = is; start(); }
publicvoidrun() {
intlen;
byte[] buf = newbyte[1024];
try {
while( (len=_is.read(buf)) != -1 ) {
_buf.write(buf,0,len);
}
} catch( IOExceptione ) {
_e = e; // Catch it for later, we're in the wrong thread
}
}
publicvoidclose() throwsIOException, InterruptedException {
// called from the main thread on the StreamEater object, but not in the
// StreamEater thread.
join();
if( _e != null ) throw_e; // Rethrow any exception in the main thread
}
}
// --- sys_exec ------------------------------------------------------------
// Run the command string as a new system process. Throw an error if the
// return value is not zero, or any number of other errors happen.
staticByteArrayOutputStreamsys_exec( Stringexec ) {
if( exec.length() == 0 ) returnnull; // Vaciously works for empty commands
Processp = null;
StreamEatererr = null, out = null;
// This try/catch block will dump any output from the process before make dies
try {
// This try/catch block will catch any I/O errors and turn them into BuildErrors
try {
p = Runtime.getRuntime().exec(exec);
err = newStreamEater(p.getErrorStream());
out = newStreamEater(p.getInputStream());
intstatus = p.waitFor();
if( status != 0 )
thrownewBuildError("Status "+status+" from "+exec);
out.close(); // catch runaway thread
err.close(); // catch runaway thread
} catch( IOExceptione ) {
thrownewBuildError("IOException from "+exec);
} catch( InterruptedExceptione ) {
thrownewBuildError("Interrupted while waiting on "+exec);
} finally {
if( p != null ) p.destroy(); // catch runaway process
}
} catch( BuildErrorbe ) {
// Build-step choked. Dump any output
System.out.println();
if( out != null ) try { out._buf.writeTo(System.out); } catch( IOExceptione ) { thrownewBuildError(e.toString()); }
if( err != null ) try { err._buf.writeTo(System.out); } catch( IOExceptione ) { thrownewBuildError(e.toString()); }
throwbe;
}
returnout._buf; // No errors? Then here is the buffered output
}
// --- A dependency --------------------------------------------------------
staticprivateclassQ {
// A table of all dependencies & target files in the world
staticConcurrentHashMap<String,Q> FILES = newConcurrentHashMap<String,Q>();
// Basic definition of a dependency
finalString_target;
finalQ[] _srcs; // Array of dependent files
finalchar_src_sep;
// These next fields are filled in lazily, as needed.
String_flat_src;
File_dst; // Actual OS file
// I assume that calling lastModified() is a modestly expensive OS call.
// I *know* that some OS's report file timestamps rounded down badly, to
// the nearest 1 second on linux.
long_modtime; // Cache of _dst.lastModified() (or System.CTM for -n builds)
// --- Constructor for a root file; no dependencies
staticfinalprivateQ[] NONE = newQ[0];
Q( Stringtarget ) {
_target = target;
_src_sep = ' ';
_srcs = NONE;
init();
}
// --- Constructor for a single dependency
Q( Stringtarget, Qsrc ) {
_target = target;
_src_sep = ' ';
_srcs = newQ[1];
_srcs[0] = src;
init();
}
// --- Constructor for a list of source dependencies
Q( Stringtarget, charsrc_sep, Q[] srcs ) {
_target = target;
_src_sep = src_sep;
_srcs = srcs;
init();
}
finalprivatevoidinit() {
// Basic sanity checking
if( _target.indexOf('%') != -1 )
thrownewIllegalArgumentException("dependency target has a '%': "+_target);
// Install the target/dependency mapping in a flat table
if( FILES.put(_target,this) != null )
thrownewIllegalArgumentException("More than one dependency for target "+_target);
}
Stringflat_src( charsep ) {
Strings = "";
if( _srcs.length==0 ) returns;
for( inti=0; i<_srcs.length-1; i++ )
s += TOP_PATH_SLASH+"/"+_srcs[i]._target+sep;
s += TOP_PATH_SLASH+"/"+_srcs[_srcs.length-1]._target;
returns;
}
// Report latest source file mod time.
finallonglatest() {
longl = 0;
for( inti=0; i<_srcs.length; i++ )
if( l < _srcs[i]._modtime )
l = _srcs[i]._modtime;
returnl;
}
// The void 'do_it' function, with no output
protectedByteArrayOutputStreamdo_it( ) {
returnnull;
}
// --- make
// Run the 'exec' string if the source file is more recent than the target file.
// Return true if the target file (apparently) got updated.
// File times are maintained *very* coarsely by some OS's: linux rounds down to 1 sec
finalbooleanmake() {
// See if we are already up-to-date. We do it when we first back the
// target string with an OS file. Must check before recursion, or else
// a DAG takes exponentional time.
if( _dst != null )
returnfalse;
// Back target string with an OS file.
_dst = newFile(TOP,_target);
_modtime = _dst.lastModified(); // Cache OS time
_flat_src = flat_src(','); // Prep, in case we need to print any errors
// Recursively make required files
booleananychanges = false;
booleanerror = false;
for( inti=0; i<_srcs.length; i++ ) { // For all targets
try {
if( _srcs[i].make() ) // Build target
anychanges = true; // Record if something changed
} catch( BuildErrore ) { // Catch build errors!
if( !_keepontrucking ) throwe; // Die at first error
error = true; // Else just print and keep going
System.err.println(e);
}
}
if( error ) // Die now, if we had any errors building children
thrownewBuildError("Some build errors");
// Cleaning? Nuke target and return
if( _clean ) {
if( _srcs.length == 0 ) returnfalse; // Do not remove source files
if( !_dst.exists() ) returnfalse; // Already removed
System.out.println("rm "+_target);
if( !_justprint ) _dst.delete();
returntrue;
}
if( _srcs.length==0 && _modtime==0 )
thrownewBuildError("Source file "+_target+" does not exist");
// Now see if we are later or earlier
longlast_src = latest();
if( _modtime >= last_src ) {
if( _verbose ) System.out.println(_target+ " > {" +_flat_src + "} : already up to date");
returnfalse; // Update-to-date, nothing changed
}
// Files out of date; must do this build step
if( _verbose ) System.out.println(_target+ " <= {"+_flat_src+"}");
// Actually do the build-step
try {
do_it();
} catch( BuildErrorbe ) {
if( this != _build_c ) // Highly annoying to delete own class file
_dst.delete(); // Failed; make sure target is deleted (except for build.class)
throwbe;
} finally {
System.out.println();
}
if( _justprint ) { // No expectation of any change
_modtime = last_src+1; // Force modtime update
returntrue;
}
// Double-check that the source files were not modified by the
// build-step. It's a fairly common error if file-names get swapped,
// etc. This exception is uncaught, so it aborts everything. It
// basically indicate a broken build file - the build-step is changing
// the wrong file.
for( inti=0; i<_srcs.length; i++ )
if( _srcs[i]._modtime != _srcs[i]._dst.lastModified() )
thrownewIllegalArgumentException("Timestamp for source file "+_srcs[i]._target+
" apparently changed by building "+_target+
" last recorded time="+_srcs[i]._modtime+
" and now the filesystem reports="+_srcs[i]._dst.lastModified());
// Double-check that this step made progress. Again, failure here is
// likely a build-step failure to modify the correct file.
longx = _dst.lastModified();
if( _modtime == x )
thrownewIllegalArgumentException("Timestamp for "+_target+" not changed by building "+_target);
_modtime = x;
longnow = System.currentTimeMillis();
if( now < _modtime )
thrownewIllegalArgumentException("Timestamp for "+_target+" moving into the future by building. _modtime="+_modtime+" and now="+now );
if( _modtime < last_src )
thrownewIllegalArgumentException("Timestamp for "+_target+" not changed by building "+_target);
// Invariant: last_src <= _modtime <= now
// For very fast build-steps, the target may be updated to a time equal
// to the input file times after rounding to the file-system's time
// precision - which might be as bad as 1 whole second. Assume the
// build step worked, but give the result an apparent time just past the
// src file times to make later steps more obvious.
if( !_allow_timestamp_ties ) {
while( x == last_src ) { // Aaahh, we have 'tied' in the timestamps!!!
// Sleep/spin until the OS's version of a rounded timestamp shows real progress
try { Thread.sleep(1); } catch( InterruptedExceptione ) { };
now = System.currentTimeMillis();
_dst.setLastModified(now); // Pretend file was made 'right NOW!'
x = _dst.lastModified(); // Reload, after OS rounding
}
if( _modtime == last_src )
System.out.println("Yawners... had to sleep "+(System.currentTimeMillis()-_modtime)+" msec to get timestamp to advance");
}
_modtime = x; // Record apparent mod-time
returntrue;
}
};
// --- A dependency with an exec string ------------------------------------
// Mostly just a normal dependency; it "execs" a String to do the build-step.
staticprivateclassQSextendsQ {
finalString_exec;
String_parsed_exec;
QS( Stringtarget, Stringexec, Qsrc ) {
super(target,src);
_exec = exec;
init();
}
// --- Constructor for a list of source dependencies
QS( Stringtarget, Stringexec, charsrc_sep, Q ... srcs ) {
super(target, src_sep,srcs);
_exec = exec;
init();
}
privatefinalvoidinit() {
for( inti=_exec.indexOf('%'); i!= -1; i = _exec.indexOf('%',i+1) ) {
if( false ) {
} elseif( _exec.startsWith("dst",i+1) ) {
} elseif( _exec.startsWith("src",i+1) ) {
} elseif( _exec.startsWith("top",i+1) ) {
} else
thrownewIllegalArgumentException("dependency exec has unknown pattern: "+_exec.substring(i));
}
}
// --- parse_exec
// The _exec String contains normal text, plus '%src' and '%dst' strings.
Stringparse_exec() {
if( _parsed_exec == null )
_parsed_exec = _exec
.replaceAll("%dst",TOP_PATH_SLASH+"/"+_target)
.replaceAll("%src0",_srcs[0]._target)
.replaceAll("%src",flat_src(_src_sep))
.replaceAll("%top",TOP_PATH_SLASH);
return_parsed_exec;
}
protectedByteArrayOutputStreamdo_it( ) {
Stringexec = parse_exec();
System.out.print(exec);
return_justprint ? null : sys_exec(exec);
}
}
// --- A dependency for a JUnit test ---------------------------------------
// Mostly just a normal dependency, except it writes the testing output
// to a log file.
staticprivateclassQ_JUnitextendsQS {
finalString_base;
Q_JUnit( Stringbase, Stringexec, Qclazzfile, Qjunitclazzfile ) {
super(base+".log",exec,' ',clazzfile,junitclazzfile);
_base = base;
}
protectedByteArrayOutputStreamdo_it( ) {
ByteArrayOutputStreamout = super.do_it();
// If we can 'do_it' with no errors, then dump the output to a base.log file
if( _justprint ) returnout;
try {
Filef = newFile(TOP_PATH_SLASH+"/"+_base+".log");
FileOutputStreamlog = newFileOutputStream(f);
out.writeTo(log);
log.close();
System.out.print(" > "+f.getCanonicalPath());
} catch( FileNotFoundExceptione ) {
thrownewBuildError("Unable to create file "+_base+".log, "+e.toString());
} catch( IOExceptione ) {
thrownewBuildError("Error while file "+_base+".log, "+e.toString());
}
returnout;
}
}
// --- A dependency, just 'touch'ing the target ----------------------------
// Mostly just a normal dependency
staticprivateclassQ_touchextendsQ {
Q_touch( Stringtarget, Q ... srcs ) { super(target,' ',srcs); }
protectedByteArrayOutputStreamdo_it( ) {
System.out.print("touch "+_target);
if( _justprint ) returnnull;
Filef = newFile(TOP_PATH_SLASH+"/"+_target);
try {
f.delete();
f.createNewFile();
// You would think that to delete & create the file would update the
// lastMod time accurately, but on linux at least it appears it can be
// created at least 1 msec in the past.
longt = System.currentTimeMillis();
f.setLastModified(t);
} catch( IOExceptione ) {
thrownewBuildError("Unable to make file "+_target+": "+e.toString());
}
returnnull; // No output from a 'touch'
}
}
// --- A dependency, doing a global string replace -------------------------
// Mostly just a normal dependency, except the build action is to copy
// NonBlockingHashMap.java into NonBlockingHashtable.java - substituting the
// class name and changing the parent 'extends' clause from AbstractMap to
// Dictionary. This is because the same source file can be used for both
// Hashtable and HashMap - except they extend different parent classes.
staticprivateclassQ_hashtableextendsQ {
Q_hashtable( Stringtarget, Qsrc ) { super(target,src); }
protectedByteArrayOutputStreamdo_it( ) {
System.out.print("s/NonBlockingHashMap/NonBlockingHashtable/g "+_srcs[0]._target+" > "+_target);
if( _justprint ) returnnull;
try {
// Inhale NBHM.java
FileInputStreambits = newFileInputStream(_srcs[0]._dst);
byte[] buf = newbyte[100000];
intlen = bits.read(buf);
if( len < 1000 || len == buf.length )
thrownewIOException("Unexpected file length read, "+len+" bytes read from "+_srcs[0]._target);
// Do some string replacement stuff
Strings = newString(buf,0,len);
Stringt = s.replaceAll("NonBlockingHashMap","NonBlockingHashtable");
Stringu = t.replaceAll("AbstractMap","Dictionary");
Stringv = u.replaceAll("\npackage","\n/* WARNING: MACHINE GENERATED FILE! DO NOT EDIT!*/\npackage");
byte[] outbuf = v.getBytes();
// Write out the replacement
_dst.delete(); // Nuke output file first
FileOutputStreamout = newFileOutputStream(_dst);
out.write(outbuf);
out.close();
} catch( IOExceptione ) {
thrownewBuildError("Unable to make file "+_target+": "+e.toString());
}
returnnull; // No output from a 'touch'
}
}
// =========================================================================
// --- The Dependencies ----------------------------------------------------
// =========================================================================
// Some common strings
staticfinalStringjavac = "javac -cp %top %src";
// The build-self dependency every project needs
staticfinalQ_build_j = newQ("build.java");
staticfinalQ_build_c = newQS("build.class","javac %src",_build_j);
// The High Scale Lib java files
staticfinalStringHSL = "org/cliffc/high_scale_lib";
staticfinalQ_absen_j = newQ(HSL+"/AbstractEntry.java");
staticfinalQ_cat_j = newQ(HSL+"/ConcurrentAutoTable.java");
staticfinalQ_cntr_j = newQ(HSL+"/Counter.java");
staticfinalQ_nbhm_j = newQ(HSL+"/NonBlockingHashMap.java");
staticfinalQ_nbhml_j = newQ(HSL+"/NonBlockingHashMapLong.java");
staticfinalQ_nbhmid_j= newQ(HSL+"/NonBlockingIdentityHashMap.java");
staticfinalQ_nbhs_j = newQ(HSL+"/NonBlockingHashSet.java");
staticfinalQ_nbsi_j = newQ(HSL+"/NonBlockingSetInt.java");
staticfinalQ_unsaf_j = newQ(HSL+"/UtilUnsafe.java");
// The High Scale Lib class files
staticfinalQ_absen_cls = newQS(HSL+"/AbstractEntry.class" , javac, _absen_j);
staticfinalQ_cat_cls = newQS(HSL+"/ConcurrentAutoTable.class" , javac, _cat_j );
staticfinalQ_cntr_cls = newQS(HSL+"/Counter.class" , javac, _cntr_j );
staticfinalQ_nbhm_cls = newQS(HSL+"/NonBlockingHashMap.class" , javac, _nbhm_j );
staticfinalQ_nbhml_cls = newQS(HSL+"/NonBlockingHashMapLong.class", javac, _nbhml_j);
staticfinalQ_nbhmid_cls= newQS(HSL+"/NonBlockingIdentityHashMap.class", javac, _nbhmid_j );
staticfinalQ_nbhs_cls = newQS(HSL+"/NonBlockingHashSet.class" , javac, _nbhs_j );
staticfinalQ_nbsi_cls = newQS(HSL+"/NonBlockingSetInt.class" , javac, _nbsi_j );
staticfinalQ_unsaf_cls = newQS(HSL+"/UtilUnsafe.class" , javac, _unsaf_j);
// The testing files. JUnit output is in a corresponding .log file.
staticfinalStringTNBHM = "Testing/NBHM_Tester";
staticfinalStringJUNIT = "%top/lib/junit-4.4.jar";
staticfinalStringjavac_junit = "javac -cp %top"+File.pathSeparatorChar+JUNIT+" %src";
staticfinalStringjava_junit = "java -ea -cp %top"+File.pathSeparatorChar+JUNIT+" ";
staticfinalQ_tnbhm_j = newQ(TNBHM+"/NBHM_Tester2.java");
staticfinalQ_tnbhm_cls = newQS(TNBHM+"/NBHM_Tester2.class",javac_junit, _tnbhm_j);
staticfinalQ_tnbhm_tst = newQ_JUnit(TNBHM+"/NBHM_Tester2", java_junit+"Testing.NBHM_Tester.NBHM_Tester2", _nbhm_cls,_tnbhm_cls);
staticfinalQ_tnbhml_j = newQ(TNBHM+"/NBHML_Tester2.java");
staticfinalQ_tnbhml_cls= newQS(TNBHM+"/NBHML_Tester2.class",javac_junit,_tnbhml_j);
staticfinalQ_tnbhml_tst= newQ_JUnit(TNBHM+"/NBHML_Tester2", java_junit+"Testing.NBHM_Tester.NBHML_Tester2",_nbhml_cls,_tnbhml_cls);
staticfinalQ_tnbhmid_j =newQ(TNBHM+"/NBHMID_Tester2.java");
staticfinalQ_tnbhmid_cls=newQS(TNBHM+"/NBHMID_Tester2.class",javac_junit,_tnbhmid_j);
staticfinalQ_tnbhmid_tst=newQ_JUnit(TNBHM+"/NBHMID_Tester2", java_junit+"Testing.NBHM_Tester.NBHMID_Tester2",_nbhmid_cls,_tnbhmid_cls);
staticfinalStringTNBHS = "Testing/NBHS_Tester";
staticfinalQ_tnbhs_j = newQ(TNBHS+"/nbhs_tester.java");
staticfinalQ_tnbhs_cls = newQS(TNBHS+"/nbhs_tester.class",javac_junit, _tnbhs_j);
staticfinalQ_tnbhs_tst = newQ_JUnit(TNBHS+"/nbhs_tester", java_junit+"Testing.NBHS_Tester.nbhs_tester",_nbhs_cls, _tnbhs_cls);
staticfinalQ_tnbsi_j = newQ(TNBHS+"/nbsi_tester.java");
staticfinalQ_tnbsi_cls = newQS(TNBHS+"/nbsi_tester.class",javac_junit, _tnbsi_j);
staticfinalQ_tnbsi_tst = newQ_JUnit(TNBHS+"/nbsi_tester", java_junit+"Testing.NBHS_Tester.nbsi_tester", _nbsi_cls,_tnbsi_cls);
staticfinalStringCTNBQ = "contrib/Testing/NBQ_Tester";
staticfinalQ_ctnbq_j = newQ(CTNBQ+"/NBQ_Tester.java");
staticfinalQ_ctnbq_cls = newQS(CTNBQ+"/NBQ_Tester.class",javac_junit, _ctnbq_j);
staticfinalQ_ctnbq_tst = newQ_JUnit(CTNBQ+"/NBQ_Tester", java_junit+"contrib.Testing.NBQ_Tester.NBQ_Tester",_ctnbq_cls, _ctnbq_cls);
// The high-scale-lib.jar file. Demand JUnit testing in addition to class
// files (the testing demands the relavent class files).
staticfinalQ_hsl_jar = newQS("lib/high-scale-lib.jar","jar -cf %dst "+HSL,' ',
_absen_cls, _cat_cls, _cntr_cls, _tnbhm_tst, _tnbhml_tst, _tnbhmid_tst, _tnbhs_tst, _tnbsi_tst, _ctnbq_tst,_unsaf_cls );
// Wrappers for common JDK files
staticfinalStringJU = "java/util";
staticfinalQ_nbht_j = newQ_hashtable(HSL+"/NonBlockingHashtable.java", _nbhm_j);
staticfinalQ_nbht_cls= newQS(HSL+"/NonBlockingHashtable.class", javac, _nbht_j);
staticfinalQ_ht_j = newQ (JU+"/Hashtable.java");
staticfinalQ_ht_cls = newQS(JU+"/Hashtable.class", "javac -cp %top %top/%src0", ' ', _ht_j, _nbht_cls);
staticfinalQ_ht_jar = newQS("lib/java_util_hashtable.jar","jar -cf %dst -C %top %src0 -C %top "+HSL,' ',_ht_cls,_hsl_jar);
staticfinalStringJUC = JU+"/concurrent";
staticfinalQ_chm_j = newQ (JUC+"/ConcurrentHashMap.java");
staticfinalQ_chm_cls = newQS(JUC+"/ConcurrentHashMap.class", javac, _chm_j);
staticfinalQ_chm_jar = newQS("lib/java_util_concurrent_chm.jar","jar -cf %dst -C %top %src0 -C %top "+HSL,' ',_chm_cls,_hsl_jar);
staticfinalQ_libs= newQ_touch("libs", _hsl_jar, _ht_jar, _chm_jar );
// The High Scale Lib javadoc files
staticfinalQ_docs = newQS("doc/index.html","javadoc -quiet -classpath %top -d %top/doc -package -link http://java.sun.com/j2se/1.5.0/docs/api %src",' ',_absen_j,_cat_j,_cntr_j,_nbhm_j,_nbht_j,_nbhml_j,_nbhmid_j,_nbhs_j,_nbsi_j,_unsaf_j);
// Build everything
staticfinalQ_all = newQ_touch("all", _docs, _libs);
}