示例#1
0
function main()
{
    BoostSiteTools\CommandLineOptions::parse(NEW_LIBRARIES_USAGE);
    $libraries = BoostLibraries::load();
    $master = $libraries->get_for_version('master');
    $unreleased_libs = array();
    foreach ($master as $lib) {
        if ($lib['boost-version']->is_unreleased()) {
            $unreleased_libs[$lib['name']] = $lib;
        }
    }
    if ($unreleased_libs) {
        ksort($unreleased_libs, SORT_NATURAL | SORT_FLAG_CASE);
        $count = count($unreleased_libs);
        echo "For release notes:\n\n";
        echo "[section New Libraries]\n\n";
        foreach ($unreleased_libs as $lib) {
            echo "* [phrase library..[@/{$lib['documentation']} {$lib['name']}]:]\n";
            echo "  {$lib['description']}\n\n";
        }
        echo "[endsection]\n\n";
    } else {
        echo "No new libraries yet.\n";
    }
}
function main()
{
    $options = BoostSiteTools\CommandLineOptions::parse(SET_RELEASE_STATUS_USAGE);
    if (!count($options->positional)) {
        echo $options->usage_message();
        exit(1);
    }
    $version = BoostVersion::from($options->positional[0]);
    $releases = new BoostReleases(__DIR__ . '/../generated/state/release.txt');
    $releases->setReleaseStatus($version, 'released');
    $releases->save();
}
function main()
{
    $options = BoostSiteTools\CommandLineOptions::parse(LOAD_RELEASE_DATA_USAGE);
    if (count($options->positional) != 1) {
        echo $options->usage_message();
        exit(1);
    }
    $path = realpath($options->positional[0]);
    if (!$path) {
        echo "Unable to find release file: {$options->positional[0]}\n";
        exit(1);
    }
    $release_details = file_get_contents($path);
    if (!$release_details) {
        echo "Error reading release file: {$options->positional[0]}\n";
        exit(1);
    }
    $releases = new BoostReleases(__DIR__ . '/../generated/state/release.txt');
    $releases->loadReleaseInfo($release_details);
    $releases->save();
}
示例#4
0
function main()
{
    $options = BoostSiteTools\CommandLineOptions::parse("Usage: {} location version");
    if (count($options->positional) != 2) {
        echo $options->usage_message();
        exit(1);
    }
    $location = $options->positional[0];
    $version = $options->positional[1];
    $libraries = BoostLibraries::from_xml_file(__DIR__ . '/../doc/libraries.xml');
    $unknown_libs = array();
    $maintainers = BoostMaintainers::read_from_text(file($location . '/libs/maintainers.txt'));
    // TODO: Want to include hidden libraries here.
    $library_details = $libraries->get_for_version($version, null);
    $libs_index = array();
    foreach ($library_details as $index => $details) {
        if (isset($details['maintainers'])) {
            $maintainers->update_maintainer($details['key'], $details['maintainers']);
        }
    }
    file_put_contents($location . '/libs/maintainers.txt', $maintainers->write_to_text());
}
function main()
{
    BoostSiteTools\CommandLineOptions::parse();
    $path = realpath(STATIC_DIR);
    if (!$path || !is_dir($path)) {
        echo "Unable to find documentation directory\n";
        exit(1);
    }
    $releases = new BoostReleases(__DIR__ . '/../generated/state/release.txt');
    foreach (new DirectoryIterator(STATIC_DIR) as $dir) {
        if ($dir->isDot()) {
            continue;
        }
        $name = $dir->getFilename();
        if ($name == 'develop' || $name == 'master') {
            // Store this somewhere?
        } else {
            if (preg_match('@^boost_[0-9_]+$@', $name)) {
                $releases->addDocumentation(BoostVersion::from($name), "/doc/libs/{$name}");
            }
        }
    }
    $releases->save();
}
function main()
{
    global $quiet;
    $options = BoostSiteTools\CommandLineOptions::parse(UPDATE_DOC_LIST_USAGE, array('quiet' => false));
    $quiet = $options->flags['quiet'];
    $location = null;
    $version = null;
    switch (count($options->positional)) {
        case 2:
            $version = $options->positional[1];
        case 1:
            $location = $options->positional[0];
        case 0:
            break;
        default:
            echo $options->usage_message();
            exit(1);
    }
    if ($version) {
        // BoostVersion dies if version is invalid.
        $version = BoostVersion::from($version);
    }
    $libs = BoostLibraries::from_xml_file(dirname(__FILE__) . '/../doc/libraries.xml');
    $updates = array();
    if ($location) {
        $real_location = realpath($location);
        if ($real_location && !is_dir($real_location)) {
            echo "Not a directory: {$location}\n";
            exit(1);
        }
        $location = $real_location;
        // If this is not a git repo.
        // TODO: Don't output stderr.
        exec("cd \"{$location}\" && git rev-parse --git-dir", $output, $return_var);
        if ($return_var != 0) {
            if (!$version || !$version->is_numbered_release()) {
                echo "Error: Release version required for release.\n";
                exit(1);
            }
            $updates[(string) $version] = read_metadata_from_filesystem($location, $version);
        } else {
            if (get_bool_from_array(BoostSuperProject::run_process("cd '{$location}' && git rev-parse --is-bare-repository"))) {
                if ($version) {
                    $updates[(string) $version] = read_metadata_from_git($location, $version);
                } else {
                    $updates[(string) 'master'] = read_metadata_from_git($location, 'master');
                    $updates[(string) 'develop'] = read_metadata_from_git($location, 'develop');
                }
            } else {
                // TODO: Could get version from the branch in a git checkout.
                if (!$version) {
                    echo "Error: Version required for local tree.\n";
                    exit(1);
                }
                $updates[(string) $version] = read_metadata_from_filesystem($location, $version);
            }
        }
    }
    if ($updates) {
        foreach ($updates as $update_version => $update) {
            $libs->update($update_version, $update);
        }
    } else {
        $libs->update();
    }
    if (!$quiet) {
        echo "Writing to disk\n";
    }
    file_put_contents(dirname(__FILE__) . '/../doc/libraries.xml', $libs->to_xml());
    $libs->squash_name_arrays();
    file_put_contents(dirname(__FILE__) . '/../generated/libraries.txt', serialize($libs));
}
示例#7
0
#!/usr/bin/env php
<?php 
# Copyright 2007 Rene Rivera
# Copyright 2011, 2015 Daniel James
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
$usage = <<<EOL
Usage: {}

Update the html pages and rss feeds for new or updated quickbook files.
EOL;
require_once __DIR__ . '/../common/code/bootstrap.php';
BoostSiteTools\CommandLineOptions::parse($usage);
$site_tools = new BoostSiteTools(__DIR__ . '/..');
$site_tools->update_quickbook();