Added Base files for Makefile and Php Utilities

This commit is contained in:
Netkas 2022-09-22 16:41:54 -04:00
parent 6ec4f247ea
commit a1ce77a455
5 changed files with 104 additions and 10 deletions

59
src/ncc/CLI/PhpMenu.php Normal file
View file

@ -0,0 +1,59 @@
<?php
namespace ncc\CLI;
use ncc\Objects\CliHelpSection;
use ncc\Utilities\Console;
class PhpMenu
{
/**
* Displays the main help menu
*
* @param $args
* @return void
*/
public static function start($args): void
{
if(isset($args['create']))
{
self::createProject($args);
}
self::displayOptions();
exit(0);
}
/**
* Generates a new Autoloader file for the project
*
* @param $args
* @return void
*/
private static function generateAutoload($args): void
{
}
/**
* Displays the main options section
*
* @return void
*/
private static function displayOptions(): void
{
$options = [
new CliHelpSection(['help'], 'Displays this help menu about the PHP command'),
new CliHelpSection(['build', '--autoload'], 'Builds a new Autoload file for the project (Development purposes only)')
];
$options_padding = \ncc\Utilities\Functions::detectParametersPadding($options) + 4;
Console::out('Usage: ncc php {command} [options]');
Console::out('Options:' . PHP_EOL);
foreach($options as $option)
{
Console::out(' ' . $option->toString($options_padding));
}
}
}

View file

@ -112,6 +112,7 @@
$options = [
new CliHelpSection(['help'], 'Displays this help menu about the value command'),
new CliHelpSection(['create', '--src', '--package', '--name'], 'Creates a new NCC project'),
new CliHelpSection(['create', '--makefile'], 'Generates a Makefile for the project'),
];
$options_padding = \ncc\Utilities\Functions::detectParametersPadding($options) + 4;

View file

@ -0,0 +1,25 @@
<?php
namespace ncc\Classes;
use ncc\Objects\ProjectConfiguration;
class MakefileGenerator
{
/**
* @var ProjectConfiguration
*/
private ProjectConfiguration $project;
/**
* MakefileGenerator constructor.
* @param ProjectConfiguration $project
*/
public function __construct(ProjectConfiguration $project)
{
$this->project = $project;
}
}

View file

@ -0,0 +1,6 @@
PHPCC=%PHP_BIN_PATH%
NCC_SOURCE_PATH=%NCC_SOURCE_PATH%
NCC_BUILD_CONFIG=%NCC_BUILD_DEFAULT%
autoload: