diff --git a/composer.json b/composer.json
index 3f025514..4c2bb60a 100644
--- a/composer.json
+++ b/composer.json
@@ -18,10 +18,10 @@
"drupal/coder": "^8.3.6",
"drush/drush": ">=9",
"mglaman/drupal-check": "^1.2",
- "palantirnet/phing-drush-task": "^1.1",
+ "palantirnet/phing-drush-task": ">=1.1",
"pear/http_request2": "^2.3",
"pear/versioncontrol_git": "@dev",
- "phing/phing": "^2.14",
+ "phing/phing": "^3.0",
"phpmd/phpmd": "^2.13",
"phpspec/prophecy-phpunit": "^2"
},
@@ -40,9 +40,6 @@
},
"extra": {
"patches": {
- "phing/phing": {
- "Support relative symliks in Phing": "https://raw.githubusercontent.com/palantirnet/the-build/7cdc28b6019fb88a0604261366f9ea35f1e21d96/patches/phing-relative-symlinks.patch"
- }
}
}
}
diff --git a/defaults.yml b/defaults.yml
index b3eafb9a..4bab8687 100644
--- a/defaults.yml
+++ b/defaults.yml
@@ -295,7 +295,8 @@ styleguide:
# Location of the style guide, relative to the project root.
root: 'styleguide'
# Command to compile the style guide assets, for use during the build and artifact steps.
- command: 'yarn default'
+ command: 'yarn'
+ command_args: 'default'
# Configuration for linting custom javascript.
#
diff --git a/defaults/install/build.xml b/defaults/install/build.xml
index cdb6ca2c..8376056f 100644
--- a/defaults/install/build.xml
+++ b/defaults/install/build.xml
@@ -105,7 +105,9 @@
-
+
+
+
@@ -118,11 +120,13 @@
-
+
-
+
+
+
@@ -131,7 +135,9 @@
-
+
+
+
@@ -142,14 +148,16 @@
-
+
-
+
+
+
@@ -157,13 +165,13 @@
-
+
-
+
@@ -177,7 +185,9 @@
-
+
+
+
Find more documentation for palantirnet/the-build on GitHub:
https://github.com/palantirnet/the-build#using-the-build
diff --git a/src/TheBuild/Acquia/GetLatestBackupTask.php b/src/TheBuild/Acquia/GetLatestBackupTask.php
index 03b2589f..121844b3 100644
--- a/src/TheBuild/Acquia/GetLatestBackupTask.php
+++ b/src/TheBuild/Acquia/GetLatestBackupTask.php
@@ -7,6 +7,8 @@
use AcquiaCloudApi\Endpoints\Applications;
use AcquiaCloudApi\Endpoints\DatabaseBackups;
use AcquiaCloudApi\Endpoints\Environments;
+use Phing\Exception\BuildException;
+use Phing\Io\File;
/**
* Fetch a recent backup from Acquia.
@@ -16,7 +18,7 @@ class GetLatestBackupTask extends \Task {
/**
* Required. Directory for storing downloaded database backups.
*
- * @var \PhingFile
+ * @var \Phing\Io\File
*/
protected $dir;
@@ -50,8 +52,8 @@ class GetLatestBackupTask extends \Task {
/**
* {@inheritdoc}
*
- * @throws \IOException
- * @throws \NullPointerException
+ * @throws \Phing\Io\IOException
+ * @throws \HTTP_Request2_Exception
*/
public function main() {
$this->validate();
@@ -77,7 +79,7 @@ private function getAcquiaCloudCredentials() {
$this->log("Couldn't find ACQUIA_CLOUD_API_SECRET env variable.");
}
if (!$api_key || !$api_secret) {
- throw new \BuildException("Credentials are required.");
+ throw new BuildException("Credentials are required.");
}
return [
@@ -185,7 +187,7 @@ public function setDatabase(string $value) {
* Directory path.
*/
public function setDir(string $value) {
- $this->dir = new \PhingFile($value);
+ $this->dir = new File($value);
}
/**
@@ -200,7 +202,7 @@ protected function validate() {
// Check the build attributes.
foreach (['dir', 'site', 'env'] as $attribute) {
if (empty($this->$attribute)) {
- throw new \BuildException("$attribute attribute is required.");
+ throw new BuildException("$attribute attribute is required.");
}
}
}
diff --git a/src/TheBuild/CopyPropertiesTask.php b/src/TheBuild/CopyPropertiesTask.php
index c65aa17a..dce1278c 100644
--- a/src/TheBuild/CopyPropertiesTask.php
+++ b/src/TheBuild/CopyPropertiesTask.php
@@ -2,10 +2,14 @@
namespace TheBuild;
+use Phing\Task;
+use Phing\Exception\BuildException;
+use Phing\Util\StringHelper;
+
/**
* Copy properties matching a prefix to properties with a different prefix.
*/
-class CopyPropertiesTask extends \Task {
+class CopyPropertiesTask extends Task {
/**
* Prefix for properties to copy.
@@ -59,11 +63,11 @@ public function main() {
*/
public function validate() {
if (empty($this->fromPrefix)) {
- throw new \BuildException("fromPrefix attribute is required.", $this->location);
+ throw new BuildException("fromPrefix attribute is required.", $this->getLocation());
}
if (empty($this->toPrefix)) {
- throw new \BuildException("toPrefix attribute is required.", $this->location);
+ throw new BuildException("toPrefix attribute is required.", $this->getLocation());
}
}
@@ -74,7 +78,7 @@ public function validate() {
* Prefix to copy properties from.
*/
public function setFromPrefix($prefix) {
- if (!\StringHelper::endsWith(".", $prefix)) {
+ if (!StringHelper::endsWith(".", $prefix)) {
$prefix .= ".";
}
@@ -88,7 +92,7 @@ public function setFromPrefix($prefix) {
* Prefix to copy properties into.
*/
public function setToPrefix($prefix) {
- if (!\StringHelper::endsWith(".", $prefix)) {
+ if (!StringHelper::endsWith(".", $prefix)) {
$prefix .= ".";
}
diff --git a/src/TheBuild/ForeachKeyTask.php b/src/TheBuild/ForeachKeyTask.php
index 3c148dc0..859378c3 100644
--- a/src/TheBuild/ForeachKeyTask.php
+++ b/src/TheBuild/ForeachKeyTask.php
@@ -2,10 +2,14 @@
namespace TheBuild;
+use Phing\Task;
+use Phing\Exception\BuildException;
+use Phing\Util\StringHelper;
+
/**
* Phing task to run a target for each property in an array.
*/
-class ForeachKeyTask extends \Task {
+class ForeachKeyTask extends Task {
/**
* Prefix of properties to iterate over.
@@ -45,7 +49,7 @@ class ForeachKeyTask extends \Task {
/**
* Instance of PhingCallTask to use/run.
*
- * @var \PhingCallTask
+ * @var \Phing\Task\System\PhingCallTask
*/
protected $callee;
@@ -109,7 +113,7 @@ public function main() {
public function validate() {
foreach (['prefix', 'target', 'keyParam', 'prefixParam'] as $attribute) {
if (empty($this->$attribute)) {
- throw new \BuildException("$attribute attribute is required.", $this->location);
+ throw new BuildException("$attribute attribute is required.", $this->getLocation());
}
}
}
@@ -121,7 +125,7 @@ public function validate() {
* The key prefix.
*/
public function setPrefix($value) {
- if (!\StringHelper::endsWith(".", $value)) {
+ if (!StringHelper::endsWith(".", $value)) {
$value .= ".";
}
diff --git a/src/TheBuild/IncludeResourceTask.php b/src/TheBuild/IncludeResourceTask.php
index aba4328c..70503159 100644
--- a/src/TheBuild/IncludeResourceTask.php
+++ b/src/TheBuild/IncludeResourceTask.php
@@ -2,10 +2,14 @@
namespace TheBuild;
+use Phing\Task;
+use Phing\Exception\BuildException;
+use Phing\Io\File;
+
/**
* Copy or symlink a file or directory, depending on a flag.
*/
-class IncludeResourceTask extends \Task {
+class IncludeResourceTask extends Task {
/**
* Either 'symlink' or 'copy'.
@@ -17,14 +21,14 @@ class IncludeResourceTask extends \Task {
/**
* The source file or directory to include.
*
- * @var \PhingFile
+ * @var \Phing\Io\File
*/
protected $source;
/**
* The location to link the file to.
*
- * @var \PhingFile
+ * @var \Phing\Io\File
*/
protected $dest = NULL;
@@ -63,11 +67,11 @@ public function main() {
$this->log("Replacing existing resource '" . $this->dest->getPath() . "'");
if ($this->dest->delete(TRUE) === FALSE) {
- throw new \BuildException("Failed to delete existing destination '$this->dest'");
+ throw new BuildException("Failed to delete existing destination '$this->dest'");
}
}
- // Link or copy the source artifact. @phpstan-ignore-next-line
+ // Link or copy the source artifact.
$this->dest->getParentFile()->mkdirs();
if ($this->mode == 'copy') {
$this->log(sprintf("Copying '%s' to '%s'", $this->source->getPath(), $this->dest->getPath()));
@@ -75,7 +79,7 @@ public function main() {
}
else {
$this->log(sprintf("Linking '%s' to '%s'", $this->source->getPath(), $this->dest->getPath()));
- /** @var \SymlinkTask $symlink_task */
+ /** @var \Phing\Task\System\SymlinkTask $symlink_task */
$symlink_task = $this->project->createTask("symlink");
$symlink_task->setTarget($this->source->getPath());
$symlink_task->setLink($this->dest->getPath());
@@ -89,11 +93,11 @@ public function main() {
*/
public function validate() {
if (!in_array($this->mode, ['symlink', 'copy'])) {
- throw new \BuildException("mode attribute must be either 'symlink' or 'copy'", $this->location);
+ throw new BuildException("mode attribute must be either 'symlink' or 'copy'", $this->getLocation());
}
if (empty($this->source) || empty($this->dest)) {
- throw new \BuildException("Both the 'source' and 'dest' attributes are required.");
+ throw new BuildException("Both the 'source' and 'dest' attributes are required.");
}
}
@@ -110,12 +114,12 @@ public function setMode(string $mode) {
/**
* Set the source of the resource to include.
*
- * @param \PhingFile $source
+ * @param \Phing\Io\File $source
* Source file.
*/
- public function setSource(\PhingFile $source) {
+ public function setSource(File $source) {
if (!$source->exists()) {
- throw new \BuildException("resource '$source' is not available'");
+ throw new BuildException("resource '$source' is not available'");
}
$this->source = $source;
@@ -124,10 +128,10 @@ public function setSource(\PhingFile $source) {
/**
* Set the destination for the resource.
*
- * @param \PhingFile $dest
+ * @param \Phing\Io\File $dest
* File destination.
*/
- public function setDest(\PhingFile $dest) {
+ public function setDest(File $dest) {
$this->dest = $dest;
}
diff --git a/src/TheBuild/MenuInputRequest.php b/src/TheBuild/MenuInputRequest.php
index 325bc763..6bc4617c 100644
--- a/src/TheBuild/MenuInputRequest.php
+++ b/src/TheBuild/MenuInputRequest.php
@@ -2,10 +2,12 @@
namespace TheBuild;
+use Phing\Input\InputRequest;
+
/**
* Input interface that prompts the user to select from a menu of options.
*/
-class MenuInputRequest extends \InputRequest {
+class MenuInputRequest extends InputRequest {
/**
* Prompt to display with the menu.
diff --git a/src/TheBuild/SelectOneTask.php b/src/TheBuild/SelectOneTask.php
index 2c298356..445e035d 100644
--- a/src/TheBuild/SelectOneTask.php
+++ b/src/TheBuild/SelectOneTask.php
@@ -2,10 +2,14 @@
namespace TheBuild;
+use Phing\Task;
+use Phing\Exception\BuildException;
+use Phing\Project;
+
/**
* Allow the user to select one option from a list.
*/
-class SelectOneTask extends \Task {
+class SelectOneTask extends Task {
/**
* Required. List of values to select among.
@@ -44,7 +48,7 @@ public function main() {
$project = $this->getProject();
if ($existing_value = $this->project->getProperty($this->propertyName)) {
- $this->log("Using {$this->propertyName} = '{$existing_value}' (existing value)", \Project::MSG_INFO);
+ $this->log("Using {$this->propertyName} = '{$existing_value}' (existing value)", Project::MSG_INFO);
return;
}
@@ -63,7 +67,7 @@ public function main() {
}
elseif (count($keys) == 1) {
$value = current($keys);
- $this->log("Using {$this->propertyName} = '{$value}' (one value found)", \Project::MSG_INFO);
+ $this->log("Using {$this->propertyName} = '{$value}' (one value found)", Project::MSG_INFO);
}
if ($value) {
@@ -77,7 +81,7 @@ public function main() {
public function validate() {
foreach (['list', 'propertyName'] as $attribute) {
if (empty($this->$attribute)) {
- throw new \BuildException("$attribute attribute is required.", $this->location);
+ throw new BuildException("$attribute attribute is required.", $this->getLocation());
}
}
}
diff --git a/src/TheBuild/SelectPropertyKeyTask.php b/src/TheBuild/SelectPropertyKeyTask.php
index 86ae06bf..ceeb290d 100644
--- a/src/TheBuild/SelectPropertyKeyTask.php
+++ b/src/TheBuild/SelectPropertyKeyTask.php
@@ -2,10 +2,15 @@
namespace TheBuild;
+use Phing\Task;
+use Phing\Exception\BuildException;
+use Phing\Util\StringHelper;
+use Phing\Project;
+
/**
* Interactively select an option from an array of property keys.
*/
-class SelectPropertyKeyTask extends \Task {
+class SelectPropertyKeyTask extends Task {
/**
* Required. Prefix for properties to copy.
@@ -43,7 +48,7 @@ public function main() {
$project = $this->getProject();
if ($existing_value = $this->project->getProperty($this->propertyName)) {
- $this->log("Using {$this->propertyName} = '{$existing_value}' (existing value)", \Project::MSG_INFO);
+ $this->log("Using {$this->propertyName} = '{$existing_value}' (existing value)", Project::MSG_INFO);
return;
}
@@ -74,10 +79,10 @@ public function main() {
}
elseif (count($keys) == 1) {
$value = current($keys);
- $this->log("Using {$this->propertyName} = '{$value}' (one value found)", \Project::MSG_INFO);
+ $this->log("Using {$this->propertyName} = '{$value}' (one value found)", Project::MSG_INFO);
}
else {
- $this->log("No properties found with prefix '{$this->prefix}'", \Project::MSG_WARN);
+ $this->log("No properties found with prefix '{$this->prefix}'", Project::MSG_WARN);
}
if ($value) {
@@ -91,7 +96,7 @@ public function main() {
public function validate() {
foreach (['prefix', 'propertyName'] as $attribute) {
if (empty($this->$attribute)) {
- throw new \BuildException("$attribute attribute is required.", $this->location);
+ throw new BuildException("$attribute attribute is required.", $this->getLocation());
}
}
}
@@ -103,7 +108,7 @@ public function validate() {
* Keys with this prefix will be provided as options.
*/
public function setPrefix($value) {
- if (!\StringHelper::endsWith(".", $value)) {
+ if (!StringHelper::endsWith(".", $value)) {
$value .= ".";
}
diff --git a/targets/artifact.xml b/targets/artifact.xml
index d4ca2bd6..9465b1ab 100644
--- a/targets/artifact.xml
+++ b/targets/artifact.xml
@@ -32,14 +32,22 @@
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
@@ -89,7 +97,9 @@
-
+
+
+
@@ -104,7 +114,10 @@
-
+
+
+
+
Artifact repository: does not exist (will be created)
@@ -161,29 +174,47 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
Remote branch does not exist. Creating '${artifact.git.remote_branch}' on remote repository...
-
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
Remote branch '${artifact.git.remote_name}/${artifact.git.remote_branch}' created.
@@ -192,9 +223,16 @@
branch available locally. Now create a fresh, temporary branch for our
artifact work, to avoid naming conflicts and allow clean rebuilds. -->
-
-
-
+
+
+
+
+
+
+
+
+
+
Building on temporary branch '${artifact.git.temporary_branch}'.
@@ -202,7 +240,9 @@
-
+
+
+
@@ -211,7 +251,9 @@
-
+
+
+
@@ -267,7 +309,9 @@
-
+
+
+
@@ -317,13 +361,17 @@
Pushing changes.
-
+
+
+
-
+
+
+
@@ -333,18 +381,30 @@
-
+
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/targets/drupal.xml b/targets/drupal.xml
index aef4d1b6..badde3cb 100644
--- a/targets/drupal.xml
+++ b/targets/drupal.xml
@@ -32,7 +32,9 @@
-
+
+
+
@@ -145,7 +147,10 @@ ${modified_files}
-
+
+
+
+
@@ -178,7 +183,10 @@ Or, you can specify the export file directly:
$> ${drupal.site.load_db.command}
-
+
+
+
+
@@ -191,7 +199,9 @@ Or, you can specify the export file directly:
-
+
+
+
@@ -396,7 +406,9 @@ $sites['${_multisite.sites_php_domain}'] = '${_multisite.dir}';
-
+
+
+
diff --git a/targets/install.xml b/targets/install.xml
index 649e919d..32468cd3 100644
--- a/targets/install.xml
+++ b/targets/install.xml
@@ -158,8 +158,12 @@
-
-
+
+
+
+
+
+
@@ -173,7 +177,9 @@
-
+
+
+
diff --git a/targets/styleguide.xml b/targets/styleguide.xml
index 8f278c9f..8b456637 100644
--- a/targets/styleguide.xml
+++ b/targets/styleguide.xml
@@ -80,8 +80,10 @@
Install and build the style guide.
-->
- Running build command in ${styleguide.root}: ${styleguide.command}
-
+ Running build command in ${styleguide.root}: ${styleguide.command} ${styleguide.command_args}
+
+
+
@@ -98,7 +100,9 @@
-
+
+
+
@@ -112,7 +116,9 @@
-
+
+
+
diff --git a/targets/the-build.xml b/targets/the-build.xml
index 0740cbcd..b86aebe8 100644
--- a/targets/the-build.xml
+++ b/targets/the-build.xml
@@ -92,7 +92,9 @@
-
+
+
+
@@ -106,8 +108,12 @@
-
-
+
+
+
+
+
+