From 831face7d1ef553af28f906bc289bfb2737cd007 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 5 Dec 2021 15:51:48 +0000 Subject: [PATCH] build: skip documentation generation if no ICU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes: https://github.com/nodejs/node/issues/41077 PR-URL: https://github.com/nodejs/node/pull/41091 Fixes: https://github.com/nodejs/node/issues/41077 Reviewed-By: Richard Lau Reviewed-By: Luigi Pinca Reviewed-By: Michaƫl Zasso Reviewed-By: Antoine du Hamel --- Makefile | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 827d401cbfcd26..e25baa475bfa24 100644 --- a/Makefile +++ b/Makefile @@ -737,21 +737,39 @@ $(LINK_DATA): $(wildcard lib/*.js) tools/doc/apilinks.mjs | out/doc $(VERSIONS_DATA): CHANGELOG.md src/node_version.h tools/doc/versions.mjs $(call available-node, tools/doc/versions.mjs $@) +node_use_icu = $(call available-node,"-p" "typeof Intl === 'object'") + out/doc/api/%.json out/doc/api/%.html: doc/api/%.md tools/doc/generate.mjs \ tools/doc/markdown.mjs tools/doc/html.mjs tools/doc/json.mjs \ tools/doc/apilinks.mjs $(VERSIONS_DATA) | $(LINK_DATA) out/doc/api - $(call available-node, $(gen-api)) + @if [ "$(shell $(node_use_icu))" != "true" ]; then \ + echo "Skipping documentation generation (no ICU)"; \ + else \ + $(call available-node, $(gen-api)) \ + fi out/doc/api/all.html: $(apidocs_html) tools/doc/allhtml.mjs \ tools/doc/apilinks.mjs | out/doc/api - $(call available-node, tools/doc/allhtml.mjs) + @if [ "$(shell $(node_use_icu))" != "true" ]; then \ + echo "Skipping HTML single-page doc generation (no ICU)"; \ + else \ + $(call available-node, tools/doc/allhtml.mjs) \ + fi out/doc/api/all.json: $(apidocs_json) tools/doc/alljson.mjs | out/doc/api - $(call available-node, tools/doc/alljson.mjs) + @if [ "$(shell $(node_use_icu))" != "true" ]; then \ + echo "Skipping JSON single-file generation (no ICU)"; \ + else \ + $(call available-node, tools/doc/alljson.mjs) \ + fi .PHONY: out/doc/api/stability out/doc/api/stability: out/doc/api/all.json tools/doc/stability.mjs | out/doc/api - $(call available-node, tools/doc/stability.mjs) + @if [ "$(shell $(node_use_icu))" != "true" ]; then \ + echo "Skipping stability indicator generation (no ICU)"; \ + else \ + $(call available-node, tools/doc/stability.mjs) \ + fi .PHONY: docopen docopen: out/doc/api/all.html