Merge lp:~edwin-grubbs/launchpad/bug-524492-spriteutil-make-dependency into lp:launchpad

Proposed by Edwin Grubbs
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~edwin-grubbs/launchpad/bug-524492-spriteutil-make-dependency
Merge into: lp:launchpad
Diff against target: 98 lines (+26/-10)
2 files modified
Makefile (+24/-8)
buildout.cfg (+2/-2)
To merge this branch: bzr merge lp:~edwin-grubbs/launchpad/bug-524492-spriteutil-make-dependency
Reviewer Review Type Date Requested Status
Paul Hummer (community) code Approve
Review via email: mp+20784@code.launchpad.net

Commit message

Add rule so that the Makefile will automatically build bin/sprite-util if it does not exist.

Description of the change

The purpose of this branch is to automatically build bin/sprite-util if necessary. This problem was reported because a branch that has already buildout run will not know to re-run buildout after trunk has been merged into it. Since this problem is unlikely to occur again for sprite-util, I tried to make this solution generally applicable to bin scripts, so whoever adds the next bin script just has to add it to the BUILDOUT_BIN variable and to the dependency list for any new targets that use it.

This branch adds a rule to the Makefile to build any of the bin/ files using buildout (except for buildout itself, which is built with bootstrap).

Test
----

* make bin/py
  * This will run buildout if bin/py does not exist.
* make css_combine
  * This should run bin/sprite-util and bin/combine_css but not buildout.
* rm bin/sprite-util
* make css_combine
  * This should run buildout, bin/sprite-util, and then bin/combine_css.

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) :
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-01 21:41:40 +0000
3+++ Makefile 2010-03-05 22:10:43 +0000
4@@ -33,6 +33,20 @@
5 DEVEL_WADL_FILE = $(APIDOC_DIR)/wadl-$(LPCONFIG)-devel.xml
6 API_INDEX = $(APIDOC_DIR)/index.html
7
8+# Do not add bin/buildout to this list.
9+# It is impossible to get buildout to tell us all the files it would
10+# build, since each egg's setup.py doesn't tell us that information.
11+BUILDOUT_BIN = \
12+ $(PY) bin/apiindex bin/combine-css bin/fl-build-report \
13+ bin/fl-credential-ctl bin/fl-install-demo bin/fl-monitor-ctl \
14+ bin/fl-record bin/fl-run-bench bin/fl-run-test bin/googletestservice \
15+ bin/i18ncompile bin/i18nextract bin/i18nmergeall bin/i18nstats \
16+ bin/harness bin/iharness bin/ipy bin/jsbuild bin/jslint bin/jssize \
17+ bin/jstest bin/killservice bin/kill-test-services bin/lint.sh \
18+ bin/lp-windmill bin/retest bin/run bin/sprite-util \
19+ bin/start_librarian bin/stxdocs bin/tags bin/test bin/tracereport \
20+ bin/twistd bin/update-download-cache bin/windmill
21+
22 # DO NOT ALTER : this should just build by default
23 default: inplace
24
25@@ -116,24 +130,24 @@
26
27 build: compile apidoc jsbuild css_combine
28
29-css_combine: sprite_css
30+css_combine: sprite_css bin/combine-css
31 ${SHHH} bin/combine-css
32
33 sprite_css: ${LP_BUILT_JS_ROOT}/style-3-0.css
34
35-${LP_BUILT_JS_ROOT}/style-3-0.css: ${ICING}/style-3-0.css.in ${ICING}/icon-sprites.positioning
36+${LP_BUILT_JS_ROOT}/style-3-0.css: bin/sprite-util ${ICING}/style-3-0.css.in ${ICING}/icon-sprites.positioning
37 ${SHHH} bin/sprite-util create-css
38
39 sprite_image:
40 ${SHHH} bin/sprite-util create-image
41
42-jsbuild_lazr:
43+jsbuild_lazr: bin/jsbuild
44 # We absolutely do not want to include the lazr.testing module and its
45 # jsTestDriver test harness modifications in the lazr.js and launchpad.js
46 # roll-up files. They fiddle with built-in functions! See Bug 482340.
47 ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/ -c $(LAZR_BUILT_JS_ROOT)/yui
48
49-jsbuild: jsbuild_lazr
50+jsbuild: jsbuild_lazr bin/jsbuild bin/jssize
51 ${SHHH} bin/jsbuild \
52 $(JSFLAGS) \
53 -n launchpad \
54@@ -171,7 +185,8 @@
55 --ez_setup-source=ez_setup.py \
56 --download-base=download-cache/dist --eggs=eggs
57
58-$(PY): bin/buildout versions.cfg $(BUILDOUT_CFG) setup.py
59+# This builds bin/py and all the other bin files except bin/buildout.
60+$(BUILDOUT_BIN): bin/buildout versions.cfg $(BUILDOUT_CFG) setup.py
61 $(SHHH) PYTHONPATH= ./bin/buildout \
62 configuration:instance_name=${LPCONFIG} -c $(BUILDOUT_CFG)
63
64@@ -277,10 +292,10 @@
65 echo Sleeping ${MINS_TO_SHUTDOWN} mins
66 sleep ${MINS_TO_SHUTDOWN}m
67
68-harness:
69+harness: bin/harness
70 bin/harness
71
72-iharness:
73+iharness: bin/iharness
74 bin/iharness
75
76 rebuildfti:
77@@ -397,4 +412,5 @@
78 check check_merge \
79 schema default launchpad.pot check_merge_ui pull scan sync_branches\
80 reload-apache hosted_branches check_db_merge check_mailman check_config\
81- jsbuild clean_js buildonce_eggs
82+ jsbuild jsbuild_lazr clean_js buildonce_eggs \
83+ sprite_css sprite_image css_combine compile
84
85=== modified file 'buildout.cfg'
86--- buildout.cfg 2010-02-19 22:02:36 +0000
87+++ buildout.cfg 2010-03-05 22:10:43 +0000
88@@ -64,8 +64,8 @@
89 'ignore',
90 'Module .+ was already imported from .+, but .+ is being added.*',
91 UserWarning)
92- # XXX: BradCrittenden 2009-12-14 bug=496705: A single, well-known entry point
93- # for initialization work needs to be created.
94+ # XXX: BradCrittenden 2009-12-14 bug=496705: A single, well-known entry point
95+ # for initialization work needs to be created.
96 from lp.services.mime import customizeMimetypes
97 customizeMimetypes()
98 entry-points = stxdocs=zope.configuration.stxdocs:main