Make builds more reproducible, refs #3927

main
Jordi Boggiano 9 years ago
parent d93406a668
commit 92785ac677

@ -1,6 +1,11 @@
#!/usr/bin/env php
<?php
$cwd = getcwd();
chdir(__DIR__.'/../');
shell_exec('php bin/composer install -q');
chdir($cwd);
require __DIR__.'/../src/bootstrap.php';
use Composer\Compiler;
@ -12,6 +17,6 @@ try {
$compiler = new Compiler();
$compiler->compile();
} 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);
}

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

Loading…
Cancel
Save