Skip to content

Commit

Permalink
Merge pull request #1392 Mac: Add version information to kext and Prj…
Browse files Browse the repository at this point in the history
…FS logging daemon

Mac: Add version information to kext and PrjFS logging daemon
  • Loading branch information
wilbaker authored Aug 1, 2019
2 parents 409adda + f58718b commit e315c6c
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 16 deletions.
32 changes: 19 additions & 13 deletions ProjFS.Mac/PrjFS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
objects = {

/* Begin PBXAggregateTarget section */
26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */ = {
26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */ = {
isa = PBXAggregateTarget;
buildConfigurationList = 26A7DE95229363EA004F6252 /* Build configuration list for PBXAggregateTarget "GeneratePrjFSVersion" */;
buildConfigurationList = 26A7DE95229363EA004F6252 /* Build configuration list for PBXAggregateTarget "GeneratePrjFSVersionFiles" */;
buildPhases = (
26A7DE96229363F2004F6252 /* ShellScript */,
);
dependencies = (
);
name = GeneratePrjFSVersion;
name = GeneratePrjFSVersionFiles;
productName = GeneratePrjFSVersion;
};
4391F90021E436210008103C /* Build All */ = {
Expand Down Expand Up @@ -241,6 +241,7 @@
265504CE224ADE11005FAD74 /* MockPerfTracing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MockPerfTracing.cpp; sourceTree = "<group>"; };
26786AE5228B815E00F53311 /* JsonWriter.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = JsonWriter.hpp; sourceTree = "<group>"; };
26786AE6228B816E00F53311 /* JsonWriter.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JsonWriter.cpp; sourceTree = "<group>"; };
26BBD24B22E282EA007273D9 /* PrjFSConfig.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = PrjFSConfig.xcconfig; path = ../../BuildOutput/PrjFSConfig.xcconfig; sourceTree = "<group>"; };
43057C5B21E439C700487681 /* prjfs-log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "prjfs-log.cpp"; sourceTree = "<group>"; };
43057C5C21E439C700487681 /* kext-perf-tracing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "kext-perf-tracing.cpp"; sourceTree = "<group>"; };
43057C5D21E439C700487681 /* kext-perf-tracing.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = "kext-perf-tracing.hpp"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -411,6 +412,7 @@
4391F87521E4278C0008103C = {
isa = PBXGroup;
children = (
26BBD24B22E282EA007273D9 /* PrjFSConfig.xcconfig */,
4391F8C221E4306D0008103C /* PrjFSLib */,
4391F88D21E42AA70008103C /* PrjFSKext */,
4A08256921E77B7F00E21AFD /* PrjFSKextLogDaemon */,
Expand Down Expand Up @@ -783,7 +785,7 @@
F5E39C7621F1118D006D65C2 /* PrjFSKextTests */,
4A8C139F21F23EE800002878 /* PrjFSKextTestable */,
264E723822930E660059E150 /* PrjFSLibTests */,
26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */,
26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */,
);
};
/* End PBXProject section */
Expand Down Expand Up @@ -820,12 +822,13 @@
);
inputPaths = (
"${BUILD_ROOT}/../../PrjFSVersion.h",
"${BUILD_ROOT}/../../PrjFSConfig.xcconfig",
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ ! -f \"${BUILD_ROOT}/../../PrjFSVersion.h\" ]; then\n \"${PROJECT_DIR}/Scripts/GeneratePrjFSVersionHeader.sh\"\nfi";
shellScript = "if [ ! -f \"${BUILD_ROOT}/../../PrjFSVersion.h\" ]; then\n \"${PROJECT_DIR}/Scripts/GeneratePrjFSVersionHeader.sh\"\nfi\nif [ ! -f \"${BUILD_ROOT}/../../PrjFSConfig.xcconfig\" ]; then\n \"${PROJECT_DIR}/Scripts/GeneratePrjFSXCConfig.sh\"\nfi";
};
43057C6021E43CC100487681 /* Run Script - Check kext linkage */ = {
isa = PBXShellScriptBuildPhase;
Expand Down Expand Up @@ -951,37 +954,37 @@
};
26A7DE982293643F004F6252 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */;
targetProxy = 26A7DE972293643F004F6252 /* PBXContainerItemProxy */;
};
26A7DE9A2293644B004F6252 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */;
targetProxy = 26A7DE992293644B004F6252 /* PBXContainerItemProxy */;
};
26A7DE9C22936451004F6252 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */;
targetProxy = 26A7DE9B22936451004F6252 /* PBXContainerItemProxy */;
};
26A7DE9E22936459004F6252 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */;
targetProxy = 26A7DE9D22936459004F6252 /* PBXContainerItemProxy */;
};
26A7DEA222936473004F6252 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */;
targetProxy = 26A7DEA122936473004F6252 /* PBXContainerItemProxy */;
};
26A7DEA422936496004F6252 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */;
targetProxy = 26A7DEA322936496004F6252 /* PBXContainerItemProxy */;
};
26A7DEA62293649E004F6252 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersion */;
target = 26A7DE91229363EA004F6252 /* GeneratePrjFSVersionFiles */;
targetProxy = 26A7DEA52293649E004F6252 /* PBXContainerItemProxy */;
};
4391F90521E4362B0008103C /* PBXTargetDependency */ = {
Expand Down Expand Up @@ -1096,6 +1099,7 @@
};
43057C5221E437F300487681 /* Profiling(Release) */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 26BBD24B22E282EA007273D9 /* PrjFSConfig.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -1219,6 +1223,7 @@
};
4391F88521E4278C0008103C /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 26BBD24B22E282EA007273D9 /* PrjFSConfig.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -1290,6 +1295,7 @@
};
4391F88621E4278C0008103C /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 26BBD24B22E282EA007273D9 /* PrjFSConfig.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
Expand Down Expand Up @@ -1651,7 +1657,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
26A7DE95229363EA004F6252 /* Build configuration list for PBXAggregateTarget "GeneratePrjFSVersion" */ = {
26A7DE95229363EA004F6252 /* Build configuration list for PBXAggregateTarget "GeneratePrjFSVersionFiles" */ = {
isa = XCConfigurationList;
buildConfigurations = (
26A7DE92229363EA004F6252 /* Debug */,
Expand Down
4 changes: 2 additions & 2 deletions ProjFS.Mac/PrjFSKext/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>KEXT</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(PRJFS_BUNDLE_SHORT_VERSION_STRING)</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>$(PRJFS_BUNDLE_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © Microsoft</string>
<key>IOKitPersonalities</key>
Expand Down
4 changes: 3 additions & 1 deletion ProjFS.Mac/PrjFSKextLogDaemon/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<string>$(PRJFS_BUNDLE_VERSION)</string>
<key>CFBundleName</key>
<string>PrjFSKextLogDaemon</string>
<key>CFBundleShortVersionString</key>
<string>$(PRJFS_BUNDLE_SHORT_VERSION_STRING)</string>
</dict>
</plist>
3 changes: 3 additions & 0 deletions ProjFS.Mac/Scripts/Build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ PROJFS=$SRCDIR/ProjFS.Mac
echo "Generating PrjFSVersion.h as $VERSION..."
$SCRIPTDIR/GeneratePrjFSVersionHeader.sh $VERSION || exit 1

echo "Generating PrjFSConfig.xcconfig for $VERSION..."
$SCRIPTDIR/GeneratePrjFSXCConfig.sh $VERSION || exit 1

xcodebuild -configuration $CONFIGURATION -project $PROJFS/PrjFS.xcodeproj -scheme 'Build All' -derivedDataPath $ROOTDIR/BuildOutput/ProjFS.Mac/Native build || exit 1

if !(gem list --local | grep xcpretty); then
Expand Down
25 changes: 25 additions & 0 deletions ProjFS.Mac/Scripts/GeneratePrjFSXCConfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
VERSION=$1
if [ -z $VERSION ]; then
VERSION="0.2.173.2"
fi

if [[ $VERSION =~ ([0-9])\.([0-9]*)\.([0-9]*)\.([0-9]*) ]]
then
BUNDLE_VERSION="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
else
echo "Failed to determine BUNDLE_VERSION from $VERSION"
exit 1
fi

# Generate PrjFSConfig.xcconfig
SCRIPTDIR=$(dirname ${BASH_SOURCE[0]})
VERSIONCONFIG=$SCRIPTDIR/../../../BuildOutput/PrjFSConfig.xcconfig

echo "Generating $VERSIONCONFIG with bundle version $BUNDLE_VERSION and bundle short version string $VERSION"

cat >$VERSIONCONFIG <<TEMPLATE
// This file was generated by GeneratePrjFSXCConfig.sh
PRJFS_BUNDLE_VERSION = $BUNDLE_VERSION
PRJFS_BUNDLE_SHORT_VERSION_STRING = $VERSION
TEMPLATE

0 comments on commit e315c6c

Please sign in to comment.