Remove "version" from composer.json files, use "branch-version" instead

This commit is contained in:
Nicolas Grekas 2020-10-07 14:58:11 +02:00
parent 27c22602d6
commit f9ed6940fd
56 changed files with 170 additions and 66 deletions

View File

@ -53,10 +53,11 @@ install:
- IF NOT EXIST composer.phar (appveyor DownloadFile https://github.com/composer/composer/releases/download/1.9.0/composer.phar)
- php composer.phar self-update
- copy /Y .github\composer-config.json %APPDATA%\Composer\config.json
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
- php composer.phar global require --no-progress --no-scripts --no-plugins symfony/flex
- git config --global user.email ""
- git config --global user.name "Symfony"
- php .github/build-packages.php "HEAD^" src\Symfony\Bridge\PhpUnit
- SET COMPOSER_ROOT_VERSION=%APPVEYOR_REPO_BRANCH%.x-dev
- php composer.phar config platform.php 5.5.9
- php composer.phar update --no-progress --no-suggest --ansi
- php phpunit install

View File

@ -50,10 +50,11 @@ foreach ($dirs as $k => $dir) {
passthru("cd $dir && git init && git add . && git commit -q -m - && git archive -o package.tar HEAD && rm .git/ -Rf");
}
if (!isset($package->version)) {
echo "Missing \"version\" in composer.json.\n";
if (!isset($package->extra->{'branch-version'})) {
echo "Missing \"branch-version\" in composer.json's \"extra\".\n";
exit(1);
}
$package->version = substr_replace($package->extra->{'branch-version'}, '.x-dev', -4);
$package->dist['type'] = 'tar';
$package->dist['url'] = 'file://'.str_replace(DIRECTORY_SEPARATOR, '/', dirname(__DIR__))."/$dir/package.tar";
@ -62,8 +63,6 @@ foreach ($dirs as $k => $dir) {
$versions = @file_get_contents('https://repo.packagist.org/p/'.$package->name.'.json') ?: sprintf('{"packages":{"%s":{"%s":%s}}}', $package->name, $package->version, file_get_contents($dir.'/composer.json'));
$versions = json_decode($versions)->packages->{$package->name};
unset($versions->{'dev-master'});
foreach ($versions as $v => $package) {
$packages[$package->name] += array($v => $package);
}

View File

@ -228,7 +228,7 @@ install:
git fetch --depth=2 origin refs/pull/$SYMFONY_PHPUNIT_BRIDGE_PR/head
git rm -rq src/Symfony/Bridge/PhpUnit
git checkout -q FETCH_HEAD -- src/Symfony/Bridge/PhpUnit
export SYMFONY_VERSION=$(cat src/Symfony/Bridge/PhpUnit/composer.json | grep '^ *"version": *"[1-9]' | grep -o '[0-9.]*[0-9]')
export SYMFONY_VERSION=$(cat src/Symfony/Bridge/PhpUnit/composer.json | grep '^ *"branch-version": *"[1-9]' | grep -o '[0-9.]*')
sed -i 's/"symfony\/phpunit-bridge": ".*"/"symfony\/phpunit-bridge": "'$SYMFONY_VERSION'.x@dev"/' composer.json
rm -rf .phpunit
fi
@ -254,7 +254,7 @@ install:
fi
- |
# For the .x branch, when deps=high, the version before .x is checked out and tested with the locally patched components
# For the feature-branch, when deps=high, the version before it is checked out and tested with the locally patched components
if [[ $deps = high && $TRAVIS_BRANCH = *.x ]]; then
export FLIP='🙃'
export SYMFONY_VERSION=$(git ls-remote --heads | grep -o '/[1-9].*' | tail -n 1 | sed s/.//) &&
@ -262,11 +262,11 @@ install:
git checkout -m FETCH_HEAD &&
export COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -printf '%h\n' | sort)
else
export SYMFONY_VERSION=$(cat composer.json | grep '^ *"version". *"[1-9]' | grep -o '[0-9.]*[0-9]')
export SYMFONY_VERSION=$(cat composer.json | grep '^ *"branch-version": *"[1-9]' | grep -o '[0-9.]*')
fi
- |
# Skip the phpunit-bridge on bugfix-only branches when $deps is empty
# Skip the phpunit-bridge on bugfix-branches when $deps is empty
if [[ ! $deps && ! $TRAVIS_BRANCH = *.x ]]; then
export COMPONENTS=$(find src/Symfony -mindepth 3 -type f -name phpunit.xml.dist -not -wholename '*/Bridge/PhpUnit/*' -printf '%h\n' | sort)
fi
@ -285,11 +285,11 @@ install:
else
export SYMFONY_REQUIRE=">=$SYMFONY_VERSION"
fi
composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master
composer global require --no-progress --no-scripts --no-plugins symfony/flex
- |
# Legacy tests are skipped when deps=high and when the current branch version has not the same major version number as the next one
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"version". *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
[[ $deps = high && ${SYMFONY_VERSION%.*} != $(git show $(git ls-remote --heads | grep -FA1 /$SYMFONY_VERSION | tail -n 1):composer.json | grep '^ *"branch-version": *"[1-9]' | grep -o '[0-9]*' | head -n 1) ]] && export LEGACY=,legacy
export COMPOSER_ROOT_VERSION=$SYMFONY_VERSION.x-dev
if [[ $deps ]]; then mv composer.json.phpunit composer.json; fi
@ -312,7 +312,7 @@ install:
fi
tfold 'composer update' $COMPOSER_UP
if [[ $TRAVIS_PHP_VERSION = 5.* ]]; then
tfold 'phpunit install' 'composer global remove symfony/flex && ./phpunit install && composer global require --no-progress --no-scripts --no-plugins symfony/flex dev-master'
tfold 'phpunit install' 'composer global remove symfony/flex && ./phpunit install && composer global require --no-progress --no-scripts --no-plugins symfony/flex'
else
tfold 'phpunit install' ./phpunit install
fi

View File

@ -134,5 +134,7 @@
"files": [ "src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -57,5 +57,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -43,5 +43,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -38,10 +38,10 @@
],
"minimum-stability": "dev",
"extra": {
"branch-version": "3.4-dev",
"thanks": {
"name": "phpunit/phpunit",
"url": "https://github.com/sebastianbergmann/phpunit"
}
},
"version": "3.4.x-dev"
}
}

View File

@ -30,5 +30,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -67,5 +67,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -41,5 +41,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -91,5 +91,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -62,5 +62,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -51,5 +51,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -45,5 +45,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -35,5 +35,7 @@
"symfony/expression-language": "For using the filter option of the log server."
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -32,5 +32,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -33,5 +33,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -42,5 +42,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -32,5 +32,7 @@
"/Tests/"
]
},
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -40,5 +40,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -48,5 +48,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -29,5 +29,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -32,5 +32,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -47,5 +47,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -33,5 +33,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -28,5 +28,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -40,5 +40,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -27,5 +27,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -26,5 +26,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -25,5 +25,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -58,5 +58,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -30,5 +30,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -66,5 +66,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -33,5 +33,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -41,5 +41,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -28,5 +28,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -30,5 +30,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -25,5 +25,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -25,5 +25,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -33,5 +33,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -51,5 +51,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -46,5 +46,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -43,5 +43,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -37,5 +37,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -30,5 +30,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -44,5 +44,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -59,5 +59,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -55,5 +55,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -25,5 +25,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -32,5 +32,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -46,5 +46,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -62,5 +62,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -39,5 +39,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -35,5 +35,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -35,5 +35,7 @@
"psr-4": { "Symfony\\Component\\Workflow\\": "" }
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}

View File

@ -35,5 +35,7 @@
]
},
"minimum-stability": "dev",
"version": "3.4.x-dev"
"extra": {
"branch-version": "3.4-dev"
}
}