Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit b193e34

Browse files
added build rules for language handler aliases so that lang-scm.js in the loader works even though there is only a source for lang-lisp.js which registers a handler for lang-scm
1 parent abb06d9 commit b193e34

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,13 @@ distrib.tstamp: src/prettify.js src/run_prettify.js src/*.js src/*.css
8080
done
8181
@touch distrib.tstamp
8282

83+
lang-aliases : lang-aliases.tstamp
84+
lang-aliases.tstamp : distrib.tstamp
85+
@tools/lang-handler-aliases.sh \
86+
distrib/sources/google-code-prettify/src \
87+
| perl -ne 'system("cp $$1 $$2") if m/^(\S+) (\S+)$$/ && ! -e $$2' \
88+
&& touch lang-aliases.tstamp
89+
8390
%.tgz: %.tar
8491
@gzip -c -9 $^ > $@
8592

@@ -101,3 +108,4 @@ distrib/prettify.tar: distrib.tstamp
101108
examples js-modules src styles tests tools \
102109
distrib/sources/google-code-prettify
103110
tar cf distrib/prettify.tar -C distrib/sources google-code-prettify
111+

tools/cut-release.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ fi
123123
# Make the distribution
124124
function build() {
125125
pushd "$VERSION_BASE/trunk" > /dev/null
126-
make distrib distrib/prettify.tar.bz2 distrib/prettify-small.tar.bz2
126+
make clean \
127+
&& make distrib distrib/prettify.tar.bz2 distrib/prettify-small.tar.bz2 \
128+
&& make lang-aliases
127129
local status=$?
128130
popd > /dev/null
129131
(($status))

tools/lang-handler-aliases.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ if [ -n "$*" ] || [ -z "$LANG_DIR" ] || ! (( $HAS_LANG_FILES )); then
1212
echo "Usage: $0 <LANG_DIR>"
1313
echo
1414
echo "Dumps lines of the form"
15-
echo " lang-foo.js : <extension>"
15+
echo " $LANG_DIR/lang-foo.js $LANG_DIR/lang-<extension>.js"
1616
echo "where the first element is a path name under LANG_DIR"
1717
echo "and the second is the name of a language extension for which"
1818
echo "it registers an extension."
@@ -60,6 +60,8 @@ for JS in "$LANG_DIR"/lang-*.js; do
6060
"$JS" \
6161
< /dev/null \
6262
|| echo "Failed to execute $JS" 1>&2 ) \
63-
| perl -e '$BASE=shift; while (<STDIN>) { s/^(?=\w)/$BASE : /; print; }' \
64-
"$(basename "$JS")"
63+
| perl -e '$JS=shift;' \
64+
-e 'use File::Basename; $DIR=dirname($JS);' \
65+
-e 'while (<STDIN>) { s/^\w+$/$JS $DIR\/lang-$&.js/; print; }' \
66+
"$JS"
6567
done

0 commit comments

Comments
 (0)