ncc/Makefile

97 lines
3.2 KiB
Makefile
Raw Normal View History

# Variables
2023-08-16 11:58:50 -04:00
PHPCC := $(shell which php)
PHPAB := $(shell which phpab)
BUILD_PATH := build
SRC_PATH := src
INSTALLER_PATH := $(SRC_PATH)/installer
CONFIG_PATH := $(SRC_PATH)/config
TIMESTAMP := $(shell date +%Y%m%d%H%M%S)
2023-08-16 11:58:50 -04:00
# List of paths for autoloading
AUTOLOAD_PATHS := $(addprefix $(SRC_PATH)/ncc/ThirdParty/, \
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
composer/semver \
defuse/php-encryption \
jelix/version \
nikic/PhpParser \
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
Symfony/polyfill_ctype \
Symfony/polyfill_mbstring \
Symfony/polyfill_uuid \
Symfony/Process \
Symfony/Uid \
Symfony/Filesystem \
Symfony/Yaml \
theseer/DirectoryScanner \
)
2023-08-16 11:58:50 -04:00
# Check for necessary binaries
ifndef PHPCC
$(error "PHP binary not found. Please install PHP or check your PATH")
endif
ifndef PHPAB
$(error "phpab (PHP Autoload Builder) binary not found. Please install phpab or check your PATH")
endif
# Build rules
2023-08-16 11:58:50 -04:00
$(SRC_PATH)/%/autoload_spl.php:
$(PHPCC) $(PHPAB) --output $@ $(SRC_PATH)/$*
$(SRC_PATH)/ncc/autoload_spl.php:
2023-08-16 11:58:50 -04:00
$(PHPCC) $(PHPAB) --output $@ \
2023-08-19 05:02:22 -04:00
$(SRC_PATH)/ncc/Enums \
$(SRC_PATH)/ncc/Classes \
$(SRC_PATH)/ncc/CLI \
$(SRC_PATH)/ncc/Exceptions \
$(SRC_PATH)/ncc/Extensions \
$(SRC_PATH)/ncc/Interfaces \
$(SRC_PATH)/ncc/Managers \
$(SRC_PATH)/ncc/Objects \
$(SRC_PATH)/ncc/Utilities \
2023-01-29 23:27:56 +00:00
$(SRC_PATH)/ncc/ncc.php \
$(SRC_PATH)/ncc/Runtime.php
2022-08-11 14:04:33 -04:00
# Phony targets
2023-08-16 11:58:50 -04:00
.PHONY: autoload
autoload: $(addsuffix /autoload_spl.php, $(AUTOLOAD_PATHS)) $(SRC_PATH)/ncc/autoload_spl.php
cp -f $(SRC_PATH)/autoload/autoload.php $(SRC_PATH)/ncc/autoload.php
2023-08-16 11:58:50 -04:00
.PHONY: redist
2022-08-11 14:04:33 -04:00
redist: autoload
rm -rf $(BUILD_PATH)/src
mkdir -p $(BUILD_PATH)/src
cp -rf $(SRC_PATH)/ncc/* $(BUILD_PATH)/src
cp -f $(INSTALLER_PATH)/installer $(BUILD_PATH)/src/INSTALL
cp -f $(INSTALLER_PATH)/ncc.sh $(BUILD_PATH)/src/ncc.sh
cp -f $(CONFIG_PATH)/ncc.yaml $(BUILD_PATH)/src/default_config.yaml
cp -f $(CONFIG_PATH)/ncc.yaml $(BUILD_PATH)/src/CLI/template_config.yaml
- Cleaned up imports - Various bug fixes and improved performance on package reading/writing - Corrected CHANGELOG.md - Updated dependency `Symfony/polyfill-mbstring` to 1.28.0 - Updated dependency `Symfony/polyfill-uuid` to 1.28.0 - Updated dependency `Symfony/Process` to 6.3.4 - Updated dependency `Symfony/Uid` to 6.3.0 - Updated dependency `Symfony/Yaml` to 6.3.3 - Added support for Gitea repositories - Added support for Packagist repositories - Added a new default Gitea repository nocturn9x at git.nocturn9x.space - Added a new default Gitea repository martinvlba at git.martinvlba.eu - Added a new default Gitea repository kuny at git.it-kuny.ch - Added dependency composer/semver version 3.4.0 for composer version comparison compatibility - Added a new class \ncc\Classes\ArchiveExtractor to extract multiple archive types - Refactored \ncc\Objects\RemoteRepository - Refactored the repository system - Refactored Github's repository interface - Refactored Gitlab's repository interface - Refactored SourcesMenu in the CLI to use the new repository system - Updated dependency nikic/php-parser to version 4.17.1 - Added a simple security measure in \ncc\Objects\Value\Entry to delay returns randomly when the password is incorrect - Refactored the CLI menu system to use a return exit code system - Updated the installer to remove unused components and installation steps - Updated dependency Symfony/Filesystem to 6.3.1 - Updated dependency Symfony/polyfill-ctype to 1.28.0 - Enforced credential storage security by applying 600 permissions to the storage file so that only the owner can read/write to the file; this will require root access to perform any operations on the credential file. A password will still be needed to decrypt entries in the file if any entries are encrypted. - Removed \ncc\Classes\NccExtension\Runner in favor of the new Execution Unit system - Removed \ncc\Managers\ExecutionPointerManager in favor of the new Execution Unit system
2023-09-21 17:24:12 -04:00
cp -f $(CONFIG_PATH)/default_repositories.json $(BUILD_PATH)/src/default_repositories.json
cp -f $(CONFIG_PATH)/ncc-package.xml $(BUILD_PATH)/src/ncc-package.xml
cp -f $(INSTALLER_PATH)/extension $(BUILD_PATH)/src/extension
2023-01-29 23:27:56 +00:00
chmod +x $(BUILD_PATH)/src/INSTALL
cp -f LICENSE $(BUILD_PATH)/src/LICENSE
cp -f README.md $(BUILD_PATH)/src/README.md
cp -f $(INSTALLER_PATH)/hash_check.php $(BUILD_PATH)/src/hash_check.php
2023-08-16 11:58:50 -04:00
$(PHPCC) $(BUILD_PATH)/src/hash_check.php
rm $(BUILD_PATH)/src/hash_check.php
cp -f $(INSTALLER_PATH)/generate_build_files.php $(BUILD_PATH)/src/generate_build_files.php
2023-08-16 11:58:50 -04:00
$(PHPCC) $(BUILD_PATH)/src/generate_build_files.php
rm $(BUILD_PATH)/src/generate_build_files.php
$(BUILD_PATH)/build_$(TIMESTAMP).tar.gz: redist
cd $(BUILD_PATH)/src; tar -czvf ../build_$(TIMESTAMP).tar.gz *
2023-08-16 11:58:50 -04:00
.PHONY: tar
tar: $(BUILD_PATH)/build_$(TIMESTAMP).tar.gz
2022-08-11 14:04:33 -04:00
2023-08-16 11:58:50 -04:00
.PHONY: clean
2022-08-11 14:04:33 -04:00
clean:
rm -rf $(BUILD_PATH)
rm -f $(SRC_PATH)/ncc/autoload_spl.php
2023-08-16 11:58:50 -04:00
rm -f $(addsuffix /autoload_spl.php, $(AUTOLOAD_PATHS))
.PHONY: help
help:
@echo "Available commands:"
@echo " make autoload - Generate autoload files"
@echo " make redist - Prepare the project for redistribution"
@echo " make tar - Package the project into a tarball with timestamp"
@echo " make clean - Clean the build artifacts"