[Pkg-owncloud-commits] [php-sabredav] 58/275: New build script combines lib/ and vendor/ for the zip distro.

David Prévot taffit at moszumanska.debian.org
Thu Sep 25 14:55:51 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository php-sabredav.

commit f8e745141ab6719f6c46b0ce99c636c562c328ce
Author: Evert Pot <me at evertpot.com>
Date:   Fri Jun 6 20:13:45 2014 -0400

    New build script combines lib/ and vendor/ for the zip distro.
---
 ChangeLog.md  |  3 ++-
 bin/build.php | 35 +++++++++++++++++++++++++++++++++--
 2 files changed, 35 insertions(+), 3 deletions(-)

diff --git a/ChangeLog.md b/ChangeLog.md
index b649f89..7e4770b 100644
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -7,7 +7,8 @@ ChangeLog
 * Changed: PropertyStorage backends now have a `move` method.
 * Added: `beforeMove`, and `afterMove` events.
 * #460: PropertyStorage must move properties during MOVE requests
-
+* Changed: Restructured the zip distribution to be a little bit more lean
+  and consistent.
 
 2.0.2 (2014-05-??)
 ------------------
diff --git a/bin/build.php b/bin/build.php
index 98fc889..0e7d7fc 100644
--- a/bin/build.php
+++ b/bin/build.php
@@ -120,12 +120,43 @@ function test() {
 function buildzip() {
 
     global $baseDir, $version;
-    echo "  Asking composer to download sabre/dav $version\n\n";
-    system("composer create-project -n --no-dev sabre/dav build/SabreDAV $version", $code);
+    echo "  Generating composer.json\n";
+
+    $input = json_decode(file_get_contents(__DIR__ . '/../composer.json'), true);
+    $newComposer = [
+        "require" => $input['require'],
+        "config"  => [
+            "bin-dir" => "./bin",
+        ]
+    ];
+    $newComposer['require']['sabre/dav'] = $version;
+    mkdir('build/SabreDAV');
+    file_put_contents('build/SabreDAV/composer.json', json_encode($newComposer));
+
+    echo "  Downloading dependencies\n";
+    system("cd build/SabreDAV; composer install -n --no-dev", $code);
     if ($code!==0) {
         echo "Composer reported error code $code\n";
         die(1);
     }
+
+    echo "  Removing pointless files\n";
+    unlink('build/SabreDAV/composer.json');
+    unlink('build/SabreDAV/composer.lock');
+
+    echo "  Moving important files to the root of the project\n";
+
+    $fileNames = [
+        'ChangeLog.md',
+        'LICENSE',
+        'README.md',
+        'examples',
+    ];
+    foreach($fileNames as $fileName) {
+        echo "    $fileName\n";
+        rename('build/SabreDAV/vendor/sabre/dav/' . $fileName, 'build/SabreDAV/' . $fileName);
+    }
+
     // <zip destfile="build/SabreDAV-${sabredav.version}.zip" basedir="build/SabreDAV" prefix="SabreDAV/" />
 
     echo "\n";

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/php-sabredav.git



More information about the Pkg-owncloud-commits mailing list