Skip to content

Commit 016aad2

Browse files
Merge branch 'develop' into log-reporting
2 parents 8d1cb61 + b22af29 commit 016aad2

File tree

45 files changed

+3323
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+3323
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ CMakeFiles/
77
Makefile
88
Testing/
99
build/
10+
examples/cocoapods/CocoapodsExample/Pods/
1011

1112
# idea project files
1213
# Xcode
@@ -87,4 +88,3 @@ fastlane/test_output
8788

8889
iOSInjectionProject/
8990
.DS_Store
90-

examples/cocoapods/CocoapodsExample/CocoapodsExample.xcodeproj/project.pbxproj

Lines changed: 462 additions & 0 deletions
Large diffs are not rendered by default.

examples/cocoapods/CocoapodsExample/CocoapodsExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

examples/cocoapods/CocoapodsExample/CocoapodsExample.xcworkspace/contents.xcworkspacedata

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
//
2+
// AppDelegate.swift
3+
// NRTestApp
4+
//
5+
// Created by Mike Bruin on 1/11/23.
6+
//
7+
8+
import UIKit
9+
import NewRelic
10+
11+
// For more info on installing the New Relic agent go to https://docs.newrelic.com/docs/mobile-monitoring/new-relic-mobile-ios/installation/spm-installation/#configure-using-swift-package-manager
12+
13+
class AppDelegate: UIResponder, UIApplicationDelegate {
14+
15+
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
16+
#if DEBUG
17+
// The New Relic agent is set to log at NRLogLevelInfo by default, verbose logging should only be used for debugging.
18+
NRLogger.setLogLevels(NRLogLevelVerbose.rawValue)
19+
#endif
20+
21+
NewRelic.start(withApplicationToken:"APP-TOKEN")
22+
23+
return true
24+
}
25+
26+
// MARK: UISceneSession Lifecycle
27+
28+
func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
29+
// Called when a new scene session is being created.
30+
// Use this method to select a configuration to create the new scene with.
31+
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
32+
}
33+
34+
func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set<UISceneSession>) {
35+
// Called when the user discards a scene session.
36+
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
37+
// Use this method to release any resources that were specific to the discarded scenes, as they will not return.
38+
}
39+
40+
41+
}
42+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"platform" : "ios",
6+
"size" : "1024x1024"
7+
},
8+
{
9+
"idiom" : "mac",
10+
"scale" : "1x",
11+
"size" : "16x16"
12+
},
13+
{
14+
"idiom" : "mac",
15+
"scale" : "2x",
16+
"size" : "16x16"
17+
},
18+
{
19+
"idiom" : "mac",
20+
"scale" : "1x",
21+
"size" : "32x32"
22+
},
23+
{
24+
"idiom" : "mac",
25+
"scale" : "2x",
26+
"size" : "32x32"
27+
},
28+
{
29+
"idiom" : "mac",
30+
"scale" : "1x",
31+
"size" : "128x128"
32+
},
33+
{
34+
"idiom" : "mac",
35+
"scale" : "2x",
36+
"size" : "128x128"
37+
},
38+
{
39+
"idiom" : "mac",
40+
"scale" : "1x",
41+
"size" : "256x256"
42+
},
43+
{
44+
"idiom" : "mac",
45+
"scale" : "2x",
46+
"size" : "256x256"
47+
},
48+
{
49+
"idiom" : "mac",
50+
"scale" : "1x",
51+
"size" : "512x512"
52+
},
53+
{
54+
"idiom" : "mac",
55+
"scale" : "2x",
56+
"size" : "512x512"
57+
}
58+
],
59+
"info" : {
60+
"author" : "xcode",
61+
"version" : 1
62+
}
63+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.app-sandbox</key>
6+
<true/>
7+
<key>com.apple.security.files.user-selected.read-only</key>
8+
<true/>
9+
</dict>
10+
</plist>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//
2+
// CocoapodsExampleApp.swift
3+
// CocoapodsExample
4+
//
5+
// Created by Chris Dillard on 9/20/23.
6+
//
7+
8+
import SwiftUI
9+
10+
@main
11+
struct CocoapodsExampleApp: App {
12+
13+
@UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
14+
15+
var body: some Scene {
16+
WindowGroup {
17+
ContentView()
18+
}
19+
}
20+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//
2+
// ContentView.swift
3+
// CocoapodsExample
4+
//
5+
// Created by Chris Dillard on 9/20/23.
6+
//
7+
8+
import SwiftUI
9+
import NewRelic
10+
11+
struct ContentView: View {
12+
var body: some View {
13+
VStack {
14+
Image(systemName: "globe")
15+
.imageScale(.large)
16+
Text("Hello, world!")
17+
18+
Button {
19+
crash()
20+
} label: {
21+
Text("Test crash")
22+
}
23+
}
24+
.padding()
25+
}
26+
27+
func crash() {
28+
// This will cause a crash to test the crash uploader, crash files will not get recorded if the debugger is running.
29+
NewRelic.crashNow("New Relic intentionally crashed to test Utils")
30+
}
31+
}
32+
33+
#Preview {
34+
ContentView()
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Uncomment the next line to define a global platform for your project
2+
platform :ios, '11.0'
3+
4+
target 'CocoapodsExample' do
5+
# Comment the next line if you don't want to use dynamic frameworks
6+
use_frameworks!
7+
8+
# Pods for CocoapodsExample
9+
10+
pod 'NewRelicAgent'
11+
12+
end
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
PODS:
2+
- NewRelicAgent (7.4.8)
3+
4+
DEPENDENCIES:
5+
- NewRelicAgent
6+
7+
SPEC REPOS:
8+
trunk:
9+
- NewRelicAgent
10+
11+
SPEC CHECKSUMS:
12+
NewRelicAgent: 87553984bd86ff4d0e1ae213ef4bade772c86c0a
13+
14+
PODFILE CHECKSUM: a12233dda4cc53061de03554f08862e636e26a89
15+
16+
COCOAPODS: 1.14.3
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
# 2022 New Relic
4+
# Shell wrapper script used to upload a builds debug symbols to New Relic.
5+
# run-symbol-tool
6+
7+
if [ ! $1 ]; then
8+
echo "New Relic: usage: $0 <NEW_RELIC_APP_TOKEN> [--debug]"
9+
exit -1
10+
fi
11+
12+
API_KEY=$1
13+
DEBUG_FLAG=${2:-''}
14+
15+
echo "New Relic: Processing dSYMs and uploading to New Relic. (In background...)"
16+
echo "New Relic: For troubleshooting, see upload_dsym_results.log file in project root folder. Add --debug after app token in Run Script for additional information."
17+
18+
WORK_DIRECTORY=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
19+
SCRIPT="$WORK_DIRECTORY/run-symbol-tool.swift"
20+
21+
## Running with below command is useful for seeing output in Xcode,
22+
## but it will incur delays in the build process while the dSYMs process and upload.
23+
# /usr/bin/xcrun --sdk macosx swift "$SCRIPT" $API_KEY $DEBUG_FLAG
24+
25+
/usr/bin/xcrun --sdk macosx swift "$SCRIPT" $API_KEY $DEBUG_FLAG > upload_dsym_results.log 2>&1 &

0 commit comments

Comments
 (0)