@@ -10,7 +10,8 @@ class RoboFile extends \Robo\Tasks
10
10
use DocumentationHelpers;
11
11
12
12
const REPO_BLOB_URL = 'https://github.com/Codeception/Codeception/blob ' ;
13
- const STABLE_BRANCH = '4.1 ' ;
13
+ const BRANCH_4x = '4.2 ' ;
14
+ const BRANCH_5x = '5.0 ' ;
14
15
15
16
function post ()
16
17
{
@@ -180,12 +181,11 @@ public function buildDocsUtils()
180
181
$ utils = [
181
182
'Autoload ' => null ,
182
183
'Fixtures ' => null ,
183
- 'Locator ' => null ,
184
- 'XmlBuilder ' => null ,
184
+ 'Locator ' => ' lib-web ' ,
185
+ 'XmlBuilder ' => ' lib-xml ' ,
185
186
'JsonType ' => 'module-rest ' ,
186
187
'HttpCode ' => 'lib-innerbrowser ' ,
187
188
];
188
- //JsonType is in module-rest, HttpCode - in lib-innerbrowser
189
189
190
190
foreach ($ utils as $ utilName => $ repositoryName ) {
191
191
$ className = '\Codeception\Util \\' . $ utilName ;
@@ -322,7 +322,7 @@ public function buildDocsExtensions()
322
322
->prepend ("# Official Extensions \n" )
323
323
->processClassSignature (function (ReflectionClass $ r , $ text ) {
324
324
$ name = $ r ->getShortName ();
325
- return "## $ name \n\n[See Source]( " . self ::REPO_BLOB_URL . "/ " . self ::STABLE_BRANCH . "/ext/ $ name.php) " ;
325
+ return "## $ name \n\n[See Source]( " . self ::REPO_BLOB_URL . "/ " . self ::BRANCH_5x . "/ext/ $ name.php) " ;
326
326
})
327
327
->filterMethods (function (ReflectionMethod $ r ) {
328
328
return false ;
@@ -336,7 +336,7 @@ public function buildDocsExtensions()
336
336
protected function documentApiClass ($ file , $ className , $ all = false , $ repositoryName = null )
337
337
{
338
338
if ($ repositoryName === null ) {
339
- $ repositoryUrl = self ::REPO_BLOB_URL . "/ " . self ::STABLE_BRANCH ;
339
+ $ repositoryUrl = self ::REPO_BLOB_URL . "/ " . self ::BRANCH_5x ;
340
340
} else {
341
341
$ repositoryUrl = 'https://github.com/Codeception/ ' . $ repositoryName . '/blob/master ' ;
342
342
}
@@ -471,9 +471,31 @@ private function postProcessFile($pageName, $documentationFile)
471
471
file_put_contents ($ documentationFile , $ contents );
472
472
}
473
473
474
+ public function buildPhar80 ()
475
+ {
476
+ $ version = self ::BRANCH_5x . '. ' . date ('Ymd ' );
477
+ $ releaseDir = "releases/ $ version " ;
478
+ $ this ->stopOnFail ();
479
+
480
+ $ this ->taskFilesystemStack ()->mkdir ('build/80 ' )->run ();
481
+ $ this ->setCodeceptionVersionTo ('^5.0 ' );
482
+ $ this ->setPlatformVersionTo ('8.0.2 ' );
483
+ $ buildFile = 'build/80/codecept.phar ' ;
484
+ $ this ->buildPhar ($ buildFile );
485
+ $ this ->updateVersionFile ($ buildFile , 'php80/codecept.version ' );
486
+ $ versionedFile = "$ releaseDir/codecept.phar " ;
487
+ $ this ->taskFilesystemStack ()
488
+ ->stopOnFail ()
489
+ ->mkdir ($ releaseDir )
490
+ ->copy ($ buildFile , $ versionedFile )
491
+ ->remove ('php80/codecept.phar ' )
492
+ ->symlink ($ versionedFile , 'php80/codecept.phar ' )
493
+ ->run ();
494
+ }
495
+
474
496
public function buildPhar72 ()
475
497
{
476
- $ version = self ::STABLE_BRANCH . '. ' . date ('Ymd ' );
498
+ $ version = self ::BRANCH_4x . '. ' . date ('Ymd ' );
477
499
$ releaseDir = "releases/ $ version " ;
478
500
$ this ->stopOnFail ();
479
501
@@ -494,7 +516,7 @@ public function buildPhar72()
494
516
495
517
public function buildPhar56 ()
496
518
{
497
- $ version = self ::STABLE_BRANCH . '. ' . date ('Ymd ' );
519
+ $ version = self ::BRANCH_4x . '. ' . date ('Ymd ' );
498
520
$ releaseDir = "releases/ $ version " ;
499
521
$ this ->stopOnFail ();
500
522
@@ -522,7 +544,7 @@ public function findReleases()
522
544
523
545
public function release ()
524
546
{
525
- $ version = self ::STABLE_BRANCH . '. ' . date ('Ymd ' );
547
+ $ version = self ::BRANCH_4x . '. ' . date ('Ymd ' );
526
548
$ releaseDir = "releases/ $ version " ;
527
549
$ this ->updateBuildsPage ();
528
550
@@ -538,12 +560,37 @@ public function release()
538
560
->run ();
539
561
}
540
562
563
+ public function release80 ()
564
+ {
565
+ $ version = self ::BRANCH_5x . '. ' . date ('Ymd ' );
566
+ $ releaseDir = "releases/ $ version " ;
567
+ $ this ->updateBuildsPage ();
568
+
569
+ $ this ->taskGitStack ()
570
+ ->stopOnFail ()
571
+ ->checkout ('-- package/composer.json ' )
572
+ ->add ('builds.markdown ' )
573
+ ->add ('php80/codecept.phar ' )
574
+ ->add ('php80/codecept.version ' )
575
+ ->add ($ releaseDir )
576
+ ->run ();
577
+ }
578
+
541
579
private function setPlatformVersionTo ($ version )
542
580
{
543
581
$ this ->taskComposerConfig ()->workingDir ('package ' )->set ('platform.php ' , $ version )->run ();
544
582
$ this ->taskComposerUpdate ()->preferDist ()->optimizeAutoloader ()->workingDir ('package ' )->run ();
545
583
}
546
584
585
+ private function setCodeceptionVersionTo ($ version )
586
+ {
587
+ $ this ->taskComposerRequire ()
588
+ ->dependency ('codeception/codeception ' , $ version )
589
+ ->ignorePlatformRequirements ()
590
+ ->workingDir ('package ' )
591
+ ->run ();
592
+ }
593
+
547
594
/**
548
595
* @desc creates codecept.phar
549
596
* @throws Exception
@@ -701,8 +748,10 @@ public function updateBuildsPage()
701
748
$ releaseFile ->line ("*Requires: PHP 5.3 and higher + CURL* \n" );
702
749
} elseif ($ major == 2 && $ minor < 4 ) {
703
750
$ releaseFile ->line ("*Requires: PHP 5.4 and higher + CURL* \n" );
704
- } else {
751
+ } elseif ( $ major < 5 ) {
705
752
$ releaseFile ->line ("*Requires: PHP 5.6 and higher + CURL* \n" );
753
+ } else {
754
+ $ releaseFile ->line ("*Requires: PHP 8.0 and higher + CURL* \n" );
706
755
}
707
756
$ releaseFile ->line ("* **[Download Latest $ branch Release]( $ downloadUrl)** " );
708
757
}
0 commit comments