7 'init',
'test',
'clean',
10 'init',
'test',
'clean',
17 'composerupdate' => [],
43 if (!isset(
$tasks[$task])) {
44 echo "Dependency not found: " . $task,
"\n";
47 $dependencies =
$tasks[$task];
50 foreach ($dependencies as $dependency) {
71 echo "task: " . $task,
"\n";
72 call_user_func($task);
81 include __DIR__ .
'/../vendor/autoload.php';
92 echo " Removing build files\n";
95 system(
'rm -r ' . $baseDir .
'/build/SabreDAV');
103 echo " Updating composer packages to latest version\n\n";
104 system(
'cd ' . $baseDir .
'; composer update');
111 echo " Running all unittests.\n";
112 echo " This may take a while.\n\n";
113 system(__DIR__ .
'/phpunit --configuration ' . $baseDir .
'/tests/phpunit.xml.dist --stop-on-failure',
$code);
115 echo "PHPUnit reported error code $code\n";
124 echo " Generating composer.json\n";
126 $input = json_decode(file_get_contents(__DIR__ .
'/../composer.json'),
true);
128 "require" =>
$input[
'require'],
130 "bin-dir" =>
"./bin",
132 "prefer-stable" =>
true,
133 "minimum-stability" =>
"alpha",
136 $newComposer[
'require'][
'sabre/vobject'],
137 $newComposer[
'require'][
'sabre/http'],
138 $newComposer[
'require'][
'sabre/uri'],
139 $newComposer[
'require'][
'sabre/event']
141 $newComposer[
'require'][
'sabre/dav'] =
$version;
142 mkdir(
'build/SabreDAV');
143 file_put_contents(
'build/SabreDAV/composer.json', json_encode($newComposer, JSON_PRETTY_PRINT));
145 echo " Downloading dependencies\n";
146 system(
"cd build/SabreDAV; composer install -n",
$code);
148 echo "Composer reported error code $code\n";
152 echo " Removing pointless files\n";
153 unlink(
'build/SabreDAV/composer.json');
154 unlink(
'build/SabreDAV/composer.lock');
156 echo " Moving important files to the root of the project\n";
164 foreach ($fileNames as $fileName) {
166 rename(
'build/SabreDAV/vendor/sabre/dav/' . $fileName,
'build/SabreDAV/' . $fileName);
172 echo "Zipping the sabredav distribution\n\n";
173 system(
'cd build; zip -qr sabredav-' . $version .
'.zip SabreDAV');
const VERSION
Full version number.
if(!isset($tasks[$currentTask])) $newTaskList
while(count($oldTaskList) > 0) foreach(array_keys($newTaskList) as $task) init()