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. This commit revises the handling of composer dependencies in 'ProjectManager.php'. A problem was encountered where software development dependencies were added globally to the build configuration, rather than exclusively to debug builds. By reassigning these dependencies to the debug configuration, this issue has been remedied. Additionally, a bug-fix in 'PackageReader.php' has been implemented to validate the package file by checking the data length. If the file is discovered to be invalid (data length is null or zero), an IOException is triggered. These changes enhance the accuracy of dependency management and improve the robustness of package validation.
This commit is contained in:
parent
7befd995e7
commit
76f12bb0a3
3 changed files with 8 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue