Skip to content

Commit

Permalink
Fixing scoped build (#1143)
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik authored Nov 4, 2021
1 parent 444cbd2 commit f8e0477
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/build_scoped_rector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ jobs:
COMPOSER_TOKEN: ${{ secrets.ACCESS_TOKEN }}

# install only prod dependencies - do not use ramsey, it uses cache including "dev", we want to avoid it here
- run: composer install --no-dev --ansi
# somehow psr/http-message needed now when downgrading ssch/typo3-rector
- run: |
composer require psr/http-message
composer update --no-dev --ansi
# early downgrade individual functions
- run: bin/rector process src/functions -c build/config/config-downgrade.php --ansi
Expand Down
2 changes: 1 addition & 1 deletion build/config/config-downgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Rector\DowngradePhp72\Rector\ClassMethod\DowngradeParameterTypeWideningRector;
use Rector\NodeNameResolver\Contract\NodeNameResolverInterface;
use Rector\Set\ValueObject\DowngradeLevelSetList;
use Rector\Set\ValueObject\DowngradeSetList;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\StyleInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
Expand Down Expand Up @@ -64,6 +63,7 @@
\Symplify\RuleDocGenerator\Contract\Category\CategoryInfererInterface::class,
\PhpParser\PrettyPrinterAbstract::class,
\Helmich\TypoScriptParser\Parser\Traverser\Visitor::class,
\Symplify\SymplifyKernel\Contract\LightKernelInterface::class,
],
DowngradeParameterTypeWideningRector::SAFE_TYPES_TO_METHODS => [
ContainerInterface::class => [
Expand Down
22 changes: 20 additions & 2 deletions full_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,30 @@ set -e
# script fails if trying to access to an undefined variable
set -u

# clean up
rm -rf rector-build
rm -rf rector-prefixed-downgraded
rm -rf composer.lock
rm -rf vendor
composer clear-cache


composer install --no-dev --ansi
# somehow needed now when downgrading ssch/typo3-rector
composer require psr/http-message
composer update --no-dev --ansi

rsync --exclude rector-build -av * rector-build --quiet

# back to original composer.json
git checkout composer.json

rm -rf rector-build/packages-tests rector-build/rules-tests rector-build/tests

sh build/downgrade-rector.sh rector-build
sh build/build-rector-scoped.sh rector-build rector-prefixed-downgraded

cd rector-prefixed-downgraded
cp ../build/target-repository/bootstrap.php .
cp ../preload.php .
bin/rector list --ansi && cd ..

rm -rf rector-prefixed-downgraded
4 changes: 3 additions & 1 deletion utils/compiler/src/Command/DowngradePathsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
'vendor/symfony/dependency-injection',
'vendor/symfony/console',
'vendor/symfony vendor/psr',
'vendor/symplify vendor/nikic vendor/ssch bin src packages rector.php',
'vendor/symplify vendor/nikic src packages',
'vendor/ssch',
'rules',
'bin rector.php',
], $downgradePaths);

if (file_exists(getcwd() . '/vendor/phpstan/phpstan-extracted/vendor')) {
Expand Down

0 comments on commit f8e0477

Please sign in to comment.