Skip to content

Commit 7cae572

Browse files
committed
Broke PlaygroundLogger's dependency on PlaygroundRuntime.
PlaygroundRuntime is still somewhat experimental, so PlaygroundLogger shouldn't yet depend on it.
1 parent 6ce9a75 commit 7cae572

File tree

3 files changed

+3
-73
lines changed

3 files changed

+3
-73
lines changed

PlaygroundLogger/PlaygroundLogger.xcodeproj/project.pbxproj

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
5E2646361FB64876002DC6B6 /* PlaygroundLoggerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E2646351FB64876002DC6B6 /* PlaygroundLoggerTests.swift */; };
1212
5E2646381FB64876002DC6B6 /* PlaygroundLogger.h in Headers */ = {isa = PBXBuildFile; fileRef = 5E26462A1FB64876002DC6B6 /* PlaygroundLogger.h */; settings = {ATTRIBUTES = (Public, ); }; };
1313
5E2646431FB64B2A002DC6B6 /* LoggerEntrypoints.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E2646421FB64B2A002DC6B6 /* LoggerEntrypoints.swift */; };
14-
5E2646501FB64F95002DC6B6 /* PlaygroundRuntime.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5E26464A1FB64F6B002DC6B6 /* PlaygroundRuntime.framework */; };
1514
5E2646521FB65026002DC6B6 /* LoggerInitialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E2646511FB65026002DC6B6 /* LoggerInitialization.swift */; };
1615
5E2755CF1FB657F200B69C83 /* LogEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E2755CE1FB657F200B69C83 /* LogEntry.swift */; };
1716
5E2755D11FB6619800B69C83 /* LogPacket.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5E2755D01FB6619800B69C83 /* LogPacket.swift */; };
@@ -84,20 +83,6 @@
8483
remoteGlobalIDString = 5E2646261FB64876002DC6B6;
8584
remoteInfo = PlaygroundLogger;
8685
};
87-
5E2646491FB64F6B002DC6B6 /* PBXContainerItemProxy */ = {
88-
isa = PBXContainerItemProxy;
89-
containerPortal = 5E2646451FB64F6B002DC6B6 /* PlaygroundRuntime.xcodeproj */;
90-
proxyType = 2;
91-
remoteGlobalIDString = 5EB7828B1FAE6B6F00ADE84E;
92-
remoteInfo = PlaygroundRuntime;
93-
};
94-
5E26464C1FB64F7B002DC6B6 /* PBXContainerItemProxy */ = {
95-
isa = PBXContainerItemProxy;
96-
containerPortal = 5E2646451FB64F6B002DC6B6 /* PlaygroundRuntime.xcodeproj */;
97-
proxyType = 1;
98-
remoteGlobalIDString = 5EB7828A1FAE6B6F00ADE84E;
99-
remoteInfo = PlaygroundRuntime;
100-
};
10186
/* End PBXContainerItemProxy section */
10287

