File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
prometheus-metrics-exposition-formats Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,14 @@ mkdir -p $PROTO_DIR
2020OLD_PACKAGE=$( sed -nE ' s/import (io.prometheus.metrics.expositionformats.generated.*).Metrics;/\1/p' src/main/java/io/prometheus/metrics/expositionformats/internal/PrometheusProtobufWriterImpl.java)
2121PACKAGE=" io.prometheus.metrics.expositionformats.generated.com_google_protobuf_${PROTOBUF_VERSION_STRING} "
2222
23- if [[ $OLD_PACKAGE ! = " $PACKAGE " ]]; then
24- echo " Replacing package $OLD_PACKAGE with $PACKAGE in all java files "
25- find .. -type f -name " *.java " -exec sed -i " s/ $OLD_PACKAGE / $PACKAGE /g " {} +
23+ if [[ $OLD_PACKAGE = = " $PACKAGE " ]]; then
24+ echo " No new protobuf version detected. Skipping protobuf generation. "
25+ exit 0
2626fi
2727
28+ echo " Replacing package $OLD_PACKAGE with $PACKAGE in all java files"
29+ find .. -type f -name " *.java" -exec sed -i " s/$OLD_PACKAGE /$PACKAGE /g" {} +
30+
2831curl -sL https://raw.githubusercontent.com/prometheus/client_model/master/io/prometheus/client/metrics.proto -o $PROTO_DIR /metrics.proto
2932
3033sed -i " s/java_package = \" io.prometheus.client\" /java_package = \" $PACKAGE \" /" $PROTO_DIR /metrics.proto
You can’t perform that action at this time.
0 commit comments