Skip to content

Commit e65b14f

Browse files
committed
add script to make git commit SHA of build available to framework
via derived header
1 parent a3a443a commit e65b14f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/darwin/Framework/Matter.xcodeproj/project.pbxproj

+19
Original file line numberDiff line numberDiff line change
@@ -1946,6 +1946,7 @@
19461946
isa = PBXNativeTarget;
19471947
buildConfigurationList = B20252A12459E34F00F97062 /* Build configuration list for PBXNativeTarget "Matter" */;
19481948
buildPhases = (
1949+
9B7838562CFE3AE600FB04C4 /* Acquire git revision info */,
19491950
0C40A67D246C9AC700885C81 /* Run GN Build (chip_xcode_build_connector) */,
19501951
B20252882459E34F00F97062 /* Headers */,
19511952
B20252892459E34F00F97062 /* Sources */,
@@ -2059,6 +2060,24 @@
20592060
shellPath = /bin/sh;
20602061
shellScript = "./chip_xcode_build_connector.sh\n";
20612062
};
2063+
9B7838562CFE3AE600FB04C4 /* Acquire git revision info */ = {
2064+
isa = PBXShellScriptBuildPhase;
2065+
buildActionMask = 2147483647;
2066+
files = (
2067+
);
2068+
inputFileListPaths = (
2069+
);
2070+
inputPaths = (
2071+
);
2072+
name = "Acquire git revision info";
2073+
outputFileListPaths = (
2074+
);
2075+
outputPaths = (
2076+
);
2077+
runOnlyForDeploymentPostprocessing = 0;
2078+
shellPath = /bin/sh;
2079+
shellScript = "GIT_COMMIT_SHA=$(git rev-parse --short HEAD)\n\n# Create a temporary header file to hold the commit SHA\ntmp_header_path=\"${DERIVED_FILES_DIR}/git_commit_sha.h\"\ncat << EOF > \"$tmp_header_path\"\n#ifndef GIT_COMMIT_SHA_H\n#define GIT_COMMIT_SHA_H\n\n#define GIT_COMMIT_SHA \"${GIT_COMMIT_SHA}\"\n\n#endif /* GIT_COMMIT_SHA_H */\nEOF\n\necho \"git sha available in ${DERIVED_FILES_DIR}/git_commit_sha.h\"\n";
2080+
};
20622081
/* End PBXShellScriptBuildPhase section */
20632082

20642083
/* Begin PBXSourcesBuildPhase section */

0 commit comments

Comments
 (0)