Commit: 02e3bb8f9fa9d268416e19107eb2a1bb6b6546d1 Author: Anatol Belski <[email protected]> Mon, 27 Apr 2015 14:07:33 +0200 Parents: 842804467e0eba0bc2e81f236cec65b098132dda Branches: master pecl_legacy
Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=02e3bb8f9fa9d268416e19107eb2a1bb6b6546d1 Log: stuff done so far for the pickle build Changed paths: M client/include/PickleBuildVC.php M client/include/PickleExt.php M client/script/packagist.php Diff: diff --git a/client/include/PickleBuildVC.php b/client/include/PickleBuildVC.php index a99c2c7..786d4be 100644 --- a/client/include/PickleBuildVC.php +++ b/client/include/PickleBuildVC.php @@ -9,12 +9,15 @@ class PickleBuildVC { public $branch; public $build_name; - protected $pickle_phar = 'c:\\apps\\bin\\pickle.phar'; + /* now use the dev pickle version, as it needs some adjustments for the build bots */ + /* protected $pickle_phar = 'c:\\apps\\bin\\pickle.phar'; */ + protected $pickle_phar = 'c:\\php-sdk\\pickle\\bin\pickle'; protected $env; protected $sdk_base = "C:\\php-devel\\nts"; protected $int_dir; protected $log_dir; + protected $sdk_dir; protected $pickle_cmd; @@ -34,12 +37,70 @@ class PickleBuildVC throw new \Exception("Couldn't create log dir"); } - $this->pickle_cmd = PHP_BINARY . " " . $this->pickle_phar; + /* Use --ansi for now for better parsing if needed. Should tweak pickle to support --xml/--json */ + $this->pickle_cmd = PHP_BINARY . " " . $this->pickle_phar . " --ansi "; + + + $this->compiler = $branch->config->builds[$build_name]['compiler']; + $this->architecture = $branch->config->builds[$build_name]['arch']; + $this->thread_safe = (boolean)$branch->config->builds[$build_name]['thread_safe']; + + + $vc_env_prefix = strtoupper($this->compiler); + if ($this->architecture == 'x64') { + $vc_env_prefix .= '_X64_'; + } else { + $vc_env_prefix .= '_'; + } + + $path = getenv($vc_env_prefix . 'PATH'); + if (empty($path)) { + include __DIR__ . '/../data/config.php'; + /* use default config */ + $env = $custom_env; + } else { + $env = array(); + $env['PATH'] = getenv($vc_env_prefix . 'PATH') . ';' . getenv('PATH') ; + $env['INCLUDE'] = getenv($vc_env_prefix . 'INCLUDE'); + $env['LIB'] = getenv($vc_env_prefix . 'LIB'); + } + + if (!$env['INCLUDE'] || !$env['LIB']) { + $env['INCLUDE'] = getenv('INCLUDE'); + $env['LIB'] = getenv('LIB'); + } + + + $env['TMP'] = $env['TEMP'] = getenv('TEMP'); + $env['SystemDrive'] = getenv('SystemDrive'); + $env['SystemRoot'] = getenv('SystemRoot'); + if (!isset($env['BISON_SIMPLE'])) { + $env['BISON_SIMPLE'] = getenv('BISON_SIMPLE'); + } + + $env['CPU'] = "i386"; + $env['APPVER'] = "6.0"; + if ($branch->config->getDebug() == 0) { + $env['NODEBUG'] = "1"; + } + if (strcasecmp($this->architecture, 'x64') == 0) { + $env['CPU'] = "AMD64"; + } + + $this->sdk_path = $branch->config->getBuildFromName($build_name)[sdk_path]; + $env["PATH"] .= ";{$this->sdk_path}"; + + $this->env = $env; } public function __destruct() { - $this->clean(); +// $this->clean(); + } + + public function setSdkDir($sdk_dir) + { + $this->sdk_dir = $sdk_dir; } function clean() @@ -60,14 +121,18 @@ class PickleBuildVC } - public function build() + public function build(PickleExt $ext) { $cmd = $this->pickle_cmd; - $opts = "install "; + $opts = "install --source --quiet "; + $opts .= $ext->getPkgUri() . " "; $opts .= "--save-logs=" . $this->log_dir; $cmd = $this->pickle_cmd . " " . $opts; +echo $cmd; + $ret = exec_single_log($cmd, NULL, $this->env); + var_dump($ret); } public function archive() diff --git a/client/include/PickleExt.php b/client/include/PickleExt.php index c486eee..cd8033f 100644 --- a/client/include/PickleExt.php +++ b/client/include/PickleExt.php @@ -49,5 +49,11 @@ class PickleExt return $tmp_path; } + + public function getPkgUri() + { + return $this->pkg_uri; + } } + diff --git a/client/script/packagist.php b/client/script/packagist.php index 205729c..461f6b7 100644 --- a/client/script/packagist.php +++ b/client/script/packagist.php @@ -33,7 +33,8 @@ foreach ($builds as $build_name) { $build = $branch->createBuildInstance($build_name); $ext = new rm\PickleExt($pkg_path, $build); - $build->build(); + $build->build($ext); + die; $build->packLogs(); $build->archive(); -- PHP Webmaster List Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
