Skip to content

Commit

Permalink
Merge branch 'release/0.14'
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldmannak committed May 24, 2019
2 parents 72a58a1 + 2497d98 commit 70d20d5
Show file tree
Hide file tree
Showing 14 changed files with 355 additions and 414 deletions.
20 changes: 7 additions & 13 deletions ZKPlayground.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
C76F0A8E2251943F002B275B /* BuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = C76F0A8D2251943F002B275B /* BuildPhase.swift */; };
C76F0A902252D167002B275B /* BuildPhaseView.xib in Resources */ = {isa = PBXBuildFile; fileRef = C76F0A8F2252D167002B275B /* BuildPhaseView.xib */; };
C76F0A922252D8A0002B275B /* BuildPhaseStackView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C76F0A912252D8A0002B275B /* BuildPhaseStackView.swift */; };
C78A91C22246F7720033233E /* RemoteDockerAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78A91C12246F7720033233E /* RemoteDockerAPI.swift */; };
C78A91CA22488BA00033233E /* NSColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78A91C922488BA00033233E /* NSColor.swift */; };
C78A92442248ADD60033233E /* CompilerError.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78A92432248ADD60033233E /* CompilerError.swift */; };
C78A92462248AF3A0033233E /* String.swift in Sources */ = {isa = PBXBuildFile; fileRef = C78A92452248AF3A0033233E /* String.swift */; };
Expand All @@ -41,7 +40,7 @@
C7AE8A9222442EE6001EC64A /* EditorWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AE8A9122442EE6001EC64A /* EditorWindowController.swift */; };
C7AE8A94224430B0001EC64A /* SplitViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AE8A93224430B0001EC64A /* SplitViewController.swift */; };
C7AE8A9622443135001EC64A /* InspectorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AE8A9522443135001EC64A /* InspectorViewController.swift */; };
C7AE8A9A22445986001EC64A /* Docker.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AE8A97224443BA001EC64A /* Docker.swift */; };
C7AE8A9A22445986001EC64A /* ShellOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7AE8A97224443BA001EC64A /* ShellOperation.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -74,14 +73,12 @@
C76F0A8D2251943F002B275B /* BuildPhase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildPhase.swift; sourceTree = "<group>"; };
C76F0A8F2252D167002B275B /* BuildPhaseView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BuildPhaseView.xib; sourceTree = "<group>"; };
C76F0A912252D8A0002B275B /* BuildPhaseStackView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BuildPhaseStackView.swift; sourceTree = "<group>"; };
C78A91C12246F7720033233E /* RemoteDockerAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RemoteDockerAPI.swift; sourceTree = "<group>"; };
C78A91C922488BA00033233E /* NSColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSColor.swift; sourceTree = "<group>"; };
C78A92432248ADD60033233E /* CompilerError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CompilerError.swift; sourceTree = "<group>"; };
C78A92452248AF3A0033233E /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = "<group>"; };
C79BE65C2255765C00325471 /* slice1_512@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "slice1_512@2x.png"; sourceTree = "<group>"; };
C7AE8A5C22434E55001EC64A /* ZKPlayground.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZKPlayground.app; sourceTree = BUILT_PRODUCTS_DIR; };
C7AE8A5F22434E55001EC64A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
C7AE8A6122434E55001EC64A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
C7AE8A6322434E55001EC64A /* Document.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Document.swift; sourceTree = "<group>"; };
C7AE8A6522434E59001EC64A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
C7AE8A6822434E59001EC64A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
Expand All @@ -97,7 +94,7 @@
C7AE8A9122442EE6001EC64A /* EditorWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditorWindowController.swift; sourceTree = "<group>"; };
C7AE8A93224430B0001EC64A /* SplitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplitViewController.swift; sourceTree = "<group>"; };
C7AE8A9522443135001EC64A /* InspectorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InspectorViewController.swift; sourceTree = "<group>"; };
C7AE8A97224443BA001EC64A /* Docker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Docker.swift; sourceTree = "<group>"; };
C7AE8A97224443BA001EC64A /* ShellOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShellOperation.swift; sourceTree = "<group>"; };
CD92BEDFC397D6BE20E8D2FE /* Pods-ZKPlaygroundTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ZKPlaygroundTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ZKPlaygroundTests/Pods-ZKPlaygroundTests.release.xcconfig"; sourceTree = "<group>"; };
DF75002819B65626EA81721D /* Pods-ZKPlayground.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ZKPlayground.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ZKPlayground/Pods-ZKPlayground.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -161,13 +158,12 @@
path = Inspector;
sourceTree = "<group>";
};
C78A91C3224718390033233E /* Docker Operations */ = {
C78A91C3224718390033233E /* Shell Operations */ = {
isa = PBXGroup;
children = (
C7AE8A97224443BA001EC64A /* Docker.swift */,
C78A91C12246F7720033233E /* RemoteDockerAPI.swift */,
C7AE8A97224443BA001EC64A /* ShellOperation.swift */,
);
path = "Docker Operations";
path = "Shell Operations";
sourceTree = "<group>";
};
C78A91C822488B970033233E /* Extensions */ = {
Expand Down Expand Up @@ -207,8 +203,7 @@
C764DC5D2257B3B80042B122 /* Template Window */,
C7AE8A8122436470001EC64A /* Editor Window */,
C7AE8A5F22434E55001EC64A /* AppDelegate.swift */,
C78A91C3224718390033233E /* Docker Operations */,
C7AE8A6122434E55001EC64A /* ViewController.swift */,
C78A91C3224718390033233E /* Shell Operations */,
C7AE8A6322434E55001EC64A /* Document.swift */,
C7AE8A8F22436B37001EC64A /* ZKError.swift */,
C78A92432248ADD60033233E /* CompilerError.swift */,
Expand Down Expand Up @@ -450,7 +445,6 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
C78A91C22246F7720033233E /* RemoteDockerAPI.swift in Sources */,
C76F0A8C22518043002B275B /* TimeInterval.swift in Sources */,
C764DC64225C73250042B122 /* ZokratesInterface.swift in Sources */,
C7AE8A9222442EE6001EC64A /* EditorWindowController.swift in Sources */,
Expand All @@ -465,7 +459,7 @@
C7AE8A9022436B37001EC64A /* ZKError.swift in Sources */,
C764DC68225C742E0042B122 /* InterfaceProtocol.swift in Sources */,
C7AE8A6022434E55001EC64A /* AppDelegate.swift in Sources */,
C7AE8A9A22445986001EC64A /* Docker.swift in Sources */,
C7AE8A9A22445986001EC64A /* ShellOperation.swift in Sources */,
C7AE8A6422434E55001EC64A /* Document.swift in Sources */,
C76F0A922252D8A0002B275B /* BuildPhaseStackView.swift in Sources */,
C764DC612257B3F60042B122 /* TemplatesViewController.swift in Sources */,
Expand Down
25 changes: 12 additions & 13 deletions ZKPlayground/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {

func applicationDidFinishLaunching(_ aNotification: Notification) {

dockerInstall()
verifyZokratesInstall()

// If no document is restored, show template chooser
// if NSDocumentController.shared.documents.isEmpty {
Expand All @@ -31,21 +31,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool {
return false
}

private func dockerInstall() {

private func verifyZokratesInstall() {

let zokratesPath = FileManager.default.homeDirectoryForCurrentUser.appendingPathComponent(".zokrates/bin/zokrates").path

print(zokratesPath)

if FileManager.default.isExecutableFile(atPath: "//usr//local//bin//docker") { return }
if FileManager.default.isExecutableFile(atPath: zokratesPath) { return }

// Zokrates is not installed
let alert = NSAlert()
alert.messageText = "Docker is not installed"
alert.informativeText = "ZK Playground requires Docker"
alert.addButton(withTitle: "Download Docker")
alert.addButton(withTitle: "Continue anyway")
let response = alert.runModal()
if response == .alertFirstButtonReturn,
let url = URL(string: "https://docs.docker.com/docker-for-mac/install") {
NSWorkspace.shared.open(url)
}
alert.messageText = "Zokrates is not installed"
alert.informativeText = "run 'curl -LSfs get.zokrat.es | sh' in the terminal to install Zokrates"
alert.runModal()
}

@IBAction func showTemplates(_ sender: AnyObject?) {
Expand Down
4 changes: 2 additions & 2 deletions ZKPlayground/BuildPhase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BuildPhase: NSObject {
self.errorMessage = errorMessage

self.urls = phase.filenames.map{
URL(fileURLWithPath: workDirectory).appendingPathComponent(Docker.buildDirectory).appendingPathComponent($0).path
URL(fileURLWithPath: workDirectory).appendingPathComponent("build").appendingPathComponent($0).path
}
if let urls = self.urls { self.successful = urls.filter{ FileManager.default.fileExists(atPath: $0) }.count == urls.count
} else { self.successful = false }
Expand Down Expand Up @@ -85,7 +85,7 @@ enum BuildPhaseType: String {
case .compile:
return ["out", "out.code"]
case .setup:
return ["proving.key", "variables.inf", "verification.key"]
return ["proving.key", "verification.key"] // "variables.inf"
case .witness:
return ["witness"]
case .proof:
Expand Down
249 changes: 0 additions & 249 deletions ZKPlayground/Docker Operations/Docker.swift

This file was deleted.

Loading

0 comments on commit 70d20d5

Please sign in to comment.