10388
/* Begin PBXFileReference section */
@@ -108,7 +93,6 @@
10893
5E2646351FB64876002DC6B6 /* PlaygroundLoggerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaygroundLoggerTests.swift; sourceTree = "<group>"; };
10994
5E2646371FB64876002DC6B6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
11095
5E2646421FB64B2A002DC6B6 /* LoggerEntrypoints.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerEntrypoints.swift; sourceTree = "<group>"; };
111-
5E2646451FB64F6B002DC6B6 /* PlaygroundRuntime.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PlaygroundRuntime.xcodeproj; path = ../PlaygroundRuntime/PlaygroundRuntime.xcodeproj; sourceTree = "<group>"; };
11296
5E2646511FB65026002DC6B6 /* LoggerInitialization.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoggerInitialization.swift; sourceTree = "<group>"; };
11397
5E2755CE1FB657F200B69C83 /* LogEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogEntry.swift; sourceTree = "<group>"; };
11498
5E2755D01FB6619800B69C83 /* LogPacket.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogPacket.swift; sourceTree = "<group>"; };
@@ -178,7 +162,6 @@
178162
isa = PBXFrameworksBuildPhase;
179163
buildActionMask = 2147483647;
180164
files = (
181-
5E2646501FB64F95002DC6B6 /* PlaygroundRuntime.framework in Frameworks */,
182165
);
183166
runOnlyForDeploymentPostprocessing = 0;
184167
};
@@ -199,7 +182,6 @@
199182
5E2646291FB64876002DC6B6 /* PlaygroundLogger */,
200183
5E2646341FB64876002DC6B6 /* PlaygroundLoggerTests */,
201184
5E2646411FB649D0002DC6B6 /* PlaygroundLoggerTests_macOS */,
202-
5E2646441FB64F54002DC6B6 /* Referenced Projects */,
203185
5E2646281FB64876002DC6B6 /* Products */,
204186
5E26464F1FB64F95002DC6B6 /* Frameworks */,
205187
);
@@ -253,22 +235,6 @@
253235
path = PlaygroundLoggerTests_macOS;
254236
sourceTree = "<group>";
255237
};
256-
5E2646441FB64F54002DC6B6 /* Referenced Projects */ = {
257-
isa = PBXGroup;
258-
children = (
259-
5E2646451FB64F6B002DC6B6 /* PlaygroundRuntime.xcodeproj */,
260-
);
261-
name = "Referenced Projects";
262-
sourceTree = "<group>";
263-
};
264-
5E2646461FB64F6B002DC6B6 /* Products */ = {
265-
isa = PBXGroup;
266-
children = (
267-
5E26464A1FB64F6B002DC6B6 /* PlaygroundRuntime.framework */,
268-
);
269-
name = Products;
270-
sourceTree = "<group>";
271-
};
272238
5E26464F1FB64F95002DC6B6 /* Frameworks */ = {
273239
isa = PBXGroup;
274240
children = (
@@ -482,7 +448,6 @@
482448
buildRules = (
483449
);
484450
dependencies = (
485-
5E26464D1FB64F7B002DC6B6 /* PBXTargetDependency */,
486451
);
487452
name = PlaygroundLogger;
488453
productName = PlaygroundLogger;
@@ -538,12 +503,6 @@
538503
mainGroup = 5E26461D1FB64876002DC6B6;
539504
productRefGroup = 5E2646281FB64876002DC6B6 /* Products */;
540505
projectDirPath = "";
541-
projectReferences = (
542-
{
543-
ProductGroup = 5E2646461FB64F6B002DC6B6 /* Products */;
544-
ProjectRef = 5E2646451FB64F6B002DC6B6 /* PlaygroundRuntime.xcodeproj */;
545-
},
546-
);
547506
projectRoot = "";
548507
targets = (
549508
5E2646261FB64876002DC6B6 /* PlaygroundLogger */,
@@ -552,16 +511,6 @@
552511
};
553512
/* End PBXProject section */
554513

555-
/* Begin PBXReferenceProxy section */
556-
5E26464A1FB64F6B002DC6B6 /* PlaygroundRuntime.framework */ = {
557-
isa = PBXReferenceProxy;
558-
fileType = wrapper.framework;
559-
path = PlaygroundRuntime.framework;
560-
remoteRef = 5E2646491FB64F6B002DC6B6 /* PBXContainerItemProxy */;
561-
sourceTree = BUILT_PRODUCTS_DIR;
562-
};
563-
/* End PBXReferenceProxy section */
564-
565514
/* Begin PBXResourcesBuildPhase section */
566515
5E2646251FB64876002DC6B6 /* Resources */ = {
567516
isa = PBXResourcesBuildPhase;
@@ -666,11 +615,6 @@
666615
target = 5E2646261FB64876002DC6B6 /* PlaygroundLogger */;
667616
targetProxy = 5E2646321FB64876002DC6B6 /* PBXContainerItemProxy */;
668617
};
669-
5E26464D1FB64F7B002DC6B6 /* PBXTargetDependency */ = {
670-
isa = PBXTargetDependency;
671-
name = PlaygroundRuntime;
672-
targetProxy = 5E26464C1FB64F7B002DC6B6 /* PBXContainerItemProxy */;
673-
};
674618
/* End PBXTargetDependency section */
675619

676620
/* Begin XCBuildConfiguration section */

PlaygroundLogger/PlaygroundLogger/LogEntry+Reflection.swift

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2017-2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -12,7 +12,6 @@
1212

1313
import Foundation
1414
import CoreGraphics
15-
import PlaygroundRuntime // temporary, for CustomPlaygroundRepresentable
1615

1716
fileprivate class DebugQuickLookObjectHook: NSObject {
1817
@objc(debugQuickLookObject) func debugQuickLookObject() -> AnyObject? { return nil }
@@ -32,15 +31,8 @@ extension LogEntry {
3231
var typeName: String { return passedInTypeName ?? _typeName(type(of: instance)) }
3332
var summary: String { return passedInSummary ?? String(describing: instance) }
3433

35-
// For types which conform to the `CustomPlaygroundRepresentable` protocol, get their custom representation and then run it back through the initializer.
36-
if let customRepresentable = instance as? CustomPlaygroundRepresentable {
37-
// Pass in our current type name so
38-
// TODO: pass nil or concrete summary?
39-
self = .init(describing: customRepresentable.playgroundRepresentation, name: name, typeName: typeName, summary: nil)
40-
}
41-
4234
// For types which conform to the `CustomOpaqueLoggable` protocol, get their custom representation and construct an opaque log entry. (This is checked *second* so that user implementations of `CustomPlaygroundRepresentable` are honored over this framework's implementations of `CustomOpaqueLoggable`.)
43-
else if let customOpaqueLoggable = instance as? CustomOpaqueLoggable {
35+
if let customOpaqueLoggable = instance as? CustomOpaqueLoggable {
4436
// TODO: figure out when to set `preferBriefSummary` to true
4537
self = .opaque(name: name, typeName: typeName, summary: summary, preferBriefSummary: false, representation: customOpaqueLoggable.opaqueRepresentation)
4638
}

PlaygroundLogger/PlaygroundLogger/LoggerInitialization.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the Swift.org open source project
44
//
5-
// Copyright (c) 2017 Apple Inc. and the Swift project authors
5+
// Copyright (c) 2017-2018 Apple Inc. and the Swift project authors
66
// Licensed under Apache License v2.0 with Runtime Library Exception
77
//
88
// See http://swift.org/LICENSE.txt for license information
@@ -11,19 +11,13 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
import Foundation
14-
import PlaygroundRuntime
1514

1615
/// Initializes the PlaygroundLogger framework.
1716
///
1817
/// - note: This function is invoked by host stubs via dlsym.
1918
@_cdecl("PGLInitializePlaygroundLogger")
2019
public func initializePlaygroundLogger(clientVersion: Int, sendData: @escaping SendDataFunction) -> Void {
2120
Swift._playgroundPrintHook = printHook
22-
PlaygroundRuntime.$builtin_log_with_id = logResult
23-
PlaygroundRuntime.$builtin_log_scope_entry = logScopeEntry
24-
PlaygroundRuntime.$builtin_log_scope_exit = logScopeExit
25-
PlaygroundRuntime.$builtin_postPrint = logPostPrint
26-
2721
PlaygroundLogger.sendData = sendData
2822

2923
// TODO: take clientVersion and use to customize PlaygroundLogger behavior.

0 commit comments

Comments
 (0)