From 4ff01fb07f77fcc2bce4ee5a7f835832b382c4ce Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 13 Feb 2014 16:24:00 -0800 Subject: [PATCH] allow for easier editing of style in Xcode * write protobuf directly to file instead of stdout (for Gyp) * add style.js to editable sources * add build phases for pbf conversion & resources updates * update README style directions --- README.md | 5 +++-- bin/convert-style.js | 3 ++- llmr.gyp | 48 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3e9a811d1..9eb3bcf9e 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ proto/style.proto. The reason for doing so is that we don't have to ship with a JSON/yaml parser. To test the conversion script, run ``` -bin/convert-style.js | protoc --decode=style proto/style.proto +bin/convert-style.js && cat resources/style.pbf | protoc --decode=style proto/style.proto ``` You should see a nicely formatted hierarchical output of the converted style. @@ -120,9 +120,10 @@ You should see a nicely formatted hierarchical output of the converted style. To update the included default style, use ``` -bin/convert-style.js > resources/style.pbf && bin/build-style.js +bin/convert-style.js && bin/build-style.js ``` +This is automatically taken care of as a build phase if you are using the Xcode projects. # Usage diff --git a/bin/convert-style.js b/bin/convert-style.js index 2f21d6a8b..57aee0136 100755 --- a/bin/convert-style.js +++ b/bin/convert-style.js @@ -4,6 +4,7 @@ var style = require('./style.js'); var Protobuf = require('./protobuf.js'); +var fs = require('fs'); // var fs = require('fs'); @@ -212,4 +213,4 @@ for (var i = 0; i < style.classes.length; i++) { pbf.writeMessage(3 /* class */, createClass(klass)); } -process.stdout.write(pbf.finish()); +fs.writeFileSync('resources/style.pbf', pbf.finish()); diff --git a/llmr.gyp b/llmr.gyp index 9b8d87a76..bd94746fa 100644 --- a/llmr.gyp +++ b/llmr.gyp @@ -11,7 +11,8 @@ 'sources': [ '