Skip to content
This repository was archived by the owner on Mar 11, 2024. It is now read-only.

Commit f107448

Browse files
committed
Decorate arguments of type "Any" in traces.
1 parent 223df3f commit f107448

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

InjectionBundle/SwiftEval.swift

+12-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by John Holdsworth on 02/11/2017.
66
// Copyright © 2017 John Holdsworth. All rights reserved.
77
//
8-
// $Id: //depot/ResidentEval/InjectionBundle/SwiftEval.swift#160 $
8+
// $Id: //depot/ResidentEval/InjectionBundle/SwiftEval.swift#162 $
99
//
1010
// Basic implementation of a Swift "eval()" including the
1111
// mechanics of recompiling a class and loading the new
@@ -545,7 +545,7 @@ public class SwiftEval: NSObject {
545545
// print(regexp)
546546

547547
// messy but fast
548-
guard shell(command: """
548+
let logScanCommand = """
549549
# search through build logs, most recent first
550550
cd "\(logsDir.path.escaping("$"))"
551551
for log in `ls -t *.xcactivitylog`; do
@@ -609,11 +609,18 @@ public class SwiftEval: NSObject {
609609
) "$log" >"\(tmpfile).sh" && exit 0
610610
done
611611
exit 1;
612-
""") else {
612+
"""
613+
614+
guard shell(command: logScanCommand) else {
613615
return nil
614616
}
615617

616-
var compileCommand = try! String(contentsOfFile: "\(tmpfile).sh")
618+
var compileCommand: String
619+
do {
620+
compileCommand = try String(contentsOfFile: "\(tmpfile).sh")
621+
} catch {
622+
throw evalError("Error reading \(tmpfile).sh, scanCommand: \(logScanCommand)")
623+
}
617624
compileCommand = compileCommand.components(separatedBy: " -o ")[0] + " "
618625

619626
// remove excess escaping in new build system
@@ -779,7 +786,7 @@ public class SwiftEval: NSObject {
779786
}
780787

781788
#if !os(macOS)
782-
let runner = ScriptRunner()
789+
lazy var runner = ScriptRunner()
783790

784791
class ScriptRunner {
785792
let commandsOut: UnsafeMutablePointer<FILE>

InjectionIII.xcodeproj/project.pbxproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1407,7 +1407,7 @@
14071407
INFOPLIST_FILE = InjectionIII/Info.plist;
14081408
LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks";
14091409
MACOSX_DEPLOYMENT_TARGET = 10.12;
1410-
MARKETING_VERSION = 2.5.0;
1410+
MARKETING_VERSION = 2.5.1;
14111411
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.InjectionIII;
14121412
PRODUCT_NAME = "$(TARGET_NAME)";
14131413
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -1430,7 +1430,7 @@
14301430
INFOPLIST_FILE = InjectionIII/Info.plist;
14311431
LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks";
14321432
MACOSX_DEPLOYMENT_TARGET = 10.12;
1433-
MARKETING_VERSION = 2.5.0;
1433+
MARKETING_VERSION = 2.5.1;
14341434
PRODUCT_BUNDLE_IDENTIFIER = com.johnholdsworth.InjectionIII;
14351435
PRODUCT_NAME = "$(TARGET_NAME)";
14361436
PROVISIONING_PROFILE_SPECIFIER = "";

InjectionIII/Info.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleShortVersionString</key>
2020
<string>$(MARKETING_VERSION)</string>
2121
<key>CFBundleVersion</key>
22-
<string>5692</string>
22+
<string>5987</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.developer-tools</string>
2525
<key>LSMinimumSystemVersion</key>

InjectionIII/build_bundles.sh

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# Created by John Holdsworth on 04/10/2019.
77
# Copyright © 2019 John Holdsworth. All rights reserved.
88
#
9-
# $Id: //depot/ResidentEval/InjectionIII/build_bundles.sh#62 $
9+
# $Id: //depot/ResidentEval/InjectionIII/build_bundles.sh#63 $
1010
#
1111

1212
# Injection has to assume a fixed path for Xcode.app as it uses
@@ -40,7 +40,8 @@ function build_bundle () {
4040
#build_bundle macOS MacOSX macosx &&
4141
build_bundle iOS iPhoneSimulator iphonesimulator &&
4242
build_bundle tvOS AppleTVSimulator appletvsimulator &&
43-
# iphoneos on M1 mac
43+
44+
# iphoneos on M1 mac (requires Sanbox switched off)
4445
#build_bundle maciOS iPhoneOS iphoneos &&
4546

4647
# macOSSwiftUISupport needs to be built separately from the main app

SwiftUISupport/SwiftUISupport.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by John Holdsworth on 25/09/2020.
66
// Copyright © 2020 John Holdsworth. All rights reserved.
77
//
8-
// $Id: //depot/ResidentEval/SwiftUISupport/SwiftUISupport.swift#24 $
8+
// $Id: //depot/ResidentEval/SwiftUISupport/SwiftUISupport.swift#25 $
99
//
1010

1111
import SwiftUI
@@ -41,6 +41,7 @@ class SwiftUISupport: NSObject {
4141
SwiftMeta.bindGeneric(name: "getBindingType", owner: Self.self)
4242
SwiftMeta.wrapperHandlers["SwiftUI.State<"] =
4343
SwiftMeta.bindGeneric(name: "getStateType", owner: Self.self)
44+
SwiftTrace.makeTraceable(types: [SwiftUI.Text.self])
4445
print("💉 Installed SwiftUI type handlers")
4546
}
4647
}

0 commit comments

Comments
 (0)