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.
This commit is contained in:
Netkas 2023-10-25 22:00:37 -04:00
parent d2635b19fd
commit 957d9a9510
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
2 changed files with 34 additions and 8 deletions

View file

@ -12,6 +12,8 @@ This update introduces minor bug fixes.
### Added
- Added host resolving in network calls to improve the handling of invalid or unreachable URLs
- Added the ability to use 'all' as a build configuration when running `ncc build`, to build all build configurations
in the project.
### Changed
- Update progress bar text to display basename only

View file

@ -89,19 +89,43 @@
return 1;
}
// Build the project
try
$build_configuration = $args['config'] ?? $args['c'] ?? BuildConfigurationValues::DEFAULT;
if($build_configuration === BuildConfigurationValues::ALL)
{
$build_configuration = $args['config'] ?? $args['c'] ?? BuildConfigurationValues::DEFAULT;
$output = $project_manager->build($build_configuration, $options);
// Build all configurations
foreach($project_manager->getProjectConfiguration()->getBuild()->getBuildConfigurations() as $configuration_name)
{
Console::out(sprintf('Building configuration \'%s\'', $configuration_name));
try
{
$output = $project_manager->build($configuration_name, $options);
}
catch (Exception $e)
{
Console::outException('Failed to build project', $e, 1);
return 1;
}
Console::out($output);
}
}
catch (Exception $e)
else
{
Console::outException('Failed to build project', $e, 1);
return 1;
// Build the project
try
{
$output = $project_manager->build($build_configuration, $options);
}
catch (Exception $e)
{
Console::outException('Failed to build project', $e, 1);
return 1;
}
Console::out($output);
}
Console::out($output);
return 0;
}