Ejemplo n.º 1
0
$genrb = $buildDir . '/bin/genrb';
$genrbEnv = 'LD_LIBRARY_PATH=' . $buildDir . '/lib ';
echo "Using {$genrb}.\n";
$icuVersionInDownload = get_icu_version_from_genrb($genrbEnv . ' ' . $genrb);
echo "Preparing resource bundle compilation (version {$icuVersionInDownload})...\n";
$compiler = new GenrbCompiler($genrb, $genrbEnv);
$config = new GeneratorConfig($sourceDir . '/data', $icuVersionInDownload);
$baseDir = dirname(__DIR__) . '/data';
//$txtDir = $baseDir.'/txt';
$jsonDir = $baseDir;
//$phpDir = $baseDir.'/'.Intl::PHP;
//$resDir = $baseDir.'/'.Intl::RB_V2;
$targetDirs = array($jsonDir);
$workingDirs = array($jsonDir);
//$config->addBundleWriter($txtDir, new TextBundleWriter());
$config->addBundleWriter($jsonDir, new JsonBundleWriter());
echo "Starting resource bundle compilation. This may take a while...\n";
$filesystem->remove($workingDirs);
foreach ($workingDirs as $targetDir) {
    $filesystem->mkdir(array($targetDir . '/' . Intl::CURRENCY_DIR, $targetDir . '/' . Intl::LANGUAGE_DIR, $targetDir . '/' . Intl::LOCALE_DIR, $targetDir . '/' . Intl::REGION_DIR, $targetDir . '/' . Intl::SCRIPT_DIR));
}
// We don't want to use fallback to English during generation
Locale::setDefaultFallback(null);
echo "Generating language data...\n";
$generator = new LanguageDataGenerator($compiler, Intl::LANGUAGE_DIR);
$generator->generateData($config);
//echo "Compiling...\n";
//
//$compiler->compile($txtDir.'/'.Intl::LANGUAGE_DIR, $resDir.'/'.Intl::LANGUAGE_DIR);
echo "Generating script data...\n";
$generator = new ScriptDataGenerator($compiler, Intl::SCRIPT_DIR);