Skip to content

Commit 9253b33

Browse files
authored
Merge pull request #25 from IBMStreams/develop
November release
2 parents 8c5b98d + dcfa2af commit 9253b33

File tree

14 files changed

+745
-343
lines changed

14 files changed

+745
-343
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,12 @@ Command | Title | Visibility | Description
5252
--- | --- | --- | ---
5353
`ibm-streams.setServiceCredentials` | Set IBM Streaming Analytics Service Credentials | `*` | Sets the credentials for an IBM Streaming Analytics service. This is required to build applications.
5454
`ibm-streams.setToolkitsPath` | Set IBM Streams Toolkits Path | `*` | Sets the path to a directory containing IBM Streams toolkits. This is required if your applications use toolkits that are not provided with the Streams product.
55-
`ibm-streams.build` | SPL Build | `*.spl` | Builds an application.
56-
`ibm-streams.buildDownload` | SPL Build and Download Bundle | `*.spl` | Builds an application and downloads the Streams application bundle (`.sab`) to the local file system in the project's `output/` directory.
57-
`ibm-streams.buildSubmit` | SPL Build and Submit Job | `*.spl` | Builds an application and downloads the Streams application bundle (`.sab`) to the local file system in the project's `output/` directory. You will be redirected to the [Streaming Analytics](https://console.bluemix.net/docs/services/StreamingAnalytics/index.html#gettingstarted) Console to (configure and) submit the bundle to the Streams instance.
58-
`ibm-streams.createApplication` | Create a SPL Application from Template | `*` | Creates a minimal application containing a source `.spl` file and a [`info.xml`](https://www.ibm.com/support/knowledgecenter/SSCRJU_4.3.0/com.ibm.streams.dev.doc/doc/toolkitartifacts.html) file.
55+
`ibm-streams.buildDownload` | Build | `*.spl` | Builds an application from source and downloads the Streams application bundle (`.sab`) to the local file system in the project's `output/` directory.
56+
`ibm-streams.buildSubmit` | Build and Submit Job | `*.spl` | Builds an application from source and submits it to a [Streaming Analytics](https://console.bluemix.net/docs/services/StreamingAnalytics/index.html#gettingstarted) instance. There are two submission options: (1) submit with the default configuration; (2) use the Streaming Analytics Console to customize the submission-time configuration.
57+
`ibm-streams.buildMakeDownload` | Build | `Makefile` | Builds applications defined in a Makefile and downloads the Streams application bundles (`.sab`) to the local file system in the project's `output/` directory.
58+
`ibm-streams.buildMakeSubmit` | Build and Submit Job(s) | `Makefile` | Builds applications defined in a Makefile and submits them to a [Streaming Analytics](https://console.bluemix.net/docs/services/StreamingAnalytics/index.html#gettingstarted) instance. There are two submission options: (1) submit with the default configuration; (2) use the Streaming Analytics Console to customize the submission-time configuration.
59+
`ibm-streams.submit` | Submit Job | `*.sab` | Submits an application to a [Streaming Analytics](https://console.bluemix.net/docs/services/StreamingAnalytics/index.html#gettingstarted) instance. There are two submission options: (1) submit with the default configuration; (2) use the Streaming Analytics Console to customize the submission-time configuration.
60+
`ibm-streams.createApplication` | Create an IBM Streams Application from Template | `*` | Creates a minimal application containing a source `.spl` file and an [`info.xml`](https://www.ibm.com/support/knowledgecenter/SSCRJU_4.3.0/com.ibm.streams.dev.doc/doc/toolkitartifacts.html) file.
5961

6062
![Commands](./images/commands.png)
6163

images/commands.png

298 KB
Loading

package.json

Lines changed: 83 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,33 @@
6363
"category": "IBM Streams"
6464
},
6565
{
66-
"command": "ibm-streams.build",
67-
"title": "SPL Build",
66+
"command": "ibm-streams.buildDownload",
67+
"title": "Build",
6868
"category": "IBM Streams"
6969
},
7070
{
71-
"command": "ibm-streams.buildDownload",
72-
"title": "SPL Build and Download Bundle",
71+
"command": "ibm-streams.buildSubmit",
72+
"title": "Build and Submit Job",
7373
"category": "IBM Streams"
7474
},
7575
{
76-
"command": "ibm-streams.buildSubmit",
77-
"title": "SPL Build and Submit Job",
76+
"command": "ibm-streams.buildMakeDownload",
77+
"title": "Build",
78+
"category": "IBM Streams"
79+
},
80+
{
81+
"command": "ibm-streams.buildMakeSubmit",
82+
"title": "Build and Submit Job(s)",
83+
"category": "IBM Streams"
84+
},
85+
{
86+
"command": "ibm-streams.submit",
87+
"title": "Submit Job",
7888
"category": "IBM Streams"
7989
},
8090
{
8191
"command": "ibm-streams.createApplication",
82-
"title": "Create a SPL Application From Template",
92+
"title": "Create an IBM Streams Application from Template",
8393
"category": "IBM Streams"
8494
}
8595
],
@@ -122,10 +132,6 @@
122132
{
123133
"command": "ibm-streams.setToolkitsPath"
124134
},
125-
{
126-
"command": "ibm-streams.build",
127-
"when": "resourceLangId == spl"
128-
},
129135
{
130136
"command": "ibm-streams.buildDownload",
131137
"when": "resourceLangId == spl"
@@ -134,71 +140,113 @@
134140
"command": "ibm-streams.buildSubmit",
135141
"when": "resourceLangId == spl"
136142
},
143+
{
144+
"command": "ibm-streams.buildMakeDownload",
145+
"when": "resourceLangId == makefile"
146+
},
147+
{
148+
"command": "ibm-streams.buildMakeSubmit",
149+
"when": "resourceLangId == makefile"
150+
},
151+
{
152+
"command": "ibm-streams.submit",
153+
"when": "resourceFilename =~ /.*\\.sab/"
154+
},
137155
{
138156
"command": "ibm-streams.createApplication"
139157
}
140158
],
141159
"explorer/context": [
142-
{
143-
"command": "ibm-streams.build",
144-
"when": "resourceLangId == spl",
145-
"group": "SPL_BUILD@1"
146-
},
147160
{
148161
"command": "ibm-streams.buildDownload",
149162
"when": "resourceLangId == spl",
150-
"group": "SPL_BUILD@2"
163+
"group": "STREAMS@1"
151164
},
152165
{
153166
"command": "ibm-streams.buildSubmit",
154167
"when": "resourceLangId == spl",
155-
"group": "SPL_BUILD@3"
168+
"group": "STREAMS@2"
169+
},
170+
{
171+
"command": "ibm-streams.buildMakeDownload",
172+
"when": "resourceLangId == makefile",
173+
"group": "STREAMS@1"
174+
},
175+
{
176+
"command": "ibm-streams.buildMakeSubmit",
177+
"when": "resourceLangId == makefile",
178+
"group": "STREAMS@2"
179+
},
180+
{
181+
"command": "ibm-streams.submit",
182+
"when": "resourceFilename =~ /.*\\.sab/",
183+
"group": "STREAMS@3"
156184
},
157185
{
158186
"command": "ibm-streams.createApplication",
159-
"group": "SPL_GENERAL@4"
187+
"group": "STREAMS@4"
160188
}
161189
],
162190
"editor/context": [
163-
{
164-
"command": "ibm-streams.build",
165-
"when": "resourceLangId == spl",
166-
"group": "SPL_BUILD@1"
167-
},
168191
{
169192
"command": "ibm-streams.buildDownload",
170193
"when": "resourceLangId == spl",
171-
"group": "SPL_BUILD@2"
194+
"group": "STREAMS@1"
172195
},
173196
{
174197
"command": "ibm-streams.buildSubmit",
175198
"when": "resourceLangId == spl",
176-
"group": "SPL_BUILD@3"
199+
"group": "STREAMS@2"
200+
},
201+
{
202+
"command": "ibm-streams.buildMakeDownload",
203+
"when": "resourceLangId == makefile",
204+
"group": "STREAMS@1"
205+
},
206+
{
207+
"command": "ibm-streams.buildMakeSubmit",
208+
"when": "resourceLangId == makefile",
209+
"group": "STREAMS@2"
210+
},
211+
{
212+
"command": "ibm-streams.submit",
213+
"when": "resourceFilename =~ /.*\\.sab/",
214+
"group": "STREAMS@3"
177215
},
178216
{
179217
"command": "ibm-streams.createApplication",
180-
"group": "SPL_GENERAL@4"
218+
"group": "STREAMS@4"
181219
}
182220
],
183221
"editor/title/context": [
184-
{
185-
"command": "ibm-streams.build",
186-
"when": "resourceLangId == spl",
187-
"group": "SPL_BUILD@1"
188-
},
189222
{
190223
"command": "ibm-streams.buildDownload",
191224
"when": "resourceLangId == spl",
192-
"group": "SPL_BUILD@2"
225+
"group": "STREAMS@1"
193226
},
194227
{
195228
"command": "ibm-streams.buildSubmit",
196229
"when": "resourceLangId == spl",
197-
"group": "SPL_BUILD@3"
230+
"group": "STREAMS@2"
231+
},
232+
{
233+
"command": "ibm-streams.buildMakeDownload",
234+
"when": "resourceLangId == makefile",
235+
"group": "STREAMS@1"
236+
},
237+
{
238+
"command": "ibm-streams.buildMakeSubmit",
239+
"when": "resourceLangId == makefile",
240+
"group": "STREAMS@2"
241+
},
242+
{
243+
"command": "ibm-streams.submit",
244+
"when": "resourceFilename =~ /.*\\.sab/",
245+
"group": "STREAMS@3"
198246
},
199247
{
200248
"command": "ibm-streams.createApplication",
201-
"group": "SPL_GENERAL@4"
249+
"group": "STREAMS@4"
202250
}
203251
]
204252
},

src/extension.ts

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ import * as os from 'os';
55
import * as _ from 'underscore';
66

77
import { Trace } from 'vscode-jsonrpc';
8-
import { commands, window, workspace, ConfigurationTarget, ExtensionContext } from 'vscode';
8+
import { commands, workspace, ConfigurationTarget, ExtensionContext } from 'vscode';
99
import { LanguageClient, LanguageClientOptions, ServerOptions } from 'vscode-languageclient/lib/main';
1010

1111
import { SplBuilder } from './lib/spl-build-common';
1212
import { SplConfig } from './lib/config';
1313
import { SplLinter } from './lib/linter';
1414
import { SplLogger } from './lib/logger';
15-
import { Command } from './lib/commands/command';
15+
import { BaseCommand } from './lib/commands/command';
1616
import { SetConfigSettingCommand } from './lib/commands/setConfigSetting';
17-
import { SplBuildCommand } from './lib/commands/splBuild';
17+
import { BuildCommand, Command } from './lib/commands/build';
1818
import { CreateApplicationCommand } from './lib/commands/createApplication';
1919

2020
let client: LanguageClient;
@@ -31,7 +31,7 @@ export function activate(context: ExtensionContext): void {
3131
};
3232

3333
const clientOptions: LanguageClientOptions = {
34-
outputChannelName: 'SPL Language Server',
34+
outputChannelName: 'IBM Streams SPL Language Server',
3535
documentSelector: [{ scheme: 'file', language: 'spl' }],
3636
synchronize: {
3737
fileEvents: workspace.createFileSystemWatcher('**/*.*')
@@ -40,7 +40,7 @@ export function activate(context: ExtensionContext): void {
4040
};
4141

4242
// Create the language client and start the client
43-
client = new LanguageClient('SPL', serverOptions, clientOptions);
43+
client = new LanguageClient('IBM Streams', serverOptions, clientOptions);
4444

4545
// Enable tracing
4646
client.trace = Trace.Verbose;
@@ -49,14 +49,10 @@ export function activate(context: ExtensionContext): void {
4949
// client can be deactivated on extension deactivation
5050
context.subscriptions.push(client.start());
5151

52-
// Set up output channel for logging
53-
const outputChannel = window.createOutputChannel('SPL');
54-
SplLogger.registerOutputPanel(outputChannel);
55-
context.subscriptions.push(outputChannel);
56-
5752
// Configure
5853
SplConfig.configure(context, client);
5954
SplLinter.configure(context);
55+
SplLogger.configure(context);
6056
workspace.getConfiguration('workbench').update('colorCustomizations', {
6157
'[Streams Light]': {
6258
'editor.selectionBackground': '#E2F5FF',
@@ -71,24 +67,26 @@ export function activate(context: ExtensionContext): void {
7167
}, ConfigurationTarget.Global);
7268

7369
// Register commands
74-
const streamsCommands = new Array<Command>();
70+
const streamsCommands = new Array<BaseCommand>();
7571
streamsCommands.push(new SetConfigSettingCommand('ibm-streams.setServiceCredentials'));
7672
streamsCommands.push(new SetConfigSettingCommand('ibm-streams.setToolkitsPath'));
77-
streamsCommands.push(new SplBuildCommand('ibm-streams.build', SplBuilder.BUILD_ACTION.DEFAULT));
78-
streamsCommands.push(new SplBuildCommand('ibm-streams.buildDownload', SplBuilder.BUILD_ACTION.DOWNLOAD));
79-
streamsCommands.push(new SplBuildCommand('ibm-streams.buildSubmit', SplBuilder.BUILD_ACTION.SUBMIT));
73+
streamsCommands.push(new BuildCommand(Command.BUILD_DOWNLOAD, SplBuilder.BUILD_ACTION.DOWNLOAD));
74+
streamsCommands.push(new BuildCommand(Command.BUILD_SUBMIT, SplBuilder.BUILD_ACTION.SUBMIT));
75+
streamsCommands.push(new BuildCommand(Command.BUILD_MAKE_DOWNLOAD, SplBuilder.BUILD_ACTION.DOWNLOAD));
76+
streamsCommands.push(new BuildCommand(Command.BUILD_MAKE_SUBMIT, SplBuilder.BUILD_ACTION.SUBMIT));
77+
streamsCommands.push(new BuildCommand(Command.SUBMIT));
8078
streamsCommands.push(new CreateApplicationCommand());
8179

8280
_.each(streamsCommands, command => {
8381
context.subscriptions.push(commands.registerCommand(command.commandName, (...args) => {
8482
command.execute(context, args)
8583
.catch(error => {
86-
SplLogger.error(`An error occurred while executing command: ${command.commandName}`);
84+
SplLogger.error(null, `An error occurred while executing command: ${command.commandName}`);
8785
if (error && error.stack) {
88-
SplLogger.error(error.stack);
86+
SplLogger.error(null, error.stack);
8987
}
9088
if (command.commandName.includes('ibm-streams.build')) {
91-
SplLogger.error('Build failed', true, true);
89+
SplLogger.error(null, 'Build failed', true, true);
9290
}
9391
});
9492
}));

0 commit comments

Comments
 (0)