Skip to content

[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

Merged
merged 5 commits into from
Dec 1, 2016
Merged

[SR-3279] Renaming Task to Process #724

merged 5 commits into from
Dec 1, 2016

Conversation

damuellen
Copy link
Contributor

Simple search and replace

@@ -457,7 +457,7 @@ extension Task {
}
}

public let NSTaskDidTerminateNotification: String = "NSTaskDidTerminateNotification"
public let ProcessDidTerminateNotification: String = "ProcessDidTerminateNotification"
Copy link
Member

@ikesyo ikesyo Nov 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
thread.start()
}

// Set the running flag to false

task.running = false
process.running = false
Copy link
Member

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

@damuellen
Copy link
Contributor Author

Thanks @ikesyo
I have adapted it according to your comments.


self.runLoop = nil
}
}

public let NSTaskDidTerminateNotification: String = "NSTaskDidTerminateNotification"
public let didTerminateNotification: String = "NSTaskDidTerminateNotification"
Copy link
Member

@ikesyo ikesyo Nov 28, 2016

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ikesyo
Copy link
Member

ikesyo commented Nov 28, 2016

The type of standardInput, standardOutput and standardError should be changed to Any?.

Copy link
Contributor

@phausler phausler left a 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 */; };
Copy link
Contributor

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)

@phausler
Copy link
Contributor

@swift-ci Please test

@phausler phausler self-assigned this Nov 28, 2016
@damuellen
Copy link
Contributor Author

Updated build.py and comments implemented


self.runLoop = nil
}
}

public let NSTaskDidTerminateNotification: String = "NSTaskDidTerminateNotification"
public let didTerminateNotification = NSNotification.Name(rawValue: "NSTaskDidTerminateNotification")
Copy link
Member

@ikesyo ikesyo Nov 28, 2016

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.

@damuellen
Copy link
Contributor Author

@ikesyo Thanks again for reviewing.

@parkera
Copy link
Contributor

parkera commented Nov 28, 2016

@swift-ci please test

@parkera parkera merged commit 418ebb8 into swiftlang:master Dec 1, 2016
@damuellen damuellen deleted the SR-3279 branch December 2, 2016 07:59
@naithar naithar mentioned this pull request Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants