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

Include generated Protocol Buffer descriptor.
This commit is contained in:
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 ./utility/... $(GO_TEST_FLAGS)
go test ./web/... $(GO_TEST_FLAGS) go test ./web/... $(GO_TEST_FLAGS)
web: preparation web: preparation model
$(MAKE) -C web $(MAKE) -C web
.PHONY: advice binary build clean documentation format model package preparation run search_index source_path test .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 # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
all: generated
SUFFIXES:
MAKE_ARTIFACTS = generated-stamp MAKE_ARTIFACTS = generated-stamp
all: generated include ../Makefile.INCLUDE
generated: generated-stamp generated: generated-stamp
generated-stamp: data.proto 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 $@ touch $@
clean: clean:

View file

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

View file

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

View file

@ -13,10 +13,16 @@
all: blob all: blob
blob: blob: static/generated/protocol_buffer.descriptor
$(MAKE) -C blob $(MAKE) -C blob
clean: clean:
$(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 .PHONY: blob clean

View file

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

View file

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