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
=== modified file 'Makefile'
--- Makefile 2010-03-01 21:41:40 +0000
+++ Makefile 2010-03-05 22:10:43 +0000
@@ -33,6 +33,20 @@
33DEVEL_WADL_FILE = $(APIDOC_DIR)/wadl-$(LPCONFIG)-devel.xml33DEVEL_WADL_FILE = $(APIDOC_DIR)/wadl-$(LPCONFIG)-devel.xml
34API_INDEX = $(APIDOC_DIR)/index.html34API_INDEX = $(APIDOC_DIR)/index.html
3535
36# Do not add bin/buildout to this list.
37# It is impossible to get buildout to tell us all the files it would
38# build, since each egg's setup.py doesn't tell us that information.
39BUILDOUT_BIN = \
40 $(PY) bin/apiindex bin/combine-css bin/fl-build-report \
41 bin/fl-credential-ctl bin/fl-install-demo bin/fl-monitor-ctl \
42 bin/fl-record bin/fl-run-bench bin/fl-run-test bin/googletestservice \
43 bin/i18ncompile bin/i18nextract bin/i18nmergeall bin/i18nstats \
44 bin/harness bin/iharness bin/ipy bin/jsbuild bin/jslint bin/jssize \
45 bin/jstest bin/killservice bin/kill-test-services bin/lint.sh \
46 bin/lp-windmill bin/retest bin/run bin/sprite-util \
47 bin/start_librarian bin/stxdocs bin/tags bin/test bin/tracereport \
48 bin/twistd bin/update-download-cache bin/windmill
49
36# DO NOT ALTER : this should just build by default50# DO NOT ALTER : this should just build by default
37default: inplace51default: inplace
3852
@@ -116,24 +130,24 @@
116130
117build: compile apidoc jsbuild css_combine131build: compile apidoc jsbuild css_combine
118132
119css_combine: sprite_css133css_combine: sprite_css bin/combine-css
120 ${SHHH} bin/combine-css134 ${SHHH} bin/combine-css
121135
122sprite_css: ${LP_BUILT_JS_ROOT}/style-3-0.css136sprite_css: ${LP_BUILT_JS_ROOT}/style-3-0.css
123137
124${LP_BUILT_JS_ROOT}/style-3-0.css: ${ICING}/style-3-0.css.in ${ICING}/icon-sprites.positioning138${LP_BUILT_JS_ROOT}/style-3-0.css: bin/sprite-util ${ICING}/style-3-0.css.in ${ICING}/icon-sprites.positioning
125 ${SHHH} bin/sprite-util create-css139 ${SHHH} bin/sprite-util create-css
126140
127sprite_image:141sprite_image:
128 ${SHHH} bin/sprite-util create-image142 ${SHHH} bin/sprite-util create-image
129143
130jsbuild_lazr:144jsbuild_lazr: bin/jsbuild
131 # We absolutely do not want to include the lazr.testing module and its145 # We absolutely do not want to include the lazr.testing module and its
132 # jsTestDriver test harness modifications in the lazr.js and launchpad.js146 # jsTestDriver test harness modifications in the lazr.js and launchpad.js
133 # roll-up files. They fiddle with built-in functions! See Bug 482340.147 # roll-up files. They fiddle with built-in functions! See Bug 482340.
134 ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/ -c $(LAZR_BUILT_JS_ROOT)/yui148 ${SHHH} bin/jsbuild $(JSFLAGS) -b $(LAZR_BUILT_JS_ROOT) -x testing/ -c $(LAZR_BUILT_JS_ROOT)/yui
135149
136jsbuild: jsbuild_lazr150jsbuild: jsbuild_lazr bin/jsbuild bin/jssize
137 ${SHHH} bin/jsbuild \151 ${SHHH} bin/jsbuild \
138 $(JSFLAGS) \152 $(JSFLAGS) \
139 -n launchpad \153 -n launchpad \
@@ -171,7 +185,8 @@
171 --ez_setup-source=ez_setup.py \185 --ez_setup-source=ez_setup.py \
172 --download-base=download-cache/dist --eggs=eggs186 --download-base=download-cache/dist --eggs=eggs
173187
174$(PY): bin/buildout versions.cfg $(BUILDOUT_CFG) setup.py188# This builds bin/py and all the other bin files except bin/buildout.
189$(BUILDOUT_BIN): bin/buildout versions.cfg $(BUILDOUT_CFG) setup.py
175 $(SHHH) PYTHONPATH= ./bin/buildout \190 $(SHHH) PYTHONPATH= ./bin/buildout \
176 configuration:instance_name=${LPCONFIG} -c $(BUILDOUT_CFG)191 configuration:instance_name=${LPCONFIG} -c $(BUILDOUT_CFG)
177192
@@ -277,10 +292,10 @@
277 echo Sleeping ${MINS_TO_SHUTDOWN} mins292 echo Sleeping ${MINS_TO_SHUTDOWN} mins
278 sleep ${MINS_TO_SHUTDOWN}m293 sleep ${MINS_TO_SHUTDOWN}m
279294
280harness:295harness: bin/harness
281 bin/harness296 bin/harness
282297
283iharness:298iharness: bin/iharness
284 bin/iharness299 bin/iharness
285300
286rebuildfti:301rebuildfti:
@@ -397,4 +412,5 @@
397 check check_merge \412 check check_merge \
398 schema default launchpad.pot check_merge_ui pull scan sync_branches\413 schema default launchpad.pot check_merge_ui pull scan sync_branches\
399 reload-apache hosted_branches check_db_merge check_mailman check_config\414 reload-apache hosted_branches check_db_merge check_mailman check_config\
400 jsbuild clean_js buildonce_eggs415 jsbuild jsbuild_lazr clean_js buildonce_eggs \
416 sprite_css sprite_image css_combine compile
401417
=== modified file 'buildout.cfg'
--- buildout.cfg 2010-02-19 22:02:36 +0000
+++ buildout.cfg 2010-03-05 22:10:43 +0000
@@ -64,8 +64,8 @@
64 'ignore',64 'ignore',
65 'Module .+ was already imported from .+, but .+ is being added.*',65 'Module .+ was already imported from .+, but .+ is being added.*',
66 UserWarning)66 UserWarning)
67 # XXX: BradCrittenden 2009-12-14 bug=496705: A single, well-known entry point67 # XXX: BradCrittenden 2009-12-14 bug=496705: A single, well-known entry point
68 # for initialization work needs to be created.68 # for initialization work needs to be created.
69 from lp.services.mime import customizeMimetypes69 from lp.services.mime import customizeMimetypes
70 customizeMimetypes()70 customizeMimetypes()
71entry-points = stxdocs=zope.configuration.stxdocs:main71entry-points = stxdocs=zope.configuration.stxdocs:main