瀏覽代碼

[vendors] removed submodules in order to avoid recursive cloning, added php script instead

gediminasm 14 年之前
父節點
當前提交
90d86c6858

+ 1 - 0
.gitignore

@@ -2,6 +2,7 @@ tests/phpunit.xml
 tests/temp/*.php
 build/
 scripts/
+vendor/
 .project
 .settings
 .build.xml

+ 0 - 27
.gitmodules

@@ -1,27 +0,0 @@
-[submodule "vendor/doctrine-common"]
-	path = vendor/doctrine-common
-	url = git://github.com/doctrine/common.git
-[submodule "vendor/doctrine-dbal"]
-	path = vendor/doctrine-dbal
-	url = git://github.com/doctrine/dbal.git
-[submodule "vendor/doctrine-orm"]
-	path = vendor/doctrine-orm
-	url = git://github.com/doctrine/doctrine2.git
-[submodule "vendor/doctrine-mongodb"]
-	path = vendor/doctrine-mongodb
-	url = git://github.com/doctrine/mongodb.git
-[submodule "vendor/doctrine-mongodb-odm"]
-	path = vendor/doctrine-mongodb-odm
-	url = git://github.com/doctrine/mongodb-odm.git
-[submodule "vendor/Symfony/Component/ClassLoader"]
-	path = vendor/Symfony/Component/ClassLoader
-	url = git://github.com/symfony/ClassLoader.git
-[submodule "vendor/Symfony/Component/Yaml"]
-	path = vendor/Symfony/Component/Yaml
-	url = git://github.com/symfony/Yaml.git
-[submodule "vendor/Symfony/Component/Finder"]
-	path = vendor/Symfony/Component/Finder
-	url = git://github.com/symfony/Finder.git
-[submodule "vendor/Symfony/Component/Console"]
-	path = vendor/Symfony/Component/Console
-	url = git://github.com/symfony/Console.git

+ 1 - 1
README.markdown

@@ -86,7 +86,7 @@ PHPUnit 3.5 or newer is required.
 To setup and run tests follow these steps:
 
 - go to the root directory of extensions
-- run: **git submodule update --init**
+- run: **php bin/vendors.php**
 - run: **phpunit -c tests**
 - optional - run mongodb in background to complete all tests
 

+ 1 - 1
bin/clear_temp.php

@@ -10,7 +10,7 @@ set_include_path(implode(PATH_SEPARATOR, array(
 
 $classLoaderFile = VENDOR_PATH . '/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
 if (!file_exists($classLoaderFile)) {
-    die('cannot find vendor, git submodule init && git submodule update');
+    die('cannot find vendor, run: php bin/vendors.php');
 }
 
 require_once $classLoaderFile;

+ 1 - 1
bin/purify.php

@@ -9,7 +9,7 @@ set_include_path(implode(PATH_SEPARATOR, array(
 
 $classLoaderFile = VENDOR_PATH . '/doctrine-common/lib/Doctrine/Common/ClassLoader.php';
 if (!file_exists($classLoaderFile)) {
-    die('cannot find vendor, git submodule init && git submodule update');
+    die('cannot find vendor, run: php bin/vendors.php');
 }
 
 require_once $classLoaderFile;

+ 36 - 0
bin/vendors.php

@@ -0,0 +1,36 @@
+#!/usr/bin/env php
+<?php
+
+// dependent libraries for test environment
+
+define('VENDOR_PATH', __DIR__ . '/../vendor');
+
+if (!is_dir(VENDOR_PATH)) {
+    mkdir(VENDOR_PATH, 0775, true);
+}
+
+$deps = array(
+    array('doctrine-orm', 'http://github.com/doctrine/doctrine2.git', 'a4cbb23fc8612587d1886e4c3e7d62d72457a297'),
+    array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', 'eb80a3797e80fbaa024bb0a1ef01c3d81bb68a76'),
+    array('doctrine-common', 'http://github.com/doctrine/common.git', 'aa00010faa764c49d9bdee5d35fa90aea5c682ee'),
+    array('doctrine-mongodb', 'http://github.com/doctrine/mongodb.git', '4109734e249a951f270c531999871bfe9eeed843'),
+    array('doctrine-mongodb-odm', 'http://github.com/doctrine/mongodb-odm.git', '6b91d944e68bbf94702a38351f03c74b7d6a057a'),
+
+    array('Symfony/Component/ClassLoader', 'http://github.com/symfony/ClassLoader.git', '86fed40f30a64d0726ed19060d4b872f2feaaf7d'),
+    array('Symfony/Component/Console', 'http://github.com/symfony/Console.git', 'd8ccb833b19ca7965fd320737a4dec5f152bb7ef'),
+    array('Symfony/Component/Finder', 'http://github.com/symfony/Finder.git', '42709a7857fd46fd67fdb452302f1b0bdcd4eccb'),
+    array('Symfony/Component/Yaml', 'http://github.com/symfony/Yaml.git', '9a5dc42f6611d6c103e6c0dc1c4688994fd68a89'),
+);
+
+foreach ($deps as $dep) {
+    list($name, $url, $rev) = $dep;
+
+    echo "> Installing/Updating $name\n";
+
+    $installDir = VENDOR_PATH.'/'.$name;
+    if (!is_dir($installDir)) {
+        system(sprintf('git clone %s %s', $url, $installDir));
+    }
+
+    system(sprintf('cd %s && git fetch origin && git reset --hard %s', $installDir, $rev));
+}

+ 3 - 1
tests/bootstrap.php

@@ -24,7 +24,9 @@ define('TESTS_TEMP_DIR', __DIR__.'/temp');
 define('VENDOR_PATH', realpath(__DIR__ . '/../vendor'));
 
 $classLoaderFile = VENDOR_PATH . '/Symfony/Component/ClassLoader/UniversalClassLoader.php';
-
+if (!file_exists($classLoaderFile)) {
+    die('cannot find vendor, run: php bin/vendors.php');
+}
 require_once $classLoaderFile;
 $loader = new Symfony\Component\ClassLoader\UniversalClassLoader;
 $loader->registerNamespaces(array(

+ 0 - 1
vendor/Symfony/Component/ClassLoader

@@ -1 +0,0 @@
-Subproject commit 86fed40f30a64d0726ed19060d4b872f2feaaf7d

+ 0 - 1
vendor/Symfony/Component/Console

@@ -1 +0,0 @@
-Subproject commit d8ccb833b19ca7965fd320737a4dec5f152bb7ef

+ 0 - 1
vendor/Symfony/Component/Finder

@@ -1 +0,0 @@
-Subproject commit 42709a7857fd46fd67fdb452302f1b0bdcd4eccb

+ 0 - 1
vendor/Symfony/Component/Yaml

@@ -1 +0,0 @@
-Subproject commit 9a5dc42f6611d6c103e6c0dc1c4688994fd68a89

+ 0 - 1
vendor/doctrine-common

@@ -1 +0,0 @@
-Subproject commit aa00010faa764c49d9bdee5d35fa90aea5c682ee

+ 0 - 1
vendor/doctrine-dbal

@@ -1 +0,0 @@
-Subproject commit eb80a3797e80fbaa024bb0a1ef01c3d81bb68a76

+ 0 - 1
vendor/doctrine-mongodb

@@ -1 +0,0 @@
-Subproject commit 4109734e249a951f270c531999871bfe9eeed843

+ 0 - 1
vendor/doctrine-mongodb-odm

@@ -1 +0,0 @@
-Subproject commit 6b91d944e68bbf94702a38351f03c74b7d6a057a

+ 0 - 1
vendor/doctrine-orm

@@ -1 +0,0 @@
-Subproject commit a4cbb23fc8612587d1886e4c3e7d62d72457a297