00001 <? 00002 00003 function fflat($a) 00004 { 00005 return '"' . implode($a, '" "') . '"'; 00006 } 00007 00008 function outdated($target, $source) 00009 { 00010 return !file_exists($target) || filemtime($source) > filemtime($target); 00011 } 00012 00013 function cmd($str) 00014 { 00015 print("$str\n"); flush(); 00016 passthru($str); 00017 } 00018 00019 $files = array("ActionButton", "AppointmentEditor", "AppointmentList", "Appointments", "Base64", "ConnectionFactory", "DoctorDb", "DoctorSelect", "Diagnosis", "DiagnosisEditor", "DiagnosisList", "Form", "Home", "Page", "PatientEditor", "PatientList", "Patients", "PatientSelect", "PolicySelect", "Query", "Referral", "ReferralEditor", "ReferralList", "SelectBox", "ServicesSelect", "TableEditor", "Tables", "TextBox", "Widget"); 00020 00021 $mls = array(); 00022 00023 foreach($files as $f) 00024 { 00025 if (outdated("$f.java", "$f.mls")) 00026 $mls[] = "$f.mls"; 00027 } 00028 00029 if (count($mls) > 0) 00030 cmd("java com.sdi.tools.mls.Main " . fflat($mls)); 00031 00032 $javac = array(); 00033 00034 foreach($files as $f) 00035 { 00036 if (outdated("$f.class", "$f.java")) 00037 $javac[] = "$f.java"; 00038 } 00039 00040 if (count($javac) > 0) 00041 cmd("javac " . fflat($javac)); 00042 00043 ?>