-
Notifications
You must be signed in to change notification settings - Fork 1
fix(makefile): extract custom npm packages build as build_custom_npms… #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
13cf95e
fix(makefile): correct typo in .PHONY declaration
printminion-co 6a0bb61
feat(makefile): add missing targets to .PHONY and comprehensive clean…
printminion-co 366c5bc
refactor(makefile): organize .PHONY declarations with logical grouping
printminion-co c45bfa7
docs(makefile): add documentation comments for configuration and envi…
printminion-co c794844
fix(makefile): extract custom npm packages build as build_custom_npms…
printminion-co 3a4a9b4
fix(makefile): add build_nextcloud_only target for HiDrive Next build
printminion-co 4ff62f2
fix(makefile): restore help target functionality
printminion-co 117961b
fix(makefile): suppress echo output for build messages
printminion-co d262109
chore(makefile): Reformat TARGET_PACKAGE_NAME variable
printminion-co 51da5e4
fix(makefile): add environment variable validation for custom npm builds
printminion-co a87d3d7
fix(makefile): add echo statements for build process visibility
printminion-co a9b4da3
fix(makefile): update echo statements for build process clarity
printminion-co File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,91 @@ | ||
| # SPDX-FileCopyrightText: 2024 Kai Henseler <[email protected]> | ||
| # SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
|
||
| TARGET_PACKAGE_NAME=hidrivenext-server.zip | ||
| # Build configuration | ||
| TARGET_PACKAGE_NAME = hidrivenext-server.zip | ||
|
|
||
| # Required environment variables: | ||
| # - FONTAWESOME_PACKAGE_TOKEN: Token for FontAwesome package access | ||
|
|
||
| # Environment variable validation | ||
| check-env: | ||
| @if [ -z "$(FONTAWESOME_PACKAGE_TOKEN)" ]; then \ | ||
| echo "Error: FONTAWESOME_PACKAGE_TOKEN environment variable is not set"; \ | ||
| echo "Please set it before building custom npm packages"; \ | ||
| exit 1; \ | ||
| fi | ||
|
|
||
| # Core build targets | ||
| .PHONY: help clean .remove_node_modules check-env | ||
| # Custom NPM packages | ||
| .PHONY: build_custom_npms build_mdi_svg build_mdi_js build_vue_icons_package build_nextcloud_vue | ||
| # Main Nextcloud build | ||
| .PHONY: build_nextcloud build_nextcloud_only | ||
| # Applications | ||
| .PHONY: build_dep_simplesettings_app build_dep_nc_ionos_processes_app build_dep_user_oidc_app build_dep_viewer_app build_richdocuments_app build_dep_theming_app | ||
| # Themes | ||
| .PHONY: build_dep_ionos_theme | ||
| # Configuration and packaging | ||
| .PHONY: add_config_partials patch_shipped_json version.json zip_dependencies | ||
| # Meta targets | ||
| .PHONY: .build_deps build_release build_locally | ||
|
|
||
| .PHONY: help .build_deps add_config_partials build_release build_locally build_dep_ionos_theme build_dep_nc_ionos_processes_app build_dep_simplesettings_app build_richdocuments_app build_dep_user_oidc_app zip_dependencies patch_shippend_json version.json | ||
| # HELP | ||
| # This will output the help for each task | ||
| # thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html | ||
| .DEFAULT_GOAL := help | ||
|
|
||
| help: ## This help. | ||
| @echo "Usage: make [target]" | ||
| @echo "" | ||
| @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | ||
| # HELP | ||
| # This will output the help for each task | ||
| # thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html | ||
| .DEFAULT_GOAL := help | ||
|
|
||
| clean: ## Clean up build artifacts | ||
| @echo "[i] Cleaning build artifacts..." | ||
| rm -rf node_modules | ||
| rm -f version.json | ||
| rm -f $(TARGET_PACKAGE_NAME) | ||
|
|
||
| .remove_node_modules: ## Remove node_modules | ||
| @echo "[i] Removing node_modules directories..." | ||
| rm -rf node_modules | ||
|
|
||
| build_mdi_svg: ## Build custom mdi svg | ||
| build_mdi_svg: check-env ## Build custom mdi svg | ||
| @echo "[i] Building custom MDI SVG package..." | ||
| cd custom-npms/nc-mdi-svg && \ | ||
| FONTAWESOME_PACKAGE_TOKEN=$(FONTAWESOME_PACKAGE_TOKEN) npm ci && \ | ||
| npm run build | ||
|
|
||
| build_mdi_js: ## Build custom mdi js | ||
| @echo "[i] Building custom MDI JS package..." | ||
| cd custom-npms/nc-mdi-js && \ | ||
| npm ci && \ | ||
| npm run build | ||
|
|
||
| build_vue_icons_package: ## Build custom vue icons package | ||
| @echo "[i] Building custom Vue icons package..." | ||
| cd custom-npms/nc-vue-material-design-icons && \ | ||
| npm ci && \ | ||
| npm run build | ||
|
|
||
| build_nextcloud_vue: ## Build custom nextcloud vue | ||
| @echo "[i] Building custom Nextcloud Vue package..." | ||
| cd custom-npms/nc-nextcloud-vue && \ | ||
| npm ci && \ | ||
| npm run build | ||
|
|
||
| build_nextcloud: build_mdi_svg build_mdi_js build_vue_icons_package build_nextcloud_vue ## Build Nextcloud | ||
| build_custom_npms: .remove_node_modules build_mdi_svg build_mdi_js build_vue_icons_package build_nextcloud_vue ## Build all custom npm packages | ||
| @echo "[i] Custom npm packages built" | ||
|
|
||
| build_nextcloud_only: ## Build HiDrive Next only (no custom npm packages rebuild) | ||
| set -e && \ | ||
| composer install --no-dev -o && \ | ||
| npm ci && \ | ||
| NODE_OPTIONS="--max-old-space-size=4096" npm run build | ||
|
|
||
| build_nextcloud: build_custom_npms build_nextcloud_only ## Build HiDrive Next (rebuild custom npm packages) | ||
| @echo "[i] HiDrive Next built" | ||
|
|
||
| build_dep_simplesettings_app: ## Install and build simplesettings app | ||
| cd apps-custom/simplesettings && \ | ||
| npm ci && \ | ||
|
|
@@ -79,21 +123,24 @@ build_dep_theming_app: ## Build the custom css | |
| make build_css | ||
|
|
||
| add_config_partials: ## Copy custom config files to Nextcloud config | ||
| @echo "[i] Copying config files..." | ||
| cp IONOS/configs/*.config.php config/ | ||
|
|
||
| patch_shippend_json: ## Patch shipped.json to make core apps disableable | ||
| patch_shipped_json: ## Patch shipped.json to make core apps disableable | ||
| @echo "[i] Patching shipped.json..." | ||
| IONOS/apps-disable.sh | ||
|
|
||
| version.json: ## Generate version file | ||
| @echo "[i] Generating version.json..." | ||
| buildDate=$$(date +%s) && \ | ||
| buildRef=$$(git rev-parse --short HEAD) && \ | ||
| ncVersion=$$(php -r 'include("version.php");echo implode(".", $$OC_Version);') && \ | ||
| jq -n --arg buildDate $$buildDate --arg buildRef $$buildRef --arg ncVersion $$ncVersion '{buildDate: $$buildDate, buildRef: $$buildRef, ncVersion: $$ncVersion}' > version.json && \ | ||
| echo "version.json created" && \ | ||
| echo "[i] version.json created" && \ | ||
| jq . version.json | ||
|
|
||
| zip_dependencies: patch_shippend_json version.json ## Zip relevant files | ||
| echo "zip relevant files to $(TARGET_PACKAGE_NAME)" && \ | ||
| zip_dependencies: patch_shipped_json version.json ## Zip relevant files | ||
| @echo "[i] zip relevant files to $(TARGET_PACKAGE_NAME)" && \ | ||
| zip -r "$(TARGET_PACKAGE_NAME)" \ | ||
| IONOS/ \ | ||
| 3rdparty/ \ | ||
|
|
@@ -151,7 +198,7 @@ zip_dependencies: patch_shippend_json version.json ## Zip relevant files | |
| .build_deps: build_dep_viewer_app build_richdocuments_app build_dep_simplesettings_app build_dep_nc_ionos_processes_app build_dep_user_oidc_app build_dep_ionos_theme build_dep_theming_app | ||
|
|
||
| build_release: build_nextcloud .build_deps add_config_partials zip_dependencies ## Build a release package (build apps/themes, copy configs and package) | ||
| echo "Everything done for a release" | ||
| @echo "[i] Everything done for a release" | ||
|
|
||
| build_locally: .remove_node_modules build_nextcloud .build_deps ## Build all apps/themes for local development | ||
| echo "Everything done for local/dev" | ||
| build_locally: build_nextcloud .build_deps ## Build all apps/themes for local development | ||
| @echo "[i] Everything done for local/dev" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.