Skip to content

Commit

Permalink
Build time RPATH check & Reinstate EvalApp eexample
Browse files Browse the repository at this point in the history
  • Loading branch information
johnno1962 committed Sep 30, 2020
1 parent 09e3b9a commit b97fee4
Show file tree
Hide file tree
Showing 8 changed files with 181 additions and 21 deletions.
2 changes: 1 addition & 1 deletion EvalApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
// Insert code here to initialize your application
SwiftEval.instance.evalError = {
let err = $0
if !err.hasPrefix("Compiling ") {
if !err.hasPrefix("💉 Compiling ") {
DispatchQueue.main.async {
self.textView.string = err
}
Expand Down
6 changes: 6 additions & 0 deletions EvalApp/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
5 changes: 4 additions & 1 deletion EvalApp/EvalApp.entitlements
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict/>
<dict>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
2 changes: 1 addition & 1 deletion EvalApp/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<string>App.icns</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
Expand Down
6 changes: 3 additions & 3 deletions InjectionBundle/SwiftEval.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Created by John Holdsworth on 02/11/2017.
// Copyright © 2017 John Holdsworth. All rights reserved.
//
// $Id: //depot/ResidentEval/InjectionBundle/SwiftEval.swift#139 $
// $Id: //depot/ResidentEval/InjectionBundle/SwiftEval.swift#144 $
//
// Basic implementation of a Swift "eval()" including the
// mechanics of recompiling a class and loading the new
Expand Down Expand Up @@ -375,13 +375,13 @@ public class SwiftEval: NSObject {

let projectDir = projectFile.deletingLastPathComponent().path

_ = evalError("Compiling \(sourceFile)")
_ = evalError("💉 Compiling \(sourceFile)")

guard shell(command: """
(cd "\(projectDir.escaping("$"))" && \(compileCommand) -o \(tmpfile).o >\(logfile) 2>&1)
""") else {
compileByClass.removeValue(forKey: classNameOrFile)
throw evalError("Re-compilation failed (\(tmpDir)/command.sh)\n\(try! String(contentsOfFile: logfile))")
throw evalError("Re-compilation failed (see: \(tmpDir)/command.sh)\n\(try! String(contentsOfFile: logfile))")
}

compileByClass[classNameOrFile] = (compileCommand, sourceFile)
Expand Down
Loading

0 comments on commit b97fee4

Please sign in to comment.