diff --git a/src/ncc/Classes/NccExtension/ConstantCompiler.php b/src/ncc/Classes/NccExtension/ConstantCompiler.php index 3ecb5b3..27829ac 100644 --- a/src/ncc/Classes/NccExtension/ConstantCompiler.php +++ b/src/ncc/Classes/NccExtension/ConstantCompiler.php @@ -67,10 +67,10 @@ $input = str_replace( [ - AssemblyConstants::ASSEMBLY_NAME, - AssemblyConstants::ASSEMBLY_PACKAGE, - AssemblyConstants::ASSEMBLY_VERSION, - AssemblyConstants::ASSEMBLY_UID + AssemblyConstants::ASSEMBLY_NAME->value, + AssemblyConstants::ASSEMBLY_PACKAGE->value, + AssemblyConstants::ASSEMBLY_VERSION->value, + AssemblyConstants::ASSEMBLY_UID->value ], [ $assembly->getName(), @@ -81,27 +81,27 @@ if($assembly->getDescription() !== null) { - $input = str_replace(AssemblyConstants::ASSEMBLY_DESCRIPTION, $assembly->getDescription(), $input); + $input = str_replace(AssemblyConstants::ASSEMBLY_DESCRIPTION->value, $assembly->getDescription(), $input); } if($assembly->getCompany() !== null) { - $input = str_replace(AssemblyConstants::ASSEMBLY_COMPANY, $assembly->getCompany(), $input); + $input = str_replace(AssemblyConstants::ASSEMBLY_COMPANY->value, $assembly->getCompany(), $input); } if($assembly->getProduct() !== null) { - $input = str_replace(AssemblyConstants::ASSEMBLY_PRODUCT, $assembly->getProduct(), $input); + $input = str_replace(AssemblyConstants::ASSEMBLY_PRODUCT->value, $assembly->getProduct(), $input); } if($assembly->getCopyright() !== null) { - $input = str_replace(AssemblyConstants::ASSEMBLY_COPYRIGHT, $assembly->getCopyright(), $input); + $input = str_replace(AssemblyConstants::ASSEMBLY_COPYRIGHT->value, $assembly->getCopyright(), $input); } if($assembly->getTrademark() !== null) { - $input = str_replace(AssemblyConstants::ASSEMBLY_TRADEMARK, $assembly->getTrademark(), $input); + $input = str_replace(AssemblyConstants::ASSEMBLY_TRADEMARK->value, $assembly->getTrademark(), $input); } return $input; } diff --git a/src/ncc/Classes/PhpExtension/Templates/CliTemplate.php b/src/ncc/Classes/PhpExtension/Templates/CliTemplate.php index 2d834dd..d00766c 100644 --- a/src/ncc/Classes/PhpExtension/Templates/CliTemplate.php +++ b/src/ncc/Classes/PhpExtension/Templates/CliTemplate.php @@ -57,7 +57,7 @@ // Create the release build configuration $release_executable = new BuildConfiguration('release_executable', - 'build' . DIRECTORY_SEPARATOR . 'release' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_NAME + 'build' . DIRECTORY_SEPARATOR . 'release' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_NAME->value ); $release_executable->setBuildType(BuildOutputType::EXECUTABLE->value); $release_executable->setOption(BuildConfigurationOptions::NCC_CONFIGURATION, 'release'); @@ -65,7 +65,7 @@ // Create the debug build configuration $debug_executable = new BuildConfiguration('debug_executable', - 'build' . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_NAME + 'build' . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_NAME->value ); $debug_executable->setDefinedConstant('DEBUG', '1'); $debug_executable->setBuildType(BuildOutputType::EXECUTABLE->value); diff --git a/src/ncc/Enums/SpecialConstants/AssemblyConstants.php b/src/ncc/Enums/SpecialConstants/AssemblyConstants.php index 601fe1e..136765f 100644 --- a/src/ncc/Enums/SpecialConstants/AssemblyConstants.php +++ b/src/ncc/Enums/SpecialConstants/AssemblyConstants.php @@ -22,50 +22,50 @@ namespace ncc\Enums\SpecialConstants; - final class AssemblyConstants + enum AssemblyConstants : string { /** * Assembly's Name Property */ - public const ASSEMBLY_NAME = '%ASSEMBLY.NAME%'; + case ASSEMBLY_NAME = '%ASSEMBLY.NAME%'; /** * Assembly's Package Property */ - public const ASSEMBLY_PACKAGE = '%ASSEMBLY.PACKAGE%'; + case ASSEMBLY_PACKAGE = '%ASSEMBLY.PACKAGE%'; /** * Assembly's Description Property */ - public const ASSEMBLY_DESCRIPTION = '%ASSEMBLY.DESCRIPTION%'; + case ASSEMBLY_DESCRIPTION = '%ASSEMBLY.DESCRIPTION%'; /** * Assembly's Company Property */ - public const ASSEMBLY_COMPANY = '%ASSEMBLY.COMPANY%'; + case ASSEMBLY_COMPANY = '%ASSEMBLY.COMPANY%'; /** * Assembly's Product Property */ - public const ASSEMBLY_PRODUCT = '%ASSEMBLY.PRODUCT%'; + case ASSEMBLY_PRODUCT = '%ASSEMBLY.PRODUCT%'; /** * Assembly's Copyright Property */ - public const ASSEMBLY_COPYRIGHT = '%ASSEMBLY.COPYRIGHT%'; + case ASSEMBLY_COPYRIGHT = '%ASSEMBLY.COPYRIGHT%'; /** * Assembly's Trademark Property */ - public const ASSEMBLY_TRADEMARK = '%ASSEMBLY.TRADEMARK%'; + case ASSEMBLY_TRADEMARK = '%ASSEMBLY.TRADEMARK%'; /** * Assembly's Version Property */ - public const ASSEMBLY_VERSION = '%ASSEMBLY.VERSION%'; + case ASSEMBLY_VERSION = '%ASSEMBLY.VERSION%'; /** * Assembly's UUID property */ - public const ASSEMBLY_UID = '%ASSEMBLY.UID%'; + case ASSEMBLY_UID = '%ASSEMBLY.UID%'; } \ No newline at end of file diff --git a/src/ncc/Managers/ProjectManager.php b/src/ncc/Managers/ProjectManager.php index f5b60ac..2b24520 100644 --- a/src/ncc/Managers/ProjectManager.php +++ b/src/ncc/Managers/ProjectManager.php @@ -406,11 +406,11 @@ // Generate the Debug & Release build configurations $debug_configuration = new ProjectConfiguration\Build\BuildConfiguration('debug', - 'build' . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_PACKAGE . '.ncc' + 'build' . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_PACKAGE->value . '.ncc' ); $debug_configuration->setDefinedConstant('DEBUG', '1'); $build->addBuildConfiguration(new ProjectConfiguration\Build\BuildConfiguration('release', - 'build' . DIRECTORY_SEPARATOR . 'release' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_PACKAGE . '.ncc' + 'build' . DIRECTORY_SEPARATOR . 'release' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_PACKAGE->value . '.ncc' )); $build->addBuildConfiguration($debug_configuration); $build->setDefaultConfiguration('release'); @@ -616,14 +616,14 @@ // Generate debug build configuration $ncc_debug_configuration = new ProjectConfiguration\Build\BuildConfiguration('debug_ncc', - 'build' . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_PACKAGE + 'build' . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_PACKAGE->value ); $ncc_debug_configuration->setBuildType(BuildOutputType::NCC_PACKAGE->value); $ncc_debug_configuration->setDependencies($require_dev); $build->addBuildConfiguration($ncc_debug_configuration); $executable_debug_configuration = new ProjectConfiguration\Build\BuildConfiguration('debug_executable', - 'build' . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_NAME + 'build' . DIRECTORY_SEPARATOR . 'debug' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_NAME->value ); $executable_debug_configuration->setBuildType(BuildOutputType::EXECUTABLE->value); $executable_debug_configuration->setOption(BuildConfigurationOptions::NCC_CONFIGURATION, 'debug_ncc'); @@ -632,13 +632,13 @@ // Generate release build configuration $ncc_release_configuration = new ProjectConfiguration\Build\BuildConfiguration('release_ncc', - 'build' . DIRECTORY_SEPARATOR . 'release' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_PACKAGE . 'ncc' + 'build' . DIRECTORY_SEPARATOR . 'release' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_PACKAGE->value . 'ncc' ); $ncc_release_configuration->setBuildType(BuildOutputType::NCC_PACKAGE->value); $build->addBuildConfiguration($ncc_release_configuration); $executable_release_configuration = new ProjectConfiguration\Build\BuildConfiguration('release_executable', - 'build' . DIRECTORY_SEPARATOR . 'release' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_NAME + 'build' . DIRECTORY_SEPARATOR . 'release' . DIRECTORY_SEPARATOR . AssemblyConstants::ASSEMBLY_NAME->value ); $executable_release_configuration->setOption(BuildConfigurationOptions::NCC_CONFIGURATION, 'release_ncc'); $executable_release_configuration->setBuildType(BuildOutputType::EXECUTABLE->value);