Commit graph

651 commits

Author SHA1 Message Date
b5d35ed20e Convert ComposerStabilityTypes constants to enum cases 2024-09-14 08:23:29 -04:00
a2149cdb66 Removed DependencySourceType 2024-09-14 08:22:40 -04:00
28ff80dd41 Convert HttpRequestType constants to enum cases 2024-09-14 08:22:25 -04:00
86cf7467af Convert ProjectType constants to enum cases 2024-09-14 08:19:50 -04:00
3d44562241 Removed RemoteSourceType 2024-09-14 08:18:34 -04:00
5b24fe267d Convert RepositoryResultType constants to enum cases 2024-09-14 08:17:45 -04:00
14ec2e06b2 Added TODO 2024-09-14 00:41:27 -04:00
71ffed1a3f Convert RepositoryType constants to enum cases 2024-09-14 00:40:59 -04:00
d884d0fbda Convert CompilerExtensions constants to enum cases 2024-09-14 00:39:18 -04:00
baf11f5cb9 Convert ConsoleColors constants to enum cases 2024-09-14 00:37:03 -04:00
e1013f6c15 Convert ExceptionCodes constants to enum cases 2024-09-14 00:34:12 -04:00
718c6ff8d8 Convert FileDescriptor constants to enum cases 2024-09-14 00:31:43 -04:00
5dd98083d6 Convert LogLevel constants to enum cases 2024-09-14 00:30:05 -04:00
d612c67cb0 Convert PackageDirectory constants to enum cases 2024-09-14 00:24:49 -04:00
42473390e8 Removed CompilerExtensionDefaultVersions.php 2024-09-14 00:20:59 -04:00
cfc93aa066 Removed HttpStatusCodes.php 2024-09-14 00:20:46 -04:00
91103c1470 Removed ConstantReferences.php 2024-09-14 00:20:28 -04:00
9885d98b55 Removed PackageStandardVersions.php 2024-09-14 00:20:10 -04:00
321fef4228 Convert PackageStructure constants to enum cases 2024-09-14 00:19:53 -04:00
c687d0394d Convert PackageStructureVersions constants to enum cases 2024-09-14 00:13:43 -04:00
2a16b2de6b Convert ProjectTemplates constants to enum cases 2024-09-14 00:12:55 -04:00
e98b949b7d Convert RegexPatterns constants to enum cases 2024-09-13 13:38:48 -04:00
7e5cdf4d64 Removed EncoderType enum file, unused. 2024-09-13 13:34:40 -04:00
90535a3a35 Updated CHANGELOG.md 2024-09-13 13:31:37 -04:00
69de79ccf4 Convert Runners class to enum with string cases 2024-09-13 13:29:40 -04:00
7c9f63955a Update Scopes to enum and adjust scope checks 2024-09-13 13:26:54 -04:00
1ba50cc7ee Convert Versions constants to enum cases 2024-09-13 13:20:12 -04:00
f9047dd0d0 Bumped version to 2.1.0 2024-09-13 13:12:14 -04:00
a65b76b6bf
Updated CHANGELOG.md 2023-10-25 22:02:26 -04:00
957d9a9510
Added the ability to use 'all' as a build configuration when running ncc build, to build all build configurations
in the project.

The build command in ncc has been updated to accept 'all' as a build configuration which prompts the build of all configurations in the project. Previously, builds had to be triggered for each individual configurations. This change simplifies the build process especially for projects with multiple configurations, making the process more efficient and less prone to human error.
2023-10-25 22:00:37 -04:00
d2635b19fd
Fixed issue when creating a shadow copy of a package, if the universe aligns together and the cosmos unit together to
produce a package length exactly to where the end-of-package byte sequence is cut in half, the shadow copy will fail
   to be created due to the end-of-package byte sequence being cut in half, this issue was fixed by reading the package
   in chunks to determine the end-of-package byte sequence.

The PackageReader class has been updated to use a more efficient buffer management when reading data from a file. Previously, buffer size was growing uncontrollably and can eventually lead to out-of-memory errors for large files.

Now, the data is read in chunks and the buffer is cleared when it exceeds approximately 1MB size, maintaining only the last 512KB. This change ensures a more memory-efficient package reading and effectively prevents erroneous deadlocks for large package files.

