Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3ba662

Browse files
[ci] Fix build-packages.php
1 parent 37e6c1c commit a3ba662

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.github/build-packages.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
<?php
22

33
if (4 > $_SERVER['argc']) {
4-
echo "Usage: branch version dir1 dir2 ... dirN\n";
4+
echo "Usage: branch dir1 dir2 ... dirN\n";
55
exit(1);
66
}
77
chdir(dirname(__DIR__));
88

99
$dirs = $_SERVER['argv'];
1010
array_shift($dirs);
1111
$mergeBase = trim(shell_exec(sprintf('git merge-base %s HEAD', array_shift($dirs))));
12-
$version = array_shift($dirs);
1312

1413
$packages = array();
1514
$flags = PHP_VERSION_ID >= 50400 ? JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE : 0;
@@ -40,7 +39,11 @@
4039
}
4140
passthru("cd $dir && tar -cf package.tar --exclude='package.tar' *");
4241

43-
$package->version = $version.'.999';
42+
if (!isset($package->extra->{'branch-alias'}->{'dev-master'})) {
43+
echo "Missing \"dev-master\" branch-alias in composer.json extra.\n";
44+
exit(1);
45+
}
46+
$package->version = str_replace('-dev', '.999', $package->extra->{'branch-alias'}->{'dev-master'});
4447
$package->dist['type'] = 'tar';
4548
$package->dist['url'] = 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__))."/$dir/package.tar";
4649

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ install:
7373
- if [[ ! $skip && $deps ]]; then echo -e '{\n"require":{'"$(grep phpunit-bridge composer.json)"'"php":"*"},"minimum-stability":"dev"}' > composer.json; fi
7474
- if [[ ! $skip ]]; then COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi
7575
# Create local composer packages for each patched components and reference them in composer.json files when cross-testing components
76-
- if [[ ! $skip && $deps ]]; then php .github/build-packages.php HEAD^ $TRAVIS_BRANCH $COMPONENTS; fi
76+
- if [[ ! $skip && $deps ]]; then php .github/build-packages.php HEAD^ $COMPONENTS; fi
7777
- if [[ ! $skip && $deps ]]; then mv composer.json composer.json.phpunit; mv composer.json.orig composer.json; fi
78-
- if [[ ! $skip && ! $deps ]]; then php .github/build-packages.php HEAD^ $TRAVIS_BRANCH src/Symfony/Bridge/PhpUnit; fi
78+
- if [[ ! $skip && ! $deps ]]; then php .github/build-packages.php HEAD^ src/Symfony/Bridge/PhpUnit; fi
7979
# For the master branch when deps=high, the version before master is checked out and tested with the locally patched components
8080
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//); else SYMFONY_VERSION=$(cat composer.json | grep '^ *"dev-master". *"[1-9]' | grep -o '[0-9.]*'); fi
8181
- if [[ $deps = high && $TRAVIS_BRANCH = master ]]; then git fetch origin $SYMFONY_VERSION; git checkout -m FETCH_HEAD; COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n'); fi

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ install:
4949
- IF NOT EXIST composer.phar (appveyor DownloadFile https://getcomposer.org/download/1.2.1/composer.phar)
5050
- php composer.phar self-update
5151
- copy /Y .composer\* %APPDATA%\Composer\
52-
- php .github/build-packages.php "HEAD^" %APPVEYOR_REPO_BRANCH% src\Symfony\Bridge\PhpUnit
52+
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit
5353
- IF %APPVEYOR_REPO_BRANCH%==master (SET COMPOSER_ROOT_VERSION=dev-master) ELSE (SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev)
5454
- php composer.phar update --no-progress --ansi
5555
- SET COMPOSER_ROOT_VERSION=

0 commit comments

Comments
 (0)