Merge lp:~bac/juju-gui/1078723 into lp:juju-gui/experimental

Proposed by Brad Crittenden
Status: Merged
Merged at revision: 266
Proposed branch: lp:~bac/juju-gui/1078723
Merge into: lp:juju-gui/experimental
Diff against target: 81 lines (+41/-0) (has conflicts)
2 files modified
Makefile (+26/-0)
bin/merge-files (+15/-0)
Text conflict in Makefile
Text conflict in bin/merge-files
To merge this branch: bzr merge lp:~bac/juju-gui/1078723
Reviewer Review Type Date Requested Status
Juju GUI Hackers Pending
Review via email: mp+137991@code.launchpad.net

Description of the change

Makefile tweaks

Bug 1078723 addressed problems with changes to third party JS not
forcing a remake of the combined JS files. We really only have one
such file now, the others are handled properly, so this branch adds a
dependency on it, creates a THIRD_PARTY_JS symbol in the Makefile to
make it obvious in the future, and does other clean-up.

I tried removing the special-case for bin/generateTemplates (which
*is* a JavaScript file) by adding a .js extension. That made most of
the make process work but then the linters blew up. I hastily
retreated.

https://codereview.appspot.com/6873055/

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

Reviewers: mp+137991_code.launchpad.net,

Message:
Please take a look.

Description:
Makefile tweaks

Bug 1078723 addressed problems with changes to third party JS not
forcing a remake of the combined JS files. We really only have one
such file now, the others are handled properly, so this branch adds a
dependency on it, creates a THIRD_PARTY_JS symbol in the Makefile to
make it obvious in the future, and does other clean-up.

I tried removing the special-case for bin/generateTemplates (which
*is* a JavaScript file) by adding a .js extension. That made most of
the make process work but then the linters blew up. I hastily
retreated.

https://code.launchpad.net/~bac/juju-gui/1078723/+merge/137991

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/6873055/

Affected files:
   M Makefile
   A [revision details]
   M bin/merge-files

Index: Makefile
=== modified file 'Makefile'
--- Makefile 2012-12-04 17:32:59 +0000
+++ Makefile 2012-12-04 20:48:08 +0000
@@ -1,14 +1,19 @@
  # Makefile debugging hack: uncomment the two lines below and make will
tell you
-# more about what is happening. The output generated is of the form
+# more about what is happening. The output generated is of the form
  # "FILE:LINE [TARGET (DEPENDENCIES) (NEWER)]" where DEPENDENCIES are all
the
  # things TARGET depends on and NEWER are all the files that are newer than
  # TARGET. DEPENDENCIES will be colored green and NEWER will be blue.
  #
  #OLD_SHELL := $(SHELL)
-#SHELL = $(warning [$@ ($^) ($?) ])$(OLD_SHELL)
-
-JSFILES=$(shell bzr ls -RV -k file | grep -E -e '.+\.js(on)?$$|
generateTemplates$$' | grep -Ev -e '^manifest\.json$$' -e '^test/assets/'
-e '^app/assets/javascripts/reconnecting-websocket.js$$' -e '^server.js$$')
-
+#SHELL = $(warning [$@ ($^) ($?) ])$(OLD_SHELL)
+
+JSFILES=$(shell bzr ls -RV -k file | \
+ grep -E -e '.+\.js(on)?$$|generateTemplates$$' | \
+ grep -Ev -e '^manifest\.json$$' \
+ -e '^test/assets/' \
+ -e '^app/assets/javascripts/reconnecting-websocket.js$$' \
+ -e '^server.js$$')
+THIRD_PARTY_JS=app/assets/javascripts/reconnecting-websocket.js
  NODE_TARGETS=node_modules/chai node_modules/cryptojs node_modules/d3 \
   node_modules/expect.js node_modules/express node_modules/graceful-fs \
   node_modules/grunt node_modules/jshint node_modules/less \
@@ -31,6 +36,8 @@
  DATE=$(shell date -u)
  APPCACHE=$(BUILD_ASSETS_DIR)/manifest.appcache

+show:
+ echo $(JSFILES)
  all: build

  build/juju-ui/templates.js: $(TEMPLATE_TARGETS) bin/generateTemplates
@@ -121,7 +128,8 @@
  spritegen: $(SPRITE_GENERATED_FILES)

  $(PRODUCTION_FILES): node_modules/yui node_modules/d3/d3.v2.min.js
$(JSFILES) \
- bin/merge-files lib/merge-files.js
+ bin/merge-files lib/merge-files.js \
+ $(THIRD_PARTY_JS)
   rm -f $(PRODUCTION_FILES)
   mkdir -p "$(BUILD_ASSETS_DIR)/combined-css"
   bin/merge-files
@@ -165,6 +173,7 @@

  $(BUILD_ASSETS_DIR)/images: $(SPRITE_SOURCE_FILES)
   cp -rf app/assets/images $(BUILD_ASSETS_DIR)/images
