Skip to content

Commit

Permalink
Add privacy manifest into PLCrashreporter package (microsoft#299)
Browse files Browse the repository at this point in the history
* Add CopyFiles build phase for PrivacyInfo.xcprivacy
* Update resource bundle path in PLCrashReporter.podspec

---------

Co-authored-by: MikhailSuendukov <[email protected]>
Co-authored-by: JiglioNero <[email protected]>
  • Loading branch information
3 people authored Apr 8, 2024
1 parent 1ac2c82 commit b1416a2
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 3 deletions.
42 changes: 41 additions & 1 deletion CrashReporter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,10 @@
C2F7F2B72451FC76002BD8BF /* PLCrashFrameCompactUnwind.h in Headers */ = {isa = PBXBuildFile; fileRef = 05F3CD6416DD6A58007911FB /* PLCrashFrameCompactUnwind.h */; };
C2F7F2B92451FC78002BD8BF /* PLCrashFrameCompactUnwind.h in Headers */ = {isa = PBXBuildFile; fileRef = 05F3CD6416DD6A58007911FB /* PLCrashFrameCompactUnwind.h */; };
C2F7F2BA2451FC78002BD8BF /* PLCrashFrameCompactUnwind.h in Headers */ = {isa = PBXBuildFile; fileRef = 05F3CD6416DD6A58007911FB /* PLCrashFrameCompactUnwind.h */; };
D8160D8A2B7B7FAF0081EBA2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D8389D722B57FC7F0061D8EF /* PrivacyInfo.xcprivacy */; };
D8160D8C2B7B7FC00081EBA2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D8389D722B57FC7F0061D8EF /* PrivacyInfo.xcprivacy */; };
D8160D8E2B7B7FD30081EBA2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D8389D722B57FC7F0061D8EF /* PrivacyInfo.xcprivacy */; };
D8160D902B7B7FE10081EBA2 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D8389D722B57FC7F0061D8EF /* PrivacyInfo.xcprivacy */; };
FCE4550BA74D9DF923CFCD5A /* PLCrashFrameStackUnwind.c in Sources */ = {isa = PBXBuildFile; fileRef = FCE45837C8C773EFFD15C52B /* PLCrashFrameStackUnwind.c */; };
FCE4586A7041D332D1025F37 /* PLCrashFrameStackUnwind.h in Headers */ = {isa = PBXBuildFile; fileRef = FCE4522F86AC61C08E9DCC17 /* PLCrashFrameStackUnwind.h */; };
FCE45962BDFEEEFAF00DA7E4 /* PLCrashFrameStackUnwind.c in Sources */ = {isa = PBXBuildFile; fileRef = FCE45837C8C773EFFD15C52B /* PLCrashFrameStackUnwind.c */; };
Expand Down Expand Up @@ -1870,7 +1874,6 @@
0867D691FE84028FC02AAC07 /* CrashReporter */ = {
isa = PBXGroup;
children = (
D8389D722B57FC7F0061D8EF /* PrivacyInfo.xcprivacy */,
C2B90DA32456FE8200834AFB /* CHANGELOG.md */,
C2B90DA22456FE8200834AFB /* README.md */,
C2B90DA12456FE8200834AFB /* PLCrashReporter.podspec */,
Expand Down Expand Up @@ -1900,6 +1903,7 @@
C2F7F22F2451F081002BD8BF /* DemoCrash-tvOS-Info.plist */,
C2DCD87724657B24007322C5 /* DemoCrash-iOS.entitlements */,
050DE28D0F61BB1D00152ED3 /* fuzz_report.plcrash */,
D8389D722B57FC7F0061D8EF /* PrivacyInfo.xcprivacy */,
8DC2EF5A0486A6940098B216 /* Info.plist */,
05F3CD6C16DE7625007911FB /* Tests */,
05CD32AF0EE94086000FDE88 /* Tests-Info.plist */,
Expand Down Expand Up @@ -2435,6 +2439,7 @@
058812B41040582D009128FB /* Headers */,
058812B61040582D009128FB /* Sources */,
058812B71040582D009128FB /* Frameworks */,
D8160D8D2B7B7FC80081EBA2 /* Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -2564,6 +2569,7 @@
32CF776126DFBB080087748A /* Headers */,
32CF777826DFBB080087748A /* Sources */,
32CF777A26DFBB080087748A /* Frameworks */,
D8160D8B2B7B7FB60081EBA2 /* Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -2602,6 +2608,7 @@
8064D8901C4D22E5005A8B4C /* Headers */,
8064D8B51C4D22E5005A8B4C /* Sources */,
8064D8B61C4D22E5005A8B4C /* Frameworks */,
D8160D8F2B7B7FD90081EBA2 /* Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -2657,6 +2664,7 @@
8DC2EF500486A6940098B216 /* Headers */,
8DC2EF540486A6940098B216 /* Sources */,
8DC2EF560486A6940098B216 /* Frameworks */,
D8160D892B7B7FA50081EBA2 /* Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -2794,6 +2802,38 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
D8160D892B7B7FA50081EBA2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D8160D8A2B7B7FAF0081EBA2 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D8160D8B2B7B7FB60081EBA2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D8160D8C2B7B7FC00081EBA2 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D8160D8D2B7B7FC80081EBA2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D8160D8E2B7B7FD30081EBA2 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D8160D8F2B7B7FD90081EBA2 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D8160D902B7B7FE10081EBA2 /* PrivacyInfo.xcprivacy in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
Expand Down
2 changes: 2 additions & 0 deletions PLCrashReporter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Pod::Spec.new do |spec|
spec.source = { :http => "https://github.com/microsoft/plcrashreporter/releases/download/#{spec.version}/PLCrashReporter-Static-#{spec.version}.xcframework.zip",
:flatten => true }

spec.resource_bundle = { 'PLCrashReporter' => 'CrashReporter.xcframework/PrivacyInfo.xcprivacy' }

spec.ios.deployment_target = '11.0'
spec.osx.deployment_target = '10.9'
spec.tvos.deployment_target = '11.0'
Expand Down
8 changes: 6 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// swift-tools-version:5.0
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "PLCrashReporter",
defaultLocalization: "en",
platforms: [
.iOS(.v11),
.macOS(.v10_10),
Expand All @@ -26,12 +27,15 @@ let package = Package(
"Source/PLCrashAsyncDwarfFDE.hpp",
"Source/PLCrashAsyncDwarfPrimitives.hpp",
"Source/PLCrashAsyncLinkedList.hpp",
"Source/PLCrashReport.proto"
"Source/PLCrashReport.proto",
"Tools/CrashViewer/CrashReporterQuicklook",
"Other Sources/Crash Demo/"
],
sources: [
"Source",
"Dependencies/protobuf-c"
],
resources: [.process("Resources/PrivacyInfo.xcprivacy")],
cSettings: [
.define("PLCR_PRIVATE"),
.define("PLCF_RELEASE_BUILD"),
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions Scripts/combine-xcframework.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ xcframeworksStatic+=( -framework "${framework_path}")

xcodebuild -create-xcframework "${xcframeworks[@]}" -output "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.xcframework"
xcodebuild -create-xcframework "${xcframeworksStatic[@]}" -output "${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}-static.xcframework"

# Copy the PrivacyInfo.xcprivacy file.
echo "Copying new PrivacyInfo.xcprivacy to ${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}.xcframework"
cp ${SRCROOT}/Resources/PrivacyInfo.xcprivacy ${BUILT_PRODUCTS_DIR}/${PROJECT_NAME}.xcframework

0 comments on commit b1416a2

Please sign in to comment.