1
0
Fork 0

Make builds more reproducible, refs #3927

pull/3991/head
Jordi Boggiano 2015-05-01 11:21:21 +01:00
parent d93406a668
commit 92785ac677
2 changed files with 13 additions and 1 deletions

View File

@ -1,6 +1,11 @@
#!/usr/bin/env php #!/usr/bin/env php
<?php <?php
$cwd = getcwd();
chdir(__DIR__.'/../');
shell_exec('php bin/composer install -q');
chdir($cwd);
require __DIR__.'/../src/bootstrap.php'; require __DIR__.'/../src/bootstrap.php';
use Composer\Compiler; use Composer\Compiler;
@ -12,6 +17,6 @@ try {
$compiler = new Compiler(); $compiler = new Compiler();
$compiler->compile(); $compiler->compile();
} catch (\Exception $e) { } catch (\Exception $e) {
echo 'Failed to compile phar: ['.get_class($e).'] '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine(); echo 'Failed to compile phar: ['.get_class($e).'] '.$e->getMessage().' at '.$e->getFile().':'.$e->getLine().PHP_EOL;
exit(1); exit(1);
} }

View File

@ -73,6 +73,10 @@ class Compiler
$phar->startBuffering(); $phar->startBuffering();
$finderSort = function ($a, $b) {
return strcmp($a, $b);
};
$finder = new Finder(); $finder = new Finder();
$finder->files() $finder->files()
->ignoreVCS(true) ->ignoreVCS(true)
@ -80,6 +84,7 @@ class Compiler
->notName('Compiler.php') ->notName('Compiler.php')
->notName('ClassLoader.php') ->notName('ClassLoader.php')
->in(__DIR__.'/..') ->in(__DIR__.'/..')
->sort($finderSort)
; ;
foreach ($finder as $file) { foreach ($finder as $file) {
@ -91,6 +96,7 @@ class Compiler
$finder->files() $finder->files()
->name('*.json') ->name('*.json')
->in(__DIR__ . '/../../res') ->in(__DIR__ . '/../../res')
->sort($finderSort)
; ;
foreach ($finder as $file) { foreach ($finder as $file) {
@ -109,6 +115,7 @@ class Compiler
->in(__DIR__.'/../../vendor/symfony/') ->in(__DIR__.'/../../vendor/symfony/')
->in(__DIR__.'/../../vendor/seld/jsonlint/') ->in(__DIR__.'/../../vendor/seld/jsonlint/')
->in(__DIR__.'/../../vendor/justinrainbow/json-schema/') ->in(__DIR__.'/../../vendor/justinrainbow/json-schema/')
->sort($finderSort)
; ;
foreach ($finder as $file) { foreach ($finder as $file) {