From 9ecd73d956198ea0c545db8769471e5ea8c8fb02 Mon Sep 17 00:00:00 2001 From: Ian Ray Date: Sun, 27 Sep 2015 10:13:01 +0300 Subject: Generate version numbers for Xcode builds Teach Xcode to run new script xcode_version_gen.sh before building the fish_shell and fish_indent targets. The script generates file fish-build-version.h for inclusion by fish_version.cpp. Note that Xcode always runs the script because of the phony target named force-fish-build-version.h, but fish-build-version.h is only touched if the contents of FISH-BUILD-VERSION-FILE change. Fixes #890 --- build_tools/xcode_version_gen.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 build_tools/xcode_version_gen.sh (limited to 'build_tools') diff --git a/build_tools/xcode_version_gen.sh b/build_tools/xcode_version_gen.sh new file mode 100755 index 00000000..5bc26145 --- /dev/null +++ b/build_tools/xcode_version_gen.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# Expects to be called from Xcode (Run Script build phase), +# write version number C preprocessor macro to header file. + +tmp="$SCRIPT_OUTPUT_FILE_1" +ver="$SCRIPT_OUTPUT_FILE_0" + +./build_tools/git_version_gen.sh + +cat FISH-BUILD-VERSION-FILE | awk '{printf("#define %s \"%s\"\n",$1,$3)}' > "$tmp" + +cmp --quiet "$tmp" "$ver" +if [ $? -ne 0 ]; then + /bin/mv "$tmp" "$ver" +else + /bin/rm "$tmp" +fi -- cgit v1.2.3