Page MenuHomePhabricator
Paste P1993

GetDependenciesWorkflow.php
ActivePublic

Authored by avivey on Jun 15 2016, 11:52 PM.
<?php
final class GetDependenciesWorkflow extends ArcanistWorkflow {
public function getWorkflowName() {
return 'get-dependencies';
}
public function getCommandSynopses() {
return phutil_console_format(<<<EOTEXT
**get-dependencies**
EOTEXT
);
}
public function getCommandHelp() {
return phutil_console_format(<<<EOTEXT
Download external resources you might need.
EOTEXT
);
}
public function run() {
$console = PhutilConsole::getConsole();
$lib = 'libname';
$root = dirname(phutil_get_library_root($lib));
$working_copy = ArcanistWorkingCopyIdentity::newFromPath($root);
$configuration_manager = clone $this->getConfigurationManager();
$configuration_manager->setWorkingCopyIdentity($working_copy);
$repository = ArcanistRepositoryAPI::newAPIFromConfigurationManager(
$configuration_manager);
$dependencies = array(
array(
'filename' => 'checkstyle-6.14.1-all.jar',
'sha1' => '8e2c3a2bcef100c084e6ea80cc426b3443632d8c',
'uri' =>
'http://my.web.server/checkstyle-6.14.1.jar',
),
);
chdir($root.'/resources/');
foreach ($dependencies as $dep) {
phutil_passthru('curl -o %s %s', $dep['filename'], $dep['uri']);
}
}
}

Event Timeline

avivey changed the visibility from "All Users" to "Public (No Login Required)".Jun 21 2018, 7:46 PM