зеркало из https://github.com/mozilla/popcorn-js.git
Add parsers to popcorn-complete, linting, plus fixes to parsers for minification/linting [ticket #367].
This commit is contained in:
Родитель
02a9c1f1be
Коммит
99159c3a6d
36
Makefile
36
Makefile
|
@ -3,6 +3,7 @@ PREFIX = .
|
|||
BUILD_DIR = ${PREFIX}/build
|
||||
DIST_DIR = ${PREFIX}/dist
|
||||
PLUGINS_DIR = ${PREFIX}/plugins
|
||||
PARSERS_DIR = ${PREFIX}/parsers
|
||||
|
||||
RHINO ?= java -jar ${BUILD_DIR}/js.jar
|
||||
|
||||
|
@ -25,16 +26,25 @@ POPCORN_MIN = ${DIST_DIR}/popcorn.min.js
|
|||
PLUGINS_DIST = ${DIST_DIR}/popcorn.plugins.js
|
||||
PLUGINS_MIN = ${DIST_DIR}/popcorn.plugins.min.js
|
||||
|
||||
# plugins
|
||||
PARSERS_DIST = ${DIST_DIR}/popcorn.parsers.js
|
||||
PARSERS_MIN = ${DIST_DIR}/popcorn.parsers.min.js
|
||||
|
||||
# Grab all popcorn.<plugin-name>.js files from plugins dir
|
||||
PLUGINS_SRC := $(filter-out %unit.js, $(shell find ${PLUGINS_DIR} -name 'popcorn.*.js' -print))
|
||||
|
||||
# Grab all popcorn.<plugin-name>.js files from plugins dir
|
||||
PARSERS_SRC := $(filter-out %unit.js, $(shell find ${PARSERS_DIR} -name 'popcorn.*.js' -print))
|
||||
|
||||
# popcorn + plugins
|
||||
POPCORN_COMPLETE_LIST := --js ${POPCORN_SRC} $(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done)
|
||||
POPCORN_COMPLETE_LIST := --js ${POPCORN_SRC} \
|
||||
$(shell for js in ${PLUGINS_SRC} ; do echo --js $$js ; done) \
|
||||
$(shell for js in ${PARSERS_SRC} ; do echo --js $$js ; done)
|
||||
POPCORN_COMPLETE_DIST = ${DIST_DIR}/popcorn-complete.js
|
||||
POPCORN_COMPLETE_MIN = ${DIST_DIR}/popcorn-complete.min.js
|
||||
|
||||
|
||||
all: lint lint-plugins popcorn plugins min complete
|
||||
all: lint lint-plugins lint-parsers popcorn plugins parsers complete min
|
||||
@@echo "Popcorn build complete."
|
||||
|
||||
${DIST_DIR}:
|
||||
|
@ -46,13 +56,13 @@ ${POPCORN_DIST}: ${POPCORN_SRC} | ${DIST_DIR}
|
|||
@@echo "Building" ${POPCORN_DIST}
|
||||
@@cp ${POPCORN_SRC} ${POPCORN_DIST}
|
||||
|
||||
min: ${POPCORN_MIN} ${PLUGINS_MIN} ${POPCORN_COMPLETE_MIN}
|
||||
min: ${POPCORN_MIN} ${PLUGINS_MIN} ${PARSERS_MIN} ${POPCORN_COMPLETE_MIN}
|
||||
|
||||
${POPCORN_MIN}: ${POPCORN_DIST}
|
||||
@@echo "Building" ${POPCORN_MIN}
|
||||
$(call compile, --js ${POPCORN_DIST}, ${POPCORN_MIN})
|
||||
|
||||
${POPCORN_COMPLETE_MIN}: ${POPCORN_SRC} ${PLUGINS_SRC} ${DIST_DIR}
|
||||
${POPCORN_COMPLETE_MIN}: ${POPCORN_SRC} ${PLUGINS_SRC} ${PARSERS_SRC} ${DIST_DIR}
|
||||
@@echo "Building" ${POPCORN_COMPLETE_MIN}
|
||||
@@$(call compile, ${POPCORN_COMPLETE_LIST}, ${POPCORN_COMPLETE_MIN})
|
||||
|
||||
|
@ -66,9 +76,19 @@ ${PLUGINS_DIST}: ${PLUGINS_SRC} ${DIST_DIR}
|
|||
@@echo "Building ${PLUGINS_DIST}"
|
||||
@@cat ${PLUGINS_SRC} > ${PLUGINS_DIST}
|
||||
|
||||
parsers: ${PARSERS_DIST}
|
||||
|
||||
${PARSERS_MIN}: ${PARSERS_DIST}
|
||||
@@echo "Building" ${PARSERS_MIN}
|
||||
$(call compile, $(shell for js in ${PARSERS_SRC} ; do echo --js $$js ; done), ${PARSERS_MIN})
|
||||
|
||||
${PARSERS_DIST}: ${PARSERS_SRC} ${DIST_DIR}
|
||||
@@echo "Building ${PARSERS_DIST}"
|
||||
@@cat ${PARSERS_SRC} > ${PARSERS_DIST}
|
||||
|
||||
complete: ${POPCORN_SRC} ${PLUGINS_SRC} ${DIST_DIR}
|
||||
@@echo "Building popcorn + plugins"
|
||||
@@cat ${POPCORN_SRC} ${PLUGINS_SRC} > ${POPCORN_COMPLETE_DIST}
|
||||
@@echo "Building popcorn + plugins + parsers"
|
||||
@@cat ${POPCORN_SRC} ${PLUGINS_SRC} ${PARSERS_SRC} > ${POPCORN_COMPLETE_DIST}
|
||||
|
||||
lint:
|
||||
@@echo "Checking Popcorn against JSLint..."
|
||||
|
@ -78,6 +98,10 @@ lint-plugins:
|
|||
@@echo "Checking all plugins against JSLint..."
|
||||
@@${RHINO} build/jslint-check.js ${PLUGINS_SRC}
|
||||
|
||||
lint-parsers:
|
||||
@@echo "Checking all parsers against JSLint..."
|
||||
@@${RHINO} build/jslint-check.js ${PARSERS_SRC}
|
||||
|
||||
clean:
|
||||
@@echo "Removing Distribution directory:" ${DIST_DIR}
|
||||
@@rm -rf ${DIST_DIR}
|
||||
|
|
|
@ -168,4 +168,3 @@
|
|||
});
|
||||
|
||||
})( Popcorn );
|
||||
;
|
|
@ -147,7 +147,7 @@
|
|||
// TODO: how to deal with functions, eval strings?
|
||||
onStart: {elem:'input', type:'text', label:'onStart'},
|
||||
onFrame: {elem:'input', type:'text', label:'onFrame'},
|
||||
onEnd: {elem:'input', type:'text', label:'onEnd'},
|
||||
onEnd: {elem:'input', type:'text', label:'onEnd'}
|
||||
}
|
||||
});
|
||||
})( Popcorn );
|
||||
|
|
Загрузка…
Ссылка в новой задаче