global $addon; $context = $addon->callHook('context'); $work_dir = $addon->callHook('babel_working'); require dirname(__FILE__) . "/../system/dbconnection.class.php"; require dirname(__FILE__) . "/../system/feature.class.php"; $dbc = new DBConnection(); $dbh = $dbc->connect(); $work_context_dir = $work_dir . $context . "_site/"; $tmp_dir = $work_context_dir . "tmp/"; $output_dir = $work_context_dir . "output/"; $sites_dir = $work_context_dir . "sites/"; exec("rm -rf {$work_context_dir}*"); exec("mkdir -p {$output_dir}"); exec("mkdir -p {$sites_dir}"); //iterate over all the release trains foreach (ReleaseTrain::all() as $train) { $features = array(); // create a dedicated folder for each of them exec("mkdir -p {$sites_dir}/{$train->id}"); // create the output folder for temporary artifacts $output_dir_for_train = "{$output_dir}/{$train->id}/"; // iterate over each language foreach (Language::all() as $lang) { // create a new feature object $feature = new Feature($lang, $train, $tmp_dir, $output_dir_for_train); // make it generate itself $feature->generateAll(); $feature->jar(); $features[] = $feature; } $site = fopen("{$output_dir_for_train}/eclipse/site.xml", "w");
public function itShouldLoadAllTheReleaseTrains() { $train_result = mysql_query("SELECT DISTINCT train_id FROM release_train_projects"); $all = ReleaseTrain::all(); $this->spec(count($all))->should->equal(mysql_num_rows($train_result)); }