Merge lp:~rockstar/launchpad/code-js-move into lp:launchpad

Proposed by Paul Hummer
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~rockstar/launchpad/code-js-move
Merge into: lp:launchpad
Prerequisite: lp:~rockstar/launchpad/code-js-file-reorg
Diff against target: 52 lines (+36/-0)
2 files modified
Makefile (+1/-0)
utilities/lp-deps.py (+35/-0)
To merge this branch: bzr merge lp:~rockstar/launchpad/code-js-move
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+22656@code.launchpad.net

Description of the change

This branch moves lib/canonical/launchpad/javascript/code to
lib/lp/code/javascript. That's all, very mechanical.

To post a comment you must log in.
Revision history for this message
Brad Crittenden (bac) wrote :

Nice new script. As we discussed on IRC please chat with Curtis before landing this just to coordinate the new work he's done on javascript test discovery, as a courtesy.

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 2010-03-26 13:23:20 +0000
3+++ Makefile 2010-04-05 17:14:33 +0000
4@@ -149,6 +149,7 @@
5 -s lib/canonical/launchpad/javascript \
6 -b $(LP_BUILT_JS_ROOT) \
7 $(shell $(HERE)/utilities/yui-deps.py) \
8+ $(shell $(HERE)/utilities/lp-deps.py) \
9 lib/canonical/launchpad/icing/lazr/build/lazr.js
10 ${SHHH} bin/jssize
11
12
13=== renamed directory 'lib/canonical/launchpad/javascript/code' => 'lib/lp/code/javascript'
14=== added file 'utilities/lp-deps.py'
15--- utilities/lp-deps.py 1970-01-01 00:00:00 +0000
16+++ utilities/lp-deps.py 2010-04-05 17:14:33 +0000
17@@ -0,0 +1,35 @@
18+#!/usr/bin/python
19+#
20+# Copyright 2010 Canonical Ltd. This software is licensed under the
21+# GNU Affero General Public License version 3 (see the file LICENSE).
22+
23+"""Print the Launchpad javascript files we are using.
24+
25+The output of this script is meant to be given to the jsbuild script so that
26+they are included in the launchpad.js file.
27+"""
28+
29+__metaclass__ = type
30+
31+import os
32+import sys
33+
34+TOP = os.path.abspath(
35+ os.path.join(os.path.dirname(__file__), '..'))
36+# JS_DIRSET is a tuple of the dir where the code exists, and the name of the
37+# symlink it should be linked as in the icing build directory.
38+JS_DIRSET = [
39+ (os.path.join('lib', 'lp', 'code', 'javascript'), 'code'),]
40+ICING_ROOT = os.path.join(TOP, 'lib', 'canonical', 'launchpad', 'icing')
41+ICING_BUILD = os.path.join(ICING_ROOT, 'build')
42+
43+for DIRSET in JS_DIRSET:
44+ full_dir = os.path.join(TOP, DIRSET[0])
45+ # We don't want the tests to be included. If we want to nest the files in
46+ # more folders though, this is where we change it.
47+ for filename in os.listdir(full_dir):
48+ if filename.endswith('.js'):
49+ absolute_filename = os.path.join(full_dir, filename)
50+ print absolute_filename
51+
52+ os.symlink(full_dir, os.path.join(ICING_BUILD, DIRSET[1]))