+ touch $@

  $(BUILD_ASSETS_DIR)/svgs: $(shell bzr ls -R...

Read more...

Revision history for this message
Francesco Banconi (frankban) wrote :

Approved.
These changes look good Brad, thanks.

https://codereview.appspot.com/6873055/

lp:~bac/juju-gui/1078723 updated
268. By Brad Crittenden

Remove debug line before commit

Revision history for this message
Brad Crittenden (bac) wrote :

*** Submitted:

Makefile tweaks

Bug 1078723 addressed problems with changes to third party JS not
forcing a remake of the combined JS files. We really only have one
such file now, the others are handled properly, so this branch adds a
dependency on it, creates a THIRD_PARTY_JS symbol in the Makefile to
make it obvious in the future, and does other clean-up.

I tried removing the special-case for bin/generateTemplates (which
*is* a JavaScript file) by adding a .js extension. That made most of
the make process work but then the linters blew up. I hastily
retreated.

R=benji, frankban
CC=
https://codereview.appspot.com/6873055

https://codereview.appspot.com/6873055/diff/1/Makefile
File Makefile (right):

https://codereview.appspot.com/6873055/diff/1/Makefile#newcode40
Makefile:40: echo $(JSFILES)
gah!
gone.
done.

https://codereview.appspot.com/6873055/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Makefile'
2--- Makefile 2012-12-04 22:57:18 +0000
3+++ Makefile 2012-12-05 12:55:26 +0000
4@@ -1,5 +1,24 @@
5+<<<<<<< TREE
6 JSFILES=$(shell bzr ls -RV -k file | grep -E -e '.+\.js(on)?$$|generateTemplates$$' | grep -Ev -e '^manifest\.json$$' -e '^test/assets/' -e '^app/assets/javascripts/reconnecting-websocket.js$$' -e '^server.js$$')
7
8+=======
9+# Makefile debugging hack: uncomment the two lines below and make will tell you
10+# more about what is happening. The output generated is of the form
11+# "FILE:LINE [TARGET (DEPENDENCIES) (NEWER)]" where DEPENDENCIES are all the
12+# things TARGET depends on and NEWER are all the files that are newer than
13+# TARGET. DEPENDENCIES will be colored green and NEWER will be blue.
14+#
15+#OLD_SHELL := $(SHELL)
16+#SHELL = $(warning [$@ ($^) ($?) ])$(OLD_SHELL)
17+
18+JSFILES=$(shell bzr ls -RV -k file | \
19+ grep -E -e '.+\.js(on)?$$|generateTemplates$$' | \
20+ grep -Ev -e '^manifest\.json$$' \
21+ -e '^test/assets/' \
22+ -e '^app/assets/javascripts/reconnecting-websocket.js$$' \
23+ -e '^server.js$$')
24+THIRD_PARTY_JS=app/assets/javascripts/reconnecting-websocket.js
25+>>>>>>> MERGE-SOURCE
26 NODE_TARGETS=node_modules/chai node_modules/cryptojs node_modules/d3 \
27 node_modules/expect.js node_modules/express node_modules/graceful-fs \
28 node_modules/grunt node_modules/jshint node_modules/less \
29@@ -108,7 +127,13 @@
30
31 spritegen: $(SPRITE_GENERATED_FILES)
32
33+<<<<<<< TREE
34 $(PRODUCTION_FILES): node_modules/yui node_modules/d3/d3.v2.min.js $(JSFILES) ./bin/merge-files
35+=======
36+$(PRODUCTION_FILES): node_modules/yui node_modules/d3/d3.v2.min.js $(JSFILES) \
37+ bin/merge-files lib/merge-files.js \
38+ $(THIRD_PARTY_JS)
39+>>>>>>> MERGE-SOURCE
40 rm -f $(PRODUCTION_FILES)
41 mkdir -p "$(BUILD_ASSETS_DIR)/stylesheets"
42 ./bin/merge-files
43@@ -143,6 +168,7 @@
44
45 $(BUILD_ASSETS_DIR)/images: $(SPRITE_SOURCE_FILES)
46 cp -rf app/assets/images $(BUILD_ASSETS_DIR)/images
47+ touch $@
48
49 $(BUILD_ASSETS_DIR)/svgs: $(shell bzr ls -R -k file app/assets/svgs)
50 cp -rf app/assets/svgs $(BUILD_ASSETS_DIR)/svgs
51
52=== modified file 'bin/merge-files'
53--- bin/merge-files 2012-12-04 22:57:18 +0000
54+++ bin/merge-files 2012-12-05 12:55:26 +0000
55@@ -61,6 +61,7 @@
56
57 // Merge third-party files to the filesToLoad list
58 filesToLoad.js.push.apply(filesToLoad.js, [
59+<<<<<<< TREE
60 './app/assets/javascripts/d3.v2.min.js',
61 './app/assets/javascripts/d3-components.js',
62 './app/assets/javascripts/reconnecting-websocket.js',
63@@ -77,4 +78,18 @@
64 merge.combine([ './app/assets/stylesheets/bootstrap-2.0.4.css',
65 './app/assets/stylesheets/bootstrap-responsive-2.0.4.css' ],
66 './build/juju-ui/assets/stylesheets/all-static.css', 'yui-css');
67+=======
68+ 'app/assets/javascripts/d3.v2.min.js',
69+ 'app/assets/javascripts/d3-components.js',
70+ 'app/assets/javascripts/reconnecting-websocket.js',
71+ 'app/assets/javascripts/svg-layouts.js' ]);
72+
73+ merge.combineJs(filesToLoad.js, 'build/juju-ui/assets/all-yui.js');
74+
75+ var cssFiles = filesToLoad.css;
76+ cssFiles.push('app/assets/stylesheets/bootstrap-2.0.4.css');
77+ cssFiles.push('app/assets/stylesheets/bootstrap-responsive-2.0.4.css');
78+ merge.combineCSS(cssFiles,
79+ 'build/juju-ui/assets/combined-css/all-static.css');
80+>>>>>>> MERGE-SOURCE
81 });

Subscribers

People subscribed via source and target branches