From 36f6fc26efc3423e696ba2d1f32a8c3688548cd2 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 23 Aug 2019 12:48:58 +0300 Subject: [PATCH] Add in missing buildApiFiles method (#42) --- src/Tasks/Build/Base.php | 25 +++++++++++++++++++++++++ src/Tasks/Deploy/Package.php | 1 + 2 files changed, 26 insertions(+) diff --git a/src/Tasks/Build/Base.php b/src/Tasks/Build/Base.php index 61a1d3e..7e54bde 100644 --- a/src/Tasks/Build/Base.php +++ b/src/Tasks/Build/Base.php @@ -47,6 +47,17 @@ class Base extends JTask implements TaskInterface */ protected static $frontendFiles = array(); + /** + * Api files + * + * They need to be static in order to support multiple files and LANGUAGE + * + * @var array + * + * @since 1.0 + */ + protected static $apiFiles = array(); + /** * Backend files * @@ -181,6 +192,20 @@ public function addFrontendFiles($fileArray) self::$frontendFiles = array_merge(self::$frontendFiles, $fileArray); } + /** + * Adds Files / Folders to media array + * + * @param array $fileArray Array of files / folders + * + * @return void + * + * @since 1.0 + */ + public function addApiFiles($fileArray) + { + self::$apiFiles = array_merge(self::$apiFiles, $fileArray); + } + /** * Adds Files / Folders to media array * diff --git a/src/Tasks/Deploy/Package.php b/src/Tasks/Deploy/Package.php index 7fd615e..b0a08fc 100644 --- a/src/Tasks/Deploy/Package.php +++ b/src/Tasks/Deploy/Package.php @@ -273,6 +273,7 @@ public function createComponentZip() $this->_remove(JPATH_BASE . $tmp_path . '/administrator/manifests'); $this->_copyDir($this->current . '/language', JPATH_BASE . $tmp_path . '/language'); $this->_copyDir($this->current . '/components', JPATH_BASE . $tmp_path . '/components'); + $this->_copyDir($this->current . '/api', JPATH_BASE . $tmp_path . '/api'); if (file_exists($this->current . '/media')) {