Commit:    ad2982f3afe7ec5c66cac4590458f286671b6375
Author:    Anatol Belski <[email protected]>         Wed, 22 Apr 2015 15:19:29 +0200
Parents:   d8bdbc6118ea52535615d97651be9f0e9832fa03
Branches:  master pecl_legacy

Link:       
http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=ad2982f3afe7ec5c66cac4590458f286671b6375

Log:
further preparations for pickle build

Changed paths:
  M  client/include/Pickle.php
  A  client/include/PickleBranch.php
  A  client/include/PickleBuildVC.php
  M  client/script/packagist.php


Diff:
diff --git a/client/include/Pickle.php b/client/include/Pickle.php
index f06b924..96eee7d 100644
--- a/client/include/Pickle.php
+++ b/client/include/Pickle.php
@@ -2,8 +2,6 @@
 
 namespace rmtools;
 
-include __DIR__ . '/BranchConfig.php';
-
 class Pickle
 {
        
diff --git a/client/include/PickleBranch.php b/client/include/PickleBranch.php
new file mode 100644
index 0000000..19bf506
--- /dev/null
+++ b/client/include/PickleBranch.php
@@ -0,0 +1,113 @@
+<?php
+namespace rmtools;
+
+include __DIR__ . '/PickleBuildVC.php';
+
+/* Primitive branch which maps to some unversioned local source tree. It'll 
not care about any revisions, etc. */
+class PickleBranch {
+       public $config;
+       public $builds;
+
+       public function __construct($config_path)
+       {
+               if (!is_readable($config_path)) {
+                       throw new \Exception('Cannot open config data <' . 
$config_path . '>');
+               }
+               $this->config = new BranchConfig($config_path);
+               $this->addBuildList();
+       }
+
+       private function addBuildList()
+       {
+               $builds = $this->config->getBuildList();
+
+               if (!empty($builds)) {
+                       $this->builds = array();
+                       foreach ($builds as $n => $v) {
+                               $this->builds[] = $n;
+                       }
+               } else {
+                               $this->builds = NULL;
+               }
+       }
+
+       public function update()
+       {
+               // pass
+       }
+
+       public function hasNewRevision()
+       {
+               return false;
+       }
+
+       public function export($revision = false, $build_type = false, $zip = 
false, $is_zip = false)
+       {
+               // TODO
+       }
+
+       public function createSourceSnap($build_type = false, $revision = false)
+       {
+               return $this->export($revision, $build_type, true);
+       }
+
+       public function setLastRevisionExported($last_rev)
+       {
+               // pass
+       }
+
+       public function getLastRevisionExported()
+       {
+               return NULL;
+       }
+
+       public function getLastRevisionId()
+       {
+               return NULL;
+       }
+
+       public function getPreviousRevision()
+       {
+               return NULL;
+       }
+
+       function getBuildList($platform)
+       {
+               $builds = array();
+               foreach ($this->builds as $build_name) {
+                       $build = $this->config->getBuildFromName($build_name);
+                       if (isset($build['platform']) && $build['platform'] == 
$platform) {
+                               $builds[] = $build_name;
+                       }
+               }
+               return $builds;
+       }
+
+       function createBuildInstance($build_name)
+       {
+               $build = NULL;
+               $build_config = $this->config->getBuildFromName($build_name);
+
+               if (!$build_config) {
+                       throw new \Exception("Invalid build name 
<$build_name>");
+               }
+
+               $compiler       = strtolower($build_config['compiler']);
+               switch ($compiler) {
+                       case 'vc14':
+                       case 'vc12':
+                       case 'vc11':
+                       case 'vc9':
+                       case 'vc6':
+                               $build = new PickleBuildVC($this, $build_name);
+                               break;
+                       case 'icc':
+                       case 'gcc':
+                       case 'clang':
+                               throw new \Exception("$compiler not supported 
yet. Not implemented");
+                               break;
+               }
+
+               return $build;
+       }
+}
diff --git a/client/include/PickleBuildVC.php b/client/include/PickleBuildVC.php
new file mode 100644
index 0000000..f55b771
--- /dev/null
+++ b/client/include/PickleBuildVC.php
@@ -0,0 +1,39 @@
+<?php
+
+namespace rmtools;
+
+include __DIR__ . '/BranchConfig.php';
+include __DIR__ . '/MakeLogParserVC.php';
+
+class PickleBuildVC
+{
+
+       public function __construct(PickleBranch $branch, $build_name)
+       {
+       }
+
+
+       public function phpize()
+       {
+
+
+       }
+
+       public function configure()
+       {
+
+       }
+
+       public function make()
+       {
+
+       }
+
+       public function archive()
+       {
+
+       }
+
+
+}
+
diff --git a/client/script/packagist.php b/client/script/packagist.php
index 6c9b5f4..e6706c5 100644
--- a/client/script/packagist.php
+++ b/client/script/packagist.php
@@ -1,6 +1,7 @@
 <?php
 
 include __DIR__ . '/../data/config.php';
+include __DIR__ . '/../include/PickleBranch.php';
 include __DIR__ . '/../include/Pickle.php';
 include __DIR__ . '/../include/Tools.php';
 //include __DIR__ . '/../include/PackagistExt.php';
@@ -9,12 +10,35 @@ use rmtools as rm;
 
 
 /* parametrize */
-$branch_name = "packagist55";
+$branch_name = "packagist70";
 
 $config_path = __DIR__ . '/../data/config/packagist/' . $branch_name . '.ini';
 
+$branch = new rm\PickleBranch($config_path);
+
+$branch_name = $branch->config->getName();
+$builds = $branch->getBuildList('windows');
+
 $pickle = new rm\Pickle();
-var_dump($pickle);
+
+
+
+//var_dump($pickle);
+//var_dump($branch_name);
+//var_dump($builds);
+
+foreach ($builds as $build_name) {
+
+       echo "Starting build" . PHP_EOL;
+
+       //$build_config = $branch->config->getBuildFromName($build_name);
+
+       $build = $branch->createBuildInstance($build_name);
+
+       var_dump($build_name);
+       var_dump($build);
+       //var_dump($build_config);
+}
 
 exit(0);


--
PHP Webmaster List Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to