Skip to content
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

build: remove duplicated code #13482

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 15 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -487,28 +487,25 @@ out/doc/%: doc/%

# check if ./node is actually set, else use user pre-installed binary
gen-json = tools/doc/generate.js --format=json $< > $@
out/doc/api/%.json: doc/api/%.md
@[ -e tools/doc/node_modules/js-yaml/package.json ] || \
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \
--template=doc/template.html --analytics=$(DOCS_ANALYTICS) $< > $@

gen-doc = \
[ -e tools/doc/node_modules/js-yaml/package.json ] || \
[ -e tools/eslint/node_modules/js-yaml/package.json ] || \
if [ -x $(NODE) ]; then \
cd tools/doc && ../../$(NODE) ../../$(NPM) install; \
else \
cd tools/doc && node ../../$(NPM) install; \
fi
[ -x $(NODE) ] && $(NODE) $(gen-json) || node $(gen-json)
fi;\
[ -x $(NODE) ] && $(NODE) $(gen-json) || node

out/doc/api/%.json: doc/api/%.md
$(gen-doc) $(gen-json)

# check if ./node is actually set, else use user pre-installed binary
gen-html = tools/doc/generate.js --node-version=$(FULLVERSION) --format=html \
--template=doc/template.html --analytics=$(DOCS_ANALYTICS) $< > $@
out/doc/api/%.html: doc/api/%.md
@[ -e tools/doc/node_modules/js-yaml/package.json ] || \
[ -e tools/eslint/node_modules/js-yaml/package.json ] || \
if [ -x $(NODE) ]; then \
cd tools/doc && ../../$(NODE) ../../$(NPM) install; \
else \
cd tools/doc && node ../../$(NPM) install; \
fi
[ -x $(NODE) ] && $(NODE) $(gen-html) || node $(gen-html)
$(gen-doc) $(gen-html)

docopen: $(apidocs_html)
@$(PYTHON) -mwebbrowser file://$(PWD)/out/doc/api/all.html
Expand Down Expand Up @@ -866,15 +863,17 @@ bench: bench-net bench-http bench-fs bench-tls

bench-ci: bench

JSLINT_TARGETS = benchmark doc lib test tools

jslint:
@echo "Running JS linter..."
$(NODE) tools/eslint/bin/eslint.js --cache --rulesdir=tools/eslint-rules --ext=.js,.md \
benchmark doc lib test tools
$(JSLINT_TARGETS)

jslint-ci:
@echo "Running JS linter..."
$(NODE) tools/jslint.js $(PARALLEL_ARGS) -f tap -o test-eslint.tap \
benchmark doc lib test tools
$(JSLINT_TARGETS)

CPPLINT_EXCLUDE ?=
CPPLINT_EXCLUDE += src/node_root_certs.h
Expand Down