Commit d7c8d2f9 authored by Greg Williams's avatar Greg Williams
Browse files

Updated version info generation to work with stock protobuf-c, since protocol...

Updated version info generation to work with stock protobuf-c, since protocol version was not being parsed properly due to name change.
Made kinetic_logger and kinetic_client depend on generated version info so they get rebuilt if the info header changes.
Changed call into rake/ceedling to run unit tests incrementally so that a noop build is faster.
parent f423f94a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -123,8 +123,11 @@ clean: makedirs
	cd ${LIB_DIR}/bus && make clean
	if [ -f ${JSONC}/Makefile ]; then cd ${JSONC} && make clean; fi;

# Setup version info generation and corresponding dependencies
$(VERSION_INFO): $(VERSION_FILE)
	@ruby scripts/generate_version_info.rb
$(OUT_DIR)/kinetic_logger.o: $(VERSION_INFO)
$(OUT_DIR)/kinetic_client.o: $(VERSION_INFO)

config: makedirs update_git_submodules

@@ -227,7 +230,7 @@ test: Rakefile $(LIB_OBJS)
	@echo Testing $(PROJECT)
	@echo --------------------------------------------------------------------------------
	bundle install
	bundle exec rake test_all
	bundle exec rake test:delta

JAVA_HOME ?= /usr
JAVA_BIN = $(JAVA_HOME)/bin/java
+7 −4
Original line number Diff line number Diff line
@@ -2,14 +2,17 @@
kinetic_c_version = `cat config/VERSION`.strip
commit_hash = `git rev-parse HEAD`.strip
protocol_version = nil
File.readlines('src/lib/kinetic.pb-c.c').each do |l|
    m = l.match /^char com_seagate_kinetic_proto_local_protocol_version_default_value\[\]\s+=\s+\"(.*)\"/
proto_source = 'src/lib/kinetic.pb-c.c'
File.readlines(proto_source).each do |l|
    m = l.match /^char com__seagate__kinetic__proto__local__protocol_version__default_value\[\]\s+=\s+\"(.*)\"/
    if m
      protocol_version = m[1].strip
      break
    end
end

raise "Unable to parse protocol version from: #{proto_source}" if protocol_version.nil?

info_header_file = "src/lib/kinetic_version_info.h"

header_contents = []