Added Base files for Makefile and Php Utilities
This commit is contained in:
parent
6ec4f247ea
commit
a1ce77a455
5 changed files with 104 additions and 10 deletions
59
src/ncc/CLI/PhpMenu.php
Normal file
59
src/ncc/CLI/PhpMenu.php
Normal 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));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
25
src/ncc/Classes/MakefileGenerator.php
Normal file
25
src/ncc/Classes/MakefileGenerator.php
Normal 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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
6
src/templates/Makefile-php
Normal file
6
src/templates/Makefile-php
Normal file
|
@ -0,0 +1,6 @@
|
|||
PHPCC=%PHP_BIN_PATH%
|
||||
NCC_SOURCE_PATH=%NCC_SOURCE_PATH%
|
||||
NCC_BUILD_CONFIG=%NCC_BUILD_DEFAULT%
|
||||
|
||||
|
||||
autoload:
|
Loading…
Add table
Add a link
Reference in a new issue