Merge lp:~stevenk/launchpad/two-part-combobuild into lp:launchpad

Proposed by Steve Kowalik
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 14802
Proposed branch: lp:~stevenk/launchpad/two-part-combobuild
Merge into: lp:launchpad
Diff against target: 72 lines (+21/-17)
3 files modified
Makefile (+5/-3)
buildout-templates/bin/combo-rootdir.in (+0/-14)
utilities/check-js-deps (+16/-0)
To merge this branch: bzr merge lp:~stevenk/launchpad/two-part-combobuild
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+93125@code.launchpad.net

Commit message

Split combobuild into two sections, one that is run under jsbuild.

Description of the change

Make bin/combo-rootdir safe to run anywhere, since it no longer needs convoy.

Only generate the meta file in combobuild. Split out the code that checked the meta file into a separate script, utilites/check-js-deps and call it from combobuild.

Remove the convoy root before linking it, otherwise ln creates a js directory in build/js.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2012-02-13 01:13:43 +0000
3+++ Makefile 2012-02-15 04:17:22 +0000
4@@ -142,7 +142,7 @@
5 chmod 777 $(CODEHOSTING_ROOT)/rewrite.log
6 touch $(CODEHOSTING_ROOT)/config/launchpad-lookup.txt
7 if [ -d /srv/launchpad.dev ]; then \
8- ln -sf $(WD)/build/js $(CONVOY_ROOT); \
9+ ln -sfn $(WD)/build/js $(CONVOY_ROOT); \
10 fi
11
12 build: compile apidoc jsbuild css_combine sprite_image
13@@ -189,10 +189,12 @@
14 endif
15
16 combobuild:
17+ utilities/js-deps -n LP_MODULES -s build/js/lp -x '-min.js' -o build/js/lp/meta.js >/dev/null
18+ utilities/check-js-deps
19+
20+jsbuild: $(PY) $(JS_OUT)
21 bin/combo-rootdir build/js
22
23-jsbuild: $(PY) $(JS_OUT)
24-
25 eggs:
26 # Usually this is linked via link-external-sourcecode, but in
27 # deployment we create this ourselves.
28
29=== modified file 'buildout-templates/bin/combo-rootdir.in'
30--- buildout-templates/bin/combo-rootdir.in 2012-02-14 01:34:27 +0000
31+++ buildout-templates/bin/combo-rootdir.in 2012-02-15 04:17:22 +0000
32@@ -39,19 +39,5 @@
33 cp lib/lp/services/worlddata/javascript/languages.js $BUILD_DIR/lp
34 cp lib/lp/app/longpoll/javascript/longpoll.js $BUILD_DIR/lp
35
36-# Build the LP module definition file.
37-utilities/js-deps -n LP_MODULES -s $BUILD_DIR/lp -o $BUILD_DIR/lp/meta.js >/dev/null
38-
39 # Minify our JS.
40 bin/py -m lp.scripts.utilities.js.jsmin_all $BUILD_DIR/lp
41-
42-# Check if any JS modules are missing.
43-error=0
44-for mod in $(grep ' LP' $BUILD_DIR/lp/meta.js | tr -s ' ' | cut -d\ -f2) ; do
45- if ! grep -q "modules\[$mod\]" $BUILD_DIR/lp/meta.js ; then
46- echo "ERROR: $mod is not mentioned in the meta file"
47- error=1
48- fi
49-done
50-
51-exit $error
52
53=== added file 'utilities/check-js-deps'
54--- utilities/check-js-deps 1970-01-01 00:00:00 +0000
55+++ utilities/check-js-deps 2012-02-15 04:17:22 +0000
56@@ -0,0 +1,16 @@
57+#!/bin/sh
58+
59+# Copyright 2012 Canonical Ltd. This software is licensed under the
60+# GNU Affero General Public License version 3 (see the file LICENSE).
61+
62+set -e
63+
64+error=0
65+for mod in $(grep ' LP' build/js/lp/meta.js | tr -s ' ' | cut -d\ -f2) ; do
66+ if ! grep -q "modules\[$mod\]" build/js/lp/meta.js ; then
67+ echo "ERROR: $mod is not mentioned in the meta file"
68+ error=1
69+ fi
70+done
71+exit $error
72+