Additionally, detection for end-of-data byte sequence has been modified to rectify an issue where package length could cut off the end-of-package byte sequence. This results in an improved reliability for package validation.
2023-10-25 21:40:42 -04:00
76f12bb0a3
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.
2023-10-25 17:57:51 -04:00
7befd995e7
Added host resolving in network calls to improve the handling of invalid or unreachable URLs
The 'Resolver' utility was utilized to resolve the host and cache the result, enhancing the robustness and efficiency of the network calling mechanism across different modules including PackageManager, GiteaRepository, GithubRepository, and others.
2023-10-25 15:08:58 -04:00
b2234d5040
Updated the Download function to attempt to retry the download upon an error for at least 3 times.
Updated the downloadFile function in PackageManager.php to retry the download upon an error for at least 3 times. This improvement on error handling will enhance the resilience of the download process, reducing the likelihood of a single network hiccup resulting in a failed download. This change has also been reflected in the CHANGELOG.md file.
2023-10-25 14:33:42 -04:00
27d1609b23
Added Project.xml 2023-10-25 14:00:46 -04:00
de1e199dff
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
A fix has been implemented for an issue where a newline was unintentionally added to the end of download output, mostly when the download process was too short. This has been mitigated by ensuring a "done" update whenever a download finishes.

At the same time, improvements have been made to the download progress output. Specifically, the downloaded size now won't exceed the total download size, and a definitive "100%" progress indication is enforced when the download ends.
2023-10-25 14:00:24 -04:00
aa6800e96a
Correction 2023-10-24 16:41:41 -04:00
a2cd98ba98
Updated exception handling in PackageReader
Optimized exception handling in PackageReader class by replacing NotSupportedException with IntegrityException. The update aligns with the objective of more accurate error handling and reporting during ZiProto decoding. The new IntegrityException provides a detailed error message, facilitating easier debugging.
2023-10-24 16:28:10 -04:00
27baeca112
Set default process timeouts to null
This commit sets the default timeout and idleTimeout for the execution process in ExecutionUnitRunner to null when there are no specific timeouts provided by the execution policy. This change was made to avoid unexpected timeouts when no specific values are set in the execution policy.
2023-10-24 16:07:48 -04:00
4f7aa7a859
Update progress bar text to display basename only
Modified the progress bar text display in PackageManager.php and NccCompiler.php classes. Changed 'setMiscText' function to now display only the basename of the component name, execution policy name, and resource name. This change improves readability and clarity of the progress bar by reducing clutter from long file paths.
2023-10-24 16:05:40 -04:00
3ebdeb0cba
Fixed issue where progress bar is displayed in VERBOSE mode
Added checks in the update method of the ConsoleProgressBar class to prevent it from displaying when log level is set to VERBOSE. This is to prevent cluttering the command-line interface with unnecessary information when running in VERBOSE mode. The changes also are reflected in the changelog.
2023-10-22 22:16:33 -04:00
bcc6f45eb4
Fix division by zero in ConsoleProgressBar
The rendering of the progress bar was causing a division by zero error when the maximum value was set to 0. This change adds a condition to check if the maximum value is not 0 before calculating the number of hashes and the percentage done in the progress bar. This avoids the division by zero error and makes the progress bar rendering more robust. The CHANGELOG.md file has also been updated to reflect this bug fix.
2023-10-22 19:26:16 -04:00
698d2e7a1f
Updated file tracking in Runtime class
Implemented changes in Runtime.php to better handle file tracking and to prevent unnecessary inclusion of duplicate files during Runtime. Instead of directly checking if a file is already included, we now create a unique identifier for each file using a crc32 hash function. This identifier (instead of the file path) is checked and stored in the inclusion list, allowing for better handling of dynamic or virtual files.
2023-10-18 16:03:40 -04:00
89d3af8680
Improve build efficiency by preventing duplicate merges
Introduced a private property to the `NccCompiler` class, `$merged_dependencies`, to keep track of the dependencies that have already been merged. This prevents unnecessary re-merging during the build operation, potentially enhancing the efficiency of the process. The implementation involves a check for a preexisting merge before a new merge is performed. If a merge already exists, the process is skipped, thereby avoiding redundancies.
2023-10-18 15:56:24 -04:00
12d7744e1e
Bumped version to 2.0.4 2023-10-18 15:49:16 -04:00
a76a8a4ae6
Updated CHANGELOG.md 2023-10-17 21:44:22 -04:00
7293519ba3
Add error handling for unspecified package in PackageManagerMenu 2023-10-17 21:27:40 -04:00
2605b8d218
- Added new ConsoleProgressBar class for UI improvement, imrpoved the CLI Progress Bar inspired by
[pacman](https://wiki.archlinux.org/title/pacman)
2023-10-17 21:23:05 -04:00
173032df72
- Fixed issue when registering ncc's extension, when using the INSTALLER, the installation path used in the process
appears to be incorrect, added a optional parameter to the `registerExtension` method to allow the installer to pass
   the correct installation path.
 - 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.
2023-10-17 17:01:40 -04:00
c736a896fb
When finding package versions in the package lock, ncc will try to find a satisfying version rather than the exact version, this is to prevent errors when the package lock contains a version that is not available in the repository. 2023-10-13 09:41:39 -04:00