com web/rmtools: setup name/version in PickleExt, use --pack-logs with pickle: client/include/PickleBuildVC.php client/include/PickleExt.php
client/script/pickle.php

From: Date: Tue, 05 May 2015 11:20:38 +0000
Subject: com web/rmtools: setup name/version in PickleExt, use --pack-logs with pickle: client/include/PickleBuildVC.php client/include/PickleExt.php
client/script/pickle.php
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-26007@lists.php.net to get a copy of this message
Commit: 0dc523add351f03b05784fb3f90c3c83f8e0249c Author: Anatol Belski <ab@php.net> Tue, 5 May 2015 13:20:38 +0200 Parents: fe002faa73d545f9ceb7a4bde700d8177eeb36df Branches: master pecl_legacy Link: http://git.php.net/?p=web/rmtools.git;a=commitdiff;h=0dc523add351f03b05784fb3f90c3c83f8e0249c Log: setup name/version in PickleExt, use --pack-logs with pickle Changed paths: M client/include/PickleBuildVC.php M client/include/PickleExt.php M client/script/pickle.php Diff: diff --git a/client/include/PickleBuildVC.php b/client/include/PickleBuildVC.php index d4256e5..bb07f91 100644 --- a/client/include/PickleBuildVC.php +++ b/client/include/PickleBuildVC.php @@ -13,7 +13,7 @@ class PickleBuildVC /* 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 $sdk_base; protected $int_dir; protected $log_dir; @@ -37,8 +37,8 @@ class PickleBuildVC throw new \Exception("Couldn't create log dir"); } - /* 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 "; + /* Use --no-ansi for now for better parsing if needed. Should tweak pickle to support --xml/--json */ + $this->pickle_cmd = PHP_BINARY . " " . $this->pickle_phar . " --no-ansi "; $this->compiler = $branch->config->builds[$build_name]['compiler']; @@ -98,6 +98,11 @@ class PickleBuildVC $this->clean(); } + public function getPickleCmd() + { + return $this->pickle_cmd; + } + public function setSdkDir($sdk_dir) { $this->sdk_dir = $sdk_dir; @@ -110,12 +115,6 @@ class PickleBuildVC } } - - public function packLogs() - { - - } - public function info() { @@ -133,7 +132,7 @@ class PickleBuildVC $opts = " --binary " . " --defaults " /* XXX if no force options was supplied, use --defaults. The logic is to implement. */ . "--tmp-dir={$this->int_dir} " - . "--save-logs=" . $this->log_dir . " " + . "--pack-logs " . "release " . $ext->getPkgUri(); diff --git a/client/include/PickleExt.php b/client/include/PickleExt.php index 7e3920f..35177bf 100644 --- a/client/include/PickleExt.php +++ b/client/include/PickleExt.php @@ -11,17 +11,34 @@ class PickleExt protected $zip_cmd = 'c:\php-sdk\bin\zip.exe'; protected $unzip_cmd = 'c:\php-sdk\bin\unzip.exe'; protected $deplister_cmd = 'c:\apps\bin\deplister.exe'; - protected $composer_json = NULL; - protected $composer_json_path = NULL; + protected $build; - public function __construct($pkg_uri) + protected $pickle_cmd; + + public function __construct($pkg_uri, $build) { $this->pkg_uri = $pkg_uri; + $this->build = $build; } public function init() { + $this->pickle_cmd = $this->build->getPickleCmd(); + + + $cmd = "{$this->pickle_cmd} info {$this->pkg_uri}"; + $ret = exec_single_log($cmd, NULL, NULL); + + if (!preg_match(",Package name\s+\|\s+([^\s]+)\s+\|,", $ret["log"], $m)) { + throw new \Exception("Couldn't parse extension name"); + } + $this->name = $m[1]; + + if (!preg_match(",Package version.+\|\s+([a-z0-9\.\-]+)\s+\|,i", $ret["log"], $m)) { + throw new \Exception("Couldn't parse extension name"); + } + $this->version = $m[1]; } public function preparePackage() diff --git a/client/script/pickle.php b/client/script/pickle.php index 558977e..5c9acf7 100644 --- a/client/script/pickle.php +++ b/client/script/pickle.php @@ -37,6 +37,8 @@ foreach ($builds as $build_name) { $build = $branch->createBuildInstance($build_name); $ext = new rm\PickleExt($pkg_path, $build); + $ext->init(); + echo "Running pickle build" . PHP_EOL; $ret = $build->build($ext); @@ -55,11 +57,10 @@ foreach ($builds as $build_name) { continue; } - /* XXX check zipball path before saying this */ - echo "Pickle build successful, packaging logs" . PHP_EOL; + /* XXX check zipballs path before saying this */ + echo "Pickle build successful" . PHP_EOL; // add the deps license to the pickle archive .... or should pickle do that? - //$build->packLogs(); /* upload logs and builds */ /* notify pickle */

« previous php.webmaster (#26007) next »