Add nuclide-swift#621
Conversation
| })); | ||
| } | ||
|
|
||
| export function consumeOutputService(service: OutputService): void { |
There was a problem hiding this comment.
Last week I made it so that the task runner package will call setProjectRoot() on task runners (if that method exists) so you don't really need to consume this service.
There was a problem hiding this comment.
Yeah, I saw that API -- neat! Did you mean to leave this comment on the consumeCurrentWorkingDirectory line, though? I think I'll need the output service, to display the build output from SwiftPM.
be8077c to
ea72c51
Compare
|
@modocache updated the pull request. |
ea72c51 to
a744518
Compare
|
@modocache updated the pull request. |
a744518 to
1a8371e
Compare
|
@modocache updated the pull request. |
|
@matthewwithanm Thanks! I think I've addressed all your feedback. Give this another look when you can. |
| } | ||
|
|
||
| observeTaskList(callback: (taskList: Array<TaskMetadata>) => mixed): IDisposable { | ||
| if (this._taskList == null) { |
There was a problem hiding this comment.
Since the task meta doesn't actually change, you could just do:
callback(SwiftPMTaskRunnerTaskMetadata);
return new Disposable();nbd though.
1a8371e to
f2f00ac
Compare
|
@modocache updated the pull request. |
@matthewwithanm I thought of a few alternatives:
I don't mind the current "sticky" behavior, but if either of the above is more common in Nuclide, I'll implement that. |
|
@facebook-github-bot shipit |
|
Thanks for importing. If you are an FB employee go to Phabricator to review internal test results. |
|
When we tried to land this, it failed the flow check, and the "nuclide deactivates cleanly" integration test (and will fail the lint check). First, rebase past 8632e79 (just landed). Then:
diff --git a/pkg/nuclide-swift/lib/taskrunner/toolbar/SwiftPMTaskRunnerToolbar.js b/pkg/nuclide-swift/lib/taskrunner/toolbar/SwiftPMTaskRunnerToolbar.js
index 92801b3..abeb2b0 100644
--- a/pkg/nuclide-swift/lib/taskrunner/toolbar/SwiftPMTaskRunnerToolbar.js
+++ b/pkg/nuclide-swift/lib/taskrunner/toolbar/SwiftPMTaskRunnerToolbar.js
@@ -14,7 +14,7 @@ import {AtomInput} from '../../../../nuclide-ui/lib/AtomInput';
import {Button, ButtonSizes} from '../../../../nuclide-ui/lib/Button';
import {
SwiftPMTaskRunnerBuildTaskMetadata,
- SwiftPMTaskRunnerTestTaskMetadata
+ SwiftPMTaskRunnerTestTaskMetadata,
} from '../SwiftPMTaskRunnerTaskMetadata';
import SwiftPMBuildSettingsModal from './SwiftPMBuildSettingsModal';
import SwiftPMTestSettingsModal from './SwiftPMTestSettingsModal';
@@ -29,7 +29,7 @@ export default class SwiftPMTaskRunnerToolbar extends React.Component {
}
render(): React.Element<any> {
- let settingsElements = [];
+ const settingsElements = [];
switch (this.props.activeTaskType) {
case SwiftPMTaskRunnerBuildTaskMetadata.type:
settingsElements.push(
@@ -42,7 +42,7 @@ export default class SwiftPMTaskRunnerToolbar extends React.Component {
onDismiss={() => this._hideSettings()}
onSave={(configuration, Xcc, Xlinker, Xswiftc, buildPath) =>
this._saveBuildSettings(configuration, Xcc, Xlinker, Xswiftc, buildPath)}
- />
+ />,
);
break;
case SwiftPMTaskRunnerTestTaskMetadata.type:
@@ -51,7 +51,7 @@ export default class SwiftPMTaskRunnerToolbar extends React.Component {
buildPath={this.props.store.getTestBuildPath()}
onDismiss={() => this._hideSettings()}
onSave={buildPath => this._saveTestSettings(buildPath)}
- />
+ />,
);
break;
default:
@@ -106,7 +106,7 @@ export default class SwiftPMTaskRunnerToolbar extends React.Component {
Xcc,
Xlinker,
Xswiftc,
- buildPath
+ buildPath,
);
this._hideSettings();
}
diff --git a/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunnerCommands.js b/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunnerCommands.js
index db0c8aa..858b365 100644
--- a/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunnerCommands.js
+++ b/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunnerCommands.js
@@ -9,7 +9,7 @@
* the root directory of this source tree.
*/
-import featureConfig from '../../../nuclide-feature-config';
+import featureConfig from '../../../commons-atom/featureConfig';
export function buildCommand(
chdir: string,
diff --git a/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunner.js b/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunner.js
index 42760f6..6b35c9f 100644
--- a/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunner.js
+++ b/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunner.js
@@ -16,6 +16,7 @@ import type {SwiftPMTaskRunnerStoreState} from './SwiftPMTaskRunnerStoreState';
import invariant from 'assert';
import {Observable, Subject} from 'rxjs';
import {Dispatcher} from 'flux';
+import {DisposableSubscription} from '../../../commons-node/stream';
import {CompositeDisposable, Disposable} from 'atom';
import {React} from 'react-for-atom';
import fsPromise from '../../../commons-node/fsPromise';
@@ -68,7 +69,7 @@ export class SwiftPMTaskRunner {
this._initialState = initialState;
this._disposables = new CompositeDisposable();
this._outputMessages = new Subject();
- this._disposables.add(this._outputMessages);
+ this._disposables.add(new DisposableSubscription(this._outputMessages));
}
dispose(): void {
|
|
@matthewwithanm these are the remaining flow errors. idk what they're about. |
f2f00ac to
2ed934f
Compare
|
@modocache updated the pull request. |
2ed934f to
238f286
Compare
|
Thanks for the tips! I pushed up some changes to fix the Flow and linter errors. I silenced the diff --git a/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunner.js b/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunner.js
index 42760f6..856cd0a 100644
--- a/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunner.js
+++ b/pkg/nuclide-swift/lib/taskrunner/SwiftPMTaskRunner.js
@@ -137,7 +138,7 @@ export class SwiftPMTaskRunner {
const observable = observeProcess(
() => safeSpawn(command.command, command.args),
- ).do(message => {
+ ).switchMap(message => {
switch (message.kind) {
case 'stderr':
case 'stdout':
@@ -159,7 +160,7 @@ export class SwiftPMTaskRunner {
default:
break;
}
- return message;
+ return Observable.empty();
});
const task = observableToTaskInfo(observable);Not sure if that's right, but it seems to work. :) |
|
@modocache updated the pull request. |
238f286 to
207e7d2
Compare
|
@modocache updated the pull request. |
207e7d2 to
70a8f7c
Compare
|
@modocache updated the pull request. |
|
🎉 |
Swift package manager integration with Nuclide. Build Swift packages, run their test suites, and view the results. Future commits will have this package parse the YAML build output from Swift package manager in order to provide accurate autocompletion, type hints, and more.
70a8f7c to
a5aecb3
Compare
|
@modocache updated the pull request. |
|
@facebook-github-bot shipit |
|
Thanks for importing. If you are an FB employee go to Phabricator to review internal test results. |

Swift package manager integration with Nuclide. Build Swift packages, run their test suites, and view the results.
Future commits will have this package parse the YAML build output from Swift package manager in order to provide accurate autocompletion, type hints, and more. See http://modocache.io/nuclide-swift-ide for details.
Some screenshots: