mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 03:53:32 +01:00
Everywhere: Remove everything non-essential for "make clean all"
This commit removes everything not strictly necessary for running "make clean all" inside jw-build. packaging jw-devtest. This cuts the repo down from 24077 to 4725 lines of code. The idea is to 1) Further remove bloat from the remaining bits 2) Re-add what's necessary to build and package other essential repos. The decision should be based on whether or not jw-build can also be useful in a non-janware context. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
c36c83c164
commit
bc883deed4
199 changed files with 0 additions and 18851 deletions
31
make/js.mk
31
make/js.mk
|
|
@ -1,31 +0,0 @@
|
|||
JAVA ?= /usr/bin/java
|
||||
JS_MINIFY_FILTER_IN ?= sed 's/console\.[a-z]\+([^)]\+) *;//g'
|
||||
JS_SRC ?= $(filter-out %.min.js,$(wildcard *.js))
|
||||
JS_GENERATED ?= $(patsubst %.js,%.min.js,$(JS_SRC))
|
||||
JS_EXTRA_EXTERNS ?=
|
||||
JS_CC_BUILD_ROOT ?= $(PROJECTS_DIR)/closure-compiler/contrib/closure-compiler/install-root
|
||||
JS_EXTERNS_DIRS ?= $(firstword $(wildcard $(JS_CC_BUILD_ROOT)/$(realpath $(PROJECTS_DIR))/closure-compiler/share/externs /opt/closure-compiler/share/externs))
|
||||
JS_EXTERNS ?= $(sort $(JS_EXTRA_EXTERNS) jquery-3.3.js)
|
||||
JS_EXTERN_PATHS ?= $(wildcard $(foreach d,$(JS_EXTERNS_DIRS),$(addprefix $d/,$(JS_EXTERNS))))
|
||||
JS_MINIFY_OPTS ?= $(addprefix --externs ,$(JS_EXTERN_PATHS)) --compilation_level ADVANCED --strict_mode_input
|
||||
JS_MINIFY_EXE ?= $(JAVA) -jar $(firstword $(wildcard \
|
||||
$(JS_CC_BUILD_ROOT)/usr/share/java/closure-compiler.jar \
|
||||
/usr/share/java/closure-compiler.jar \
|
||||
) closure-compiler.jar-not-found)
|
||||
JS_MINIFY ?= $(JS_MINIFY_EXE) $(JS_MINIFY_OPTS)
|
||||
|
||||
# This is not nice. It requires install-files to be included from elsewhere,
|
||||
# which is not obvious. OTOH, if it isn't, SOURCE_FILES doesn't do any harm,
|
||||
# either.
|
||||
SOURCE_FILES += $(JS_GENERATED)
|
||||
|
||||
all: $(JS_GENERATED)
|
||||
clean: minify.clean
|
||||
|
||||
%.min.js: %.js
|
||||
cat $< | $(JS_MINIFY_FILTER_IN) > $@.filtered
|
||||
$(JS_MINIFY) $@.filtered > $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
minify.clean:
|
||||
rm -f $(JS_GENERATED) *.tmp *.filtered
|
||||
Loading…
Add table
Add a link
Reference in a new issue