diff --git a/build/bump.php b/build/bump.php index 69212ec12d41f..fbfc4befa6102 100644 --- a/build/bump.php +++ b/build/bump.php @@ -59,13 +59,14 @@ function usage($command) $antJobFile = '/build.xml'; +$packageJsonFile = '/package.json'; + $readMeFiles = [ '/README.md', '/README.txt', ]; /* - * Change copyright date exclusions. * Some systems may try to scan the .git directory, exclude it. * Also exclude build resources such as the packaging space or the API documentation build * as well as external libraries. @@ -245,6 +246,13 @@ function usage($command) file_put_contents($rootPath . $antJobFile, $fileContents); } +// Updates the version in the package.json file. +if (file_exists($rootPath . $packageJsonFile)) { + $fileContents = file_get_contents($rootPath . $packageJsonFile); + $fileContents = preg_replace('#"version": "[^ ]*"#', '"version": "' . $version['release'] . '"', $fileContents); + file_put_contents($rootPath . $packageJsonFile, $fileContents); +} + // Updates the version in readme files. foreach ($readMeFiles as $readMeFile) { if (file_exists($rootPath . $readMeFile)) {