diff --git a/CHANGELOG.md b/CHANGELOG.md index f69d8e0..e37f803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,9 @@ This update introduces minor bug fixes. - Set default process timeouts to null - Fixed issue where a newline is sometimes added to the end of a download output due to how short the download process was, mitigated the issue by enforcing a "done" update at the end of the download process + - Fixed issue where all development dependencies were not correctly being added to debug builds in composer projects, + instead these dependencies were added globally to the build configuration. This issue was fixed by adding all the + development dependencies to the debug build configurations only. ## [2.0.3] - 2023-10-17 @@ -38,7 +41,7 @@ The changes improve the system's efficiency, error resilience, and user experien - Implemented support in the AST traversal for the PHP statements `include`, `include_once`, `require`, and `require_once`. These statements are transformed into function calls. With this change, ncc can correctly handle and import files from system packages or direct binary package files. - - Added new `ConsoleProgressBar` class for UI improvement, imrpoved the CLI Progress Bar inspired by + - Added new `ConsoleProgressBar` class for UI improvement, improved the CLI Progress Bar inspired by [pacman](https://wiki.archlinux.org/title/pacman) ### Fixed diff --git a/src/ncc/Classes/PackageReader.php b/src/ncc/Classes/PackageReader.php index d42c760..814f253 100644 --- a/src/ncc/Classes/PackageReader.php +++ b/src/ncc/Classes/PackageReader.php @@ -195,7 +195,7 @@ } } - if($this->data_length === null) + if($this->data_length === null || $this->data_length === 0) { throw new IOException(sprintf('File \'%s\' is not a valid package file (missing end of package)', $file_path)); } diff --git a/src/ncc/Managers/ProjectManager.php b/src/ncc/Managers/ProjectManager.php index 6e55750..5366593 100644 --- a/src/ncc/Managers/ProjectManager.php +++ b/src/ncc/Managers/ProjectManager.php @@ -496,6 +496,7 @@ // Create the build configuration $build = new ProjectConfiguration\Build('auto_src'); $build->setDefaultConfiguration('release_ncc'); + $require_dev = []; // Process dependencies if($composer_json->getRequire() !== null) @@ -516,7 +517,6 @@ } // Process developer dependencies - $require_dev = []; if($composer_json->getRequireDev() !== null) { /** @var ComposerJson\PackageLink $package_link */ @@ -528,10 +528,9 @@ } $source = sprintf('%s=%s@packagist', $package_link->getPackageName(), $package_link->getVersion()); - $build->addDependency(new ProjectConfiguration\Dependency( + $require_dev[] = new ProjectConfiguration\Dependency( Resolver::composerNameToPackage($package_link->getPackageName()), $source, $package_link->getVersion() - )); - $require_dev[] = $package_link->getPackageName(); + ); } }