dev/src/ReleaseBuilder/ReleaseBuilder.php
private function createReleaseNotes(array $release)
    {
        $buildDir = $this->rootPath .'/build';
        $locationTemplate = $buildDir . '/release-%s.md';

        if (!is_dir($buildDir)) {
            mkdir($buildDir);
        }

        $umbrella = $release[self::DEFAULT_COMPONENT];
        $location = sprintf($locationTemplate, $umbrella['version']);

        unset($release[self::DEFAULT_COMPONENT]);

        ksort($release);

        $notes = [];
        foreach ($release as $key => $component) {
            $messages = [];
            foreach ($component['messages'] as $message) {
                $messages[] = sprintf('* %s', $message);
            }

            $notes[] = sprintf('### google/%s v%s', $key, $component['version'])
                . PHP_EOL . PHP_EOL . implode(PHP_EOL, $messages);
        }

        $template = file_get_contents(__DIR__ .'/templates/release-notes.md.txt');
        $template = str_replace('{version}', $umbrella['version'], $template);
        $template = str_replace('{notes}', implode(PHP_EOL . PHP_EOL, $notes), $template);

        file_put_contents($location, $template);

        return $location;
    }
private function createReleaseNotes(array $release)
    {
        $buildDir = $this->rootPath .'/build';
        $locationTemplate = $buildDir . '/release-%s.md';

        if (!is_dir($buildDir)) {
            mkdir($buildDir);
        }

        $umbrella = $release[self::DEFAULT_COMPONENT];
        $location = sprintf($locationTemplate, $umbrella['version']);

        unset($release[self::DEFAULT_COMPONENT]);

        ksort($release);

        $notes = [];
        foreach ($release as $key => $component) {
            $messages = [];
            foreach ($component['messages'] as $message) {
                $messages[] = sprintf('* %s', $message);
            }

            $notes[] = sprintf('### google/%s v%s', $key, $component['version'])
                . PHP_EOL . PHP_EOL . implode(PHP_EOL, $messages);
        }

        $template = file_get_contents(__DIR__ .'/templates/release-notes.md.txt');
        $template = str_replace('{version}', $umbrella['version'], $template);
        $template = str_replace('{notes}', implode(PHP_EOL . PHP_EOL, $notes), $template);

        file_put_contents($location, $template);

        return $location;
    }
private function createReleaseNotes ( array $ release ) { $ buildDir = $ this -> rootPath . '/build' ; $ locationTemplate = $ buildDir . '/release-%s.md' ; if ( ! is_dir ( $ buildDir ) ) { mkdir ( $ buildDir ) ; } $ umbrella = $ release [ self :: DEFAULT_COMPONENT ] ; $ location = sprintf ( $ locationTemplate , $ umbrella [ 'version' ] ) ; unset ( $ release [ self :: DEFAULT_COMPONENT ] ) ; ksort ( $ release ) ; $ notes = [ ] ; foreach ( $ release as $ key => $ component ) { $ messages = [ ] ; foreach ( $ component [ 'messages' ] as $ message ) { $ messages [ ] = sprintf ( '* %s' , $ message ) ; } $ notes [ ] = sprintf ( '### google/%s v%s' , $ key , $ component [ 'version' ] ) . PHP_EOL . PHP_EOL . implode ( PHP_EOL , $ messages ) ; } $ template = file_get_contents ( __DIR__ . '/templates/release-notes.md.txt' ) ; $ template = str_replace ( '{version}' , $ umbrella [ 'version' ] , $ template ) ; $ template = str_replace ( '{notes}' , implode ( PHP_EOL . PHP_EOL , $ notes ) , $ template ) ; file_put_contents ( $ location , $ template ) ; return $ location ; }
Build a release notes markdown file.

@param array $release An associative array, where the key is the
component ID and the value is structured data describing the
release.
@return void
Build a release notes markdown file .