这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,12 @@ jobs:
# Sentry to the app with auto performance monitoring enabled. We then run the UI tests to make sure
# adding our SDK doesn't cause any major issues.
vlc-tests:
runs-on: macos-11
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with:
repository: 'videolan/vlc-ios'
ref: 'f2d4a28031509f263255457c91703b6d2f388b65'
ref: '5d2b5505edc3387cad43deca14c0bd0b19e3f133'

# Use github.event.pull_request.head.sha instead of github.sha when available as
# the github.sha is the pre merge commit id for PRs.
Expand Down Expand Up @@ -181,4 +181,4 @@ jobs:

- name: Run UI Tests
# Run the tests twice in case they are flaky.
run: for i in {1..2} ; do set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "VLC.xcworkspace" -scheme "VLC-iOS-UITests" -destination "OS=15.2,name=iPhone 13 Pro" test | xcpretty && break ; done
run: for i in {1..2} ; do set -o pipefail && env NSUnbufferedIO=YES xcodebuild -workspace "VLC.xcworkspace" -scheme "VLC-iOS-UITests" -destination "OS=15.5,name=iPhone 13 Pro" test | xcpretty && break ; done
166 changes: 144 additions & 22 deletions scripts/add-sentry-to-vlc.patch
Original file line number Diff line number Diff line change
@@ -1,40 +1,162 @@
diff --git a/Podfile b/Podfile
index efdc34e6..95a5a944 100644
index b9205a9f..3156735b 100644
--- a/Podfile
+++ b/Podfile
@@ -10,6 +10,8 @@ def shared_pods
@@ -9,6 +9,7 @@ def shared_pods
pod 'CocoaHTTPServer', :git => 'https://github.com/fkuehne/CocoaHTTPServer.git' # has our fixes
pod 'xmlrpc', :git => 'https://github.com/fkuehne/xmlrpc.git', :commit => '3f8ce3a8' #fix case-sensitive FS
pod 'AFNetworking', '~>4.0'

pod 'AppCenter', '~>4.1'
+ pod 'Sentry', :git => 'https://github.com/getsentry/sentry-cocoa', :commit => '__GITHUB_REVISION_PLACEHOLDER__'
+

# debug
pod 'SwiftLint', '~> 0.25.0', :configurations => ['Debug']
end
diff --git a/Sources/VLCAppDelegate.m b/Sources/VLCAppDelegate.m
index 45e05469..0050ffbc 100644
--- a/Sources/VLCAppDelegate.m
+++ b/Sources/VLCAppDelegate.m
@@ -23,6 +23,7 @@
#import <AppCenter/AppCenter.h>
#import <AppCenterAnalytics/AppCenterAnalytics.h>
#import <AppCenterCrashes/AppCenterCrashes.h>
pod 'SwiftLint', '~> 0.47.1', :configurations => ['Debug']
diff --git a/Sources/App/iOS/VLCAppDelegate.m b/Sources/App/iOS/VLCAppDelegate.m
index 2c1fc802..21495fd7 100644
--- a/Sources/App/iOS/VLCAppDelegate.m
+++ b/Sources/App/iOS/VLCAppDelegate.m
@@ -19,6 +19,7 @@

#import "VLCAppDelegate.h"
#import "VLC-Swift.h"
+#import <Sentry/Sentry.h>

NSString *VLCAppCenterAppID = @"0114ca8e-2652-44ce-588d-2ebd035c3577";
@interface VLCAppDelegate ()
{
@@ -134,6 +135,16 @@

@@ -136,6 +137,14 @@ NSString *VLCAppCenterAppID = @"0114ca8e-2652-44ce-588d-2ebd035c3577";
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[MSACAppCenter start:VLCAppCenterAppID withServices:@[[MSACAnalytics class], [MSACCrashes class]]];
+
+ [SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
+ options.dsn = @"https://a92d50327ac74b8b9aa4ea80eccfb267@o447951.ingest.sentry.io/5428557";
+ options.environment = @"integration-tests";
+ options.tracesSampleRate = @0;
+ options.tracesSampleRate = @1.0;
+ options.enableFileIOTracking = YES;
+ options.profilesSampleRate = @1.0;
+ options.attachScreenshot = YES;
+ options.attachViewHierarchy = YES;
+ options.enableUserInteractionTracing = YES;
+ }];

+
self.orientationLock = UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscape;

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
diff --git a/VLC.xcodeproj/project.pbxproj b/VLC.xcodeproj/project.pbxproj
index 311b5c8b..b434a8b5 100644
--- a/VLC.xcodeproj/project.pbxproj
+++ b/VLC.xcodeproj/project.pbxproj
@@ -492,7 +492,7 @@
4152F1611FEF19BD00F1908B /* KeychainCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeychainCoordinator.swift; sourceTree = "<group>"; };
41533C91211338D500EC3ABA /* VLC-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "VLC-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
41533C9D2113392F00EC3ABA /* URLHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLHandlerTests.swift; sourceTree = "<group>"; };
- 41533CA1211343D100EC3ABA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../../Testing/Unit/Info.plist; sourceTree = "<group>"; };
+ 41533CA1211343D100EC3ABA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = ../../Buildsystem/Testing/Unit/Info.plist; sourceTree = "<group>"; };
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to fix some paths to make the UITests compile. I opened a PR for this on the VLC repo videolan/vlc-ios#452

416443852048419E00CAC646 /* DeviceMotion.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DeviceMotion.swift; sourceTree = "<group>"; };
416DACB620B6DB9A001BC75D /* PlayingExternallyView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayingExternallyView.swift; sourceTree = "<group>"; };
4170152B209A1D3600802E44 /* MediaViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaViewController.swift; sourceTree = "<group>"; };
@@ -3644,7 +3644,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_FILE = Testing/Screenshots/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/Screenshots/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
@@ -3653,7 +3653,7 @@
PRODUCT_MODULE_NAME = VLC_iOS_Screenshots;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
- SWIFT_OBJC_BRIDGING_HEADER = "Testing/Screenshots/VLC-iOS-Screenshots-Bridging-Header.h";
+ SWIFT_OBJC_BRIDGING_HEADER = "Buildsystem/Testing/Screenshots/VLC-iOS-Screenshots-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
@@ -3682,7 +3682,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_FILE = Testing/Screenshots/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/Screenshots/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
@@ -3690,7 +3690,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.example.VLC-iOSScreenShots";
PRODUCT_MODULE_NAME = VLC_iOS_Screenshots;
PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Testing/Screenshots/VLC-iOS-Screenshots-Bridging-Header.h";
+ SWIFT_OBJC_BRIDGING_HEADER = "Buildsystem/Testing/Screenshots/VLC-iOS-Screenshots-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = "VLC-iOS";
@@ -3718,7 +3718,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_FILE = Testing/Screenshots/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/Screenshots/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 12.2;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
@@ -3726,7 +3726,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.example.VLC-iOSScreenShots";
PRODUCT_MODULE_NAME = VLC_iOS_Screenshots;
PRODUCT_NAME = "$(TARGET_NAME)";
- SWIFT_OBJC_BRIDGING_HEADER = "Testing/Screenshots/VLC-iOS-Screenshots-Bridging-Header.h";
+ SWIFT_OBJC_BRIDGING_HEADER = "Buildsystem/Testing/Screenshots/VLC-iOS-Screenshots-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
TEST_TARGET_NAME = "VLC-iOS";
@@ -3754,7 +3754,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_FILE = Testing/Unit/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/Unit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
@@ -3793,7 +3793,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_FILE = Testing/Unit/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/Unit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
@@ -3831,7 +3831,7 @@
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
- INFOPLIST_FILE = Testing/Unit/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/Unit/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
@@ -3881,7 +3881,7 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
- INFOPLIST_FILE = Testing/UI/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/UI/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = YES;
@@ -3931,7 +3931,7 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
- INFOPLIST_FILE = Testing/UI/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/UI/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;
@@ -3982,7 +3982,7 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
- INFOPLIST_FILE = Testing/UI/Info.plist;
+ INFOPLIST_FILE = Buildsystem/Testing/UI/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
MTL_ENABLE_DEBUG_INFO = NO;