Skip to content

Commit aea0ab9

Browse files
authored
Merge pull request #33 from mjcheetham/dsym-archive
Produce and collect symbols on build
2 parents 8a58cf0 + fd2ad52 commit aea0ab9

File tree

4 files changed

+33
-4
lines changed

4 files changed

+33
-4
lines changed
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
steps:
2-
- script: src/osx/Installer.Mac/layout.sh --configuration='$(configuration)' --output='$(Build.StagingDirectory)/payload'
2+
- script: src/osx/Installer.Mac/layout.sh --configuration='$(configuration)' --output='$(Build.StagingDirectory)/payload' --symbol-output='$(Build.StagingDirectory)/symbols'
33
displayName: Layout installer payload
44

55
- task: PublishPipelineArtifact@0
66
displayName: Upload unsigned payload
77
inputs:
88
artifactName: 'tmp.macpayload_unsigned'
99
targetPath: '$(Build.StagingDirectory)/payload'
10+
11+
- task: PublishPipelineArtifact@0
12+
displayName: Upload symbols
13+
inputs:
14+
artifactName: 'Symbols.Mac'
15+
targetPath: '$(Build.StagingDirectory)/symbols'

src/osx/Installer.Mac/layout.sh

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ case $i in
3939
PAYLOAD="${i#*=}"
4040
shift # past argument=value
4141
;;
42+
--symbol-output=*)
43+
SYMBOLOUT="${i#*=}"
44+
;;
4245
*)
4346
# unknown option
4447
;;
@@ -50,7 +53,12 @@ CONFIGURATION=${CONFIGURATION:=Debug}
5053
if [ -z "$PAYLOAD" ]; then
5154
die "--output was not set"
5255
fi
56+
if [ -z "$SYMBOLOUT" ]; then
57+
SYMBOLOUT="$PAYLOAD.sym"
58+
fi
59+
5360
MSAUTH_BIN=$MSAUTH_OUT/bin/$CONFIGURATION/native
61+
MSAUTH_SYM=$MSAUTH_OUT/bin/$CONFIGURATION/native.sym
5462
if [ ! -d $MSAUTH_BIN ]; then
5563
die "No native helper binaries found. Did you build?"
5664
fi
@@ -61,8 +69,8 @@ if [ -d $PAYLOAD ]; then
6169
rm -rf $PAYLOAD
6270
fi
6371

64-
# Ensure payload directory exists
65-
mkdir -p $PAYLOAD
72+
# Ensure payload and symbol directories exists
73+
mkdir -p $PAYLOAD $SYMBOLOUT
6674

6775
# Copy uninstaller script
6876
echo "Copying uninstall script..."
@@ -80,6 +88,12 @@ dotnet publish $GCM_SRC \
8088
--runtime=$RUNTIME \
8189
--output=$(make_absolute $PAYLOAD) || exit 1
8290

91+
# Collect symbols
92+
echo "Collecting managed symbols..."
93+
mv $PAYLOAD/*.pdb $SYMBOLOUT || exit 1
94+
echo "Collecting native symbols..."
95+
cp -R $MSAUTH_SYM/ $SYMBOLOUT || exit 1
96+
8397
# Remove any unwanted .DS_Store files
8498
echo "Removing unnecessary files..."
8599
find $PAYLOAD -name '*.DS_Store' -type f -delete || exit 1

src/osx/Microsoft.Authentication.Helper.Mac/Microsoft.Authentication.Helper.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@
368368
baseConfigurationReference = D575DD7FD75AFA3F9B59DF88 /* Pods-Microsoft.Authentication.Helper.debug.xcconfig */;
369369
buildSettings = {
370370
CODE_SIGN_STYLE = Automatic;
371+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
371372
PRODUCT_NAME = "$(TARGET_NAME)";
372373
};
373374
name = Debug;
@@ -377,6 +378,7 @@
377378
baseConfigurationReference = 2617F1D56611A7524A6B795A /* Pods-Microsoft.Authentication.Helper.release.xcconfig */;
378379
buildSettings = {
379380
CODE_SIGN_STYLE = Automatic;
381+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
380382
PRODUCT_NAME = "$(TARGET_NAME)";
381383
};
382384
name = Release;

src/osx/Microsoft.Authentication.Helper.Mac/build.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ done
3232
CONFIGURATION=${CONFIGURATION:=Debug}
3333

3434
MSAUTH_BINOUT=$MSAUTH_OUT/bin/$CONFIGURATION/native
35+
MSAUTH_SYMOUT=$MSAUTH_OUT/bin/$CONFIGURATION/native.sym
3536
MSAUTH_OBJOUT=$MSAUTH_OUT/xcodebuild
3637

3738
# Ensure output directories exist
@@ -53,10 +54,16 @@ xcodebuild \
5354
-configuration $CONFIGURATION \
5455
-derivedDataPath $MSAUTH_OBJOUT || exit 1
5556

57+
MSAUTH_EXEC=$MSAUTH_OBJOUT/Build/Products/$CONFIGURATION/Microsoft.Authentication.Helper
58+
5659
# Copy binaries
5760
echo "Copying binaries..."
58-
MSAUTH_EXEC=$MSAUTH_OBJOUT/Build/Products/$CONFIGURATION/Microsoft.Authentication.Helper
5961
mkdir -p $MSAUTH_BINOUT || exit 1
6062
cp $MSAUTH_EXEC $MSAUTH_BINOUT || exit 1
6163

64+
# Copy dSYM symbol files
65+
echo "Copying symbols..."
66+
mkdir -p $MSAUTH_SYMOUT || exit 1
67+
cp -R $MSAUTH_EXEC.dSYM $MSAUTH_SYMOUT || exit 1
68+
6269
echo "Build of Microsoft.Authentication.Helper.Mac complete."

0 commit comments

Comments
 (0)