Merge pull request #179 from prometheus/feature/protocol-buffer-descriptor-inclusion

Include generated Protocol Buffer descriptor.
pull/182/head
Matt T. Proud 2013-04-24 10:54:43 -07:00
commit 3ff916d209
7 changed files with 25 additions and 11 deletions

View File

@ -76,7 +76,7 @@ test: build
go test ./utility/... $(GO_TEST_FLAGS)
go test ./web/... $(GO_TEST_FLAGS)
web: preparation
web: preparation model
$(MAKE) -C web
.PHONY: advice binary build clean documentation format model package preparation run search_index source_path test

View File

@ -11,14 +11,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.
all: generated
SUFFIXES:
MAKE_ARTIFACTS = generated-stamp
all: generated
include ../Makefile.INCLUDE
generated: generated-stamp
generated-stamp: data.proto
protoc --go_out=generated/ data.proto
protoc --proto_path=$(PREFIX)/include:. --go_out=generated/ --descriptor_set_out=generated/descriptor.blob data.proto
touch $@
clean:

View File

@ -11,7 +11,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package dto;
package io.prometheus;
import "google/protobuf/descriptor.proto";
message LabelPair {
optional string name = 1;

View File

@ -1,4 +1,2 @@
*.cc
*.go
*.h
*.o
data.pb.go
descriptor.blob

View File

@ -13,10 +13,16 @@
all: blob
blob:
blob: static/generated/protocol_buffer.descriptor
$(MAKE) -C blob
clean:
$(MAKE) -C blob clean
static/generated:
mkdir -vp static/generated
static/generated/protocol_buffer.descriptor: static/generated ../model/generated/descriptor.blob
cp ../model/generated/descriptor.blob -f $@
.PHONY: blob clean

View File

@ -13,10 +13,13 @@
all: files.go
SUFFIXES:
files.go: $(shell find ../templates/ ../static/ -type f)
../../utility/embed-static.sh ../static ../templates | gofmt > $@
clean:
-rm files.go
-rm -rf generated
.PHONY: clean

View File

@ -18,6 +18,7 @@ const (
var mimeMap = map[string]string{
"css": "text/css",
"js": "text/javascript",
"descriptor": "application/vnd.google.protobuf;proto=google.protobuf.FileDescriptorSet",
}
func GetFile(bucket string, name string) ([]byte, error) {