-
Notifications
You must be signed in to change notification settings - Fork 1.2k
[SR-3279] Renaming Task to Process #724
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -457,7 +457,7 @@ extension Task { | |||
} | |||
} | |||
|
|||
public let NSTaskDidTerminateNotification: String = "NSTaskDidTerminateNotification" | |||
public let ProcessDidTerminateNotification: String = "ProcessDidTerminateNotification" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Darwin, this is Process.didTerminateNotification
: https://developer.apple.com/reference/foundation/process/1413681-didterminatenotification
} | ||
thread.start() | ||
} | ||
|
||
// Set the running flag to false | ||
|
||
task.running = false | ||
process.running = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The property should be renamed to isRunning
too: https://developer.apple.com/reference/foundation/process/1415788-isrunning
Thanks @ikesyo |
|
||
self.runLoop = nil | ||
} | ||
} | ||
|
||
public let NSTaskDidTerminateNotification: String = "NSTaskDidTerminateNotification" | ||
public let didTerminateNotification: String = "NSTaskDidTerminateNotification" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct, the value is a Process
's static property and the type is NSNotification.Name
:
extension Process {
public static let didTerminateNotification: NSNotification.Name = ...
}
task.launchPath = path | ||
task.arguments = arguments | ||
task.launch() | ||
open class func launchedTaskWithLaunchPath(_ path: String, arguments: [String]) -> Process { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The type of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest looks fine to me modulo some of the other commentary which is on point
@@ -383,7 +383,7 @@ | |||
EADE0BB51BD15E0000C49C64 /* NSScanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = EADE0B771BD15DFF00C49C64 /* NSScanner.swift */; }; | |||
EADE0BB61BD15E0000C49C64 /* NSSortDescriptor.swift in Sources */ = {isa = PBXBuildFile; fileRef = EADE0B781BD15DFF00C49C64 /* NSSortDescriptor.swift */; }; | |||
EADE0BB71BD15E0000C49C64 /* NSStream.swift in Sources */ = {isa = PBXBuildFile; fileRef = EADE0B791BD15DFF00C49C64 /* NSStream.swift */; }; | |||
EADE0BB81BD15E0000C49C64 /* NSTask.swift in Sources */ = {isa = PBXBuildFile; fileRef = EADE0B7A1BD15DFF00C49C64 /* NSTask.swift */; }; | |||
EADE0BB81BD15E0000C49C64 /* Process.swift in Sources */ = {isa = PBXBuildFile; fileRef = EADE0B7A1BD15DFF00C49C64 /* Process.swift */; }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not see a build.py alteration for this; might be a problem on linux builds (which is a pre-requisite to merging)
@swift-ci Please test |
Updated build.py and comments implemented |
|
||
self.runLoop = nil | ||
} | ||
} | ||
|
||
public let NSTaskDidTerminateNotification: String = "NSTaskDidTerminateNotification" | ||
public let didTerminateNotification = NSNotification.Name(rawValue: "NSTaskDidTerminateNotification") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still defined as a global constant, not as a static property of Process
.
@ikesyo Thanks again for reviewing. |
@swift-ci please test |
Simple search and replace