@@ -26,6 +26,7 @@ protected function configure(): void
26
26
->addArgument ('source_branch ' , InputArgument::REQUIRED , 'The source branch of recipes ' )
27
27
->addArgument ('flex_branch ' , InputArgument::REQUIRED , 'The branch of the target Flex endpoint ' )
28
28
->addArgument ('output_directory ' , InputArgument::REQUIRED , 'The directory where generated files should be stored ' )
29
+ ->addArgument ('versions_json ' , InputArgument::OPTIONAL , 'The file where versions of Symfony are described ' )
29
30
->addOption ('contrib ' )
30
31
;
31
32
}
@@ -36,13 +37,13 @@ protected function execute(InputInterface $input, OutputInterface $output): int
36
37
$ sourceBranch = $ input ->getArgument ('source_branch ' );
37
38
$ flexBranch = $ input ->getArgument ('flex_branch ' );
38
39
$ outputDir = $ input ->getArgument ('output_directory ' );
40
+ $ versionsJson = $ input ->getArgument ('versions_json ' );
39
41
$ contrib = $ input ->getOption ('contrib ' );
40
42
41
- $ aliases = $ recipes = [];
43
+ $ aliases = $ recipes = $ versions = [];
42
44
43
- if (!$ contrib ) {
44
- $ versions = HttpClient::create ()->request ('GET ' , 'https://flex.symfony.com/versions.json ' )->toArray ();
45
- unset($ versions ['warning ' ]);
45
+ if ($ versionsJson ) {
46
+ $ versions = json_decode (file_get_contents ($ versionsJson ), true );
46
47
47
48
foreach ($ versions ['splits ' ] as $ package => $ v ) {
48
49
if (0 === strpos ($ package , 'symfony/ ' ) && '-pack ' !== substr ($ package , -5 )) {
@@ -90,7 +91,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
90
91
file_put_contents ($ outputDir .'/index.json ' , json_encode ([
91
92
'aliases ' => $ aliases ,
92
93
'recipes ' => $ recipes ,
93
- 'versions ' => $ contrib ? [] : $ versions ,
94
+ 'versions ' => $ versions ,
94
95
'branch ' => $ sourceBranch ,
95
96
'is_contrib ' => $ contrib ,
96
97
'_links ' => [
0 commit comments