@@ -12,6 +12,7 @@ class RoboFile extends \Robo\Tasks
1212 const REPO_BLOB_URL = 'https://github.com/Codeception/Codeception/blob ' ;
1313 const BRANCH_4x = '4.2 ' ;
1414 const BRANCH_5x = '5.1 ' ;
15+ const BRANCH_53 = '5.3 ' ;
1516 const BRANCH_MAIN = 'main ' ;
1617
1718 function post ()
@@ -413,6 +414,33 @@ private function postProcessFile($pageName, $documentationFile)
413414 file_put_contents ($ documentationFile , $ contents );
414415 }
415416
417+ public function buildPhar82 ()
418+ {
419+ $ ignoredPlatformReqs = array (
420+ 'ext-apcu ' ,
421+ 'ext-mongodb ' ,
422+ 'ext-phalcon ' ,
423+ );
424+
425+ $ version = self ::BRANCH_53 . '. ' . date ('Ymd ' );
426+ $ releaseDir = "releases/ $ version " ;
427+ $ this ->stopOnFail ();
428+ $ this ->taskFilesystemStack ()->mkdir ('build/82 ' )->run ();
429+ $ this ->setCodeceptionVersionTo ('^ ' . self ::BRANCH_53 , $ ignoredPlatformReqs );
430+ $ this ->setPlatformVersionTo ('8.2.0 ' , $ ignoredPlatformReqs );
431+ $ buildFile = 'build/82/codecept.phar ' ;
432+ $ this ->buildPhar ($ buildFile );
433+ $ this ->updateVersionFile ($ buildFile , 'php82/codecept.version ' );
434+ $ versionedFile = "$ releaseDir/codecept.phar " ;
435+ $ this ->taskFilesystemStack ()
436+ ->stopOnFail ()
437+ ->mkdir ($ releaseDir )
438+ ->copy ($ buildFile , $ versionedFile )
439+ ->remove ('php82/codecept.phar ' )
440+ ->symlink ("../ $ versionedFile " , 'php82/codecept.phar ' )
441+ ->run ();
442+ }
443+
416444 public function buildPhar80 ()
417445 {
418446 $ version = self ::BRANCH_5x . '. ' . date ('Ymd ' );
@@ -524,17 +552,40 @@ public function release80()
524552 ->run ();
525553 }
526554
527- private function setPlatformVersionTo ($ version )
555+ public function release82 ()
556+ {
557+ $ version = self ::BRANCH_53 . '. ' . date ('Ymd ' );
558+ $ releaseDir = "releases/ $ version " ;
559+ $ this ->updateBuildsPage ();
560+
561+ $ this ->taskGitStack ()
562+ ->stopOnFail ()
563+ ->checkout ('-- package/composer.json ' )
564+ ->add ('builds.markdown ' )
565+ ->add ('php82/codecept.phar ' )
566+ ->add ('php82/codecept.version ' )
567+ ->add ($ releaseDir )
568+ ->run ();
569+ }
570+
571+ private function setPlatformVersionTo ($ version , $ ignoredPlatformReqs = array ())
528572 {
529573 $ this ->taskComposerConfig ()->workingDir ('package ' )->set ('platform.php ' , $ version )->run ();
530- $ this ->taskComposerUpdate ()->preferDist ()->optimizeAutoloader ()->workingDir ('package ' )->run ();
574+ $ composerUpdate = $ this ->taskComposerUpdate ();
575+ foreach ($ ignoredPlatformReqs as $ ignoredPlatformReq ) {
576+ $ composerUpdate ->option ('--ignore-platform-req ' , $ ignoredPlatformReq );
577+ }
578+ $ composerUpdate ->preferDist ()->optimizeAutoloader ()->workingDir ('package ' )->run ();
531579 }
532580
533- private function setCodeceptionVersionTo ($ version )
581+ private function setCodeceptionVersionTo ($ version, $ ignoredPlatformReqs = array () )
534582 {
535- $ this ->taskComposerRequire ()
536- ->dependency ('codeception/codeception ' , $ version )
537- ->workingDir ('package ' )
583+ $ composerRequire = $ this ->taskComposerRequire ()
584+ ->dependency ('codeception/codeception ' , $ version );
585+ foreach ($ ignoredPlatformReqs as $ ignoredPlatformReq ) {
586+ $ composerRequire ->option ('--ignore-platform-req ' , $ ignoredPlatformReq );
587+ }
588+ $ composerRequire ->workingDir ('package ' )
538589 ->run ();
539590 }
540591
@@ -696,8 +747,10 @@ public function updateBuildsPage()
696747 $ releaseFile ->line ("*Requires: PHP 5.4 and higher + CURL* \n" );
697748 } elseif ($ major < 5 ) {
698749 $ releaseFile ->line ("*Requires: PHP 5.6 and higher + CURL* \n" );
699- } else {
750+ } elseif ( $ minor < 3 ) {
700751 $ releaseFile ->line ("*Requires: PHP 8.0 and higher + CURL* \n" );
752+ } else {
753+ $ releaseFile ->line ("*Requires: PHP 8.2 and higher + CURL* \n" );
701754 }
702755 $ releaseFile ->line ("* **[Download Latest $ branch Release]( $ downloadUrl)** " );
703756 }
0 commit comments