Skip to content

Commit 1ebb8f2

Browse files
author
Yunuuuu
authored
add R package build task - build source and build binary like RStudio (#1029)
* add R build binary task * add r.buildsource and r.buildbinary command * rename * rename to comply with name convention
1 parent 3016cd2 commit 1ebb8f2

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,11 @@
444444
"category": "R Package",
445445
"command": "r.build"
446446
},
447+
{
448+
"title": "Build Binary",
449+
"category": "R Package",
450+
"command": "r.buildBinary"
451+
},
447452
{
448453
"title": "Check",
449454
"category": "R Package",

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<apiImp
111111

112112
// environment independent commands. this is a workaround for using the Tasks API: https://github.com/microsoft/vscode/issues/40758
113113
'r.build': () => vscode.commands.executeCommand('workbench.action.tasks.runTask', 'R: Build'),
114+
'r.buildBinary': () => vscode.commands.executeCommand('workbench.action.tasks.runTask', 'R: Build Binary'),
114115
'r.check': () => vscode.commands.executeCommand('workbench.action.tasks.runTask', 'R: Check'),
115116
'r.document': () => vscode.commands.executeCommand('workbench.action.tasks.runTask', 'R: Document'),
116117
'r.install': () => vscode.commands.executeCommand('workbench.action.tasks.runTask', 'R: Install'),

src/tasks.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ const rtasks: RTaskInfo[] = [
5454
group: vscode.TaskGroup.Build,
5555
problemMatchers: []
5656
},
57+
58+
{
59+
definition: {
60+
type: TYPE,
61+
code: ['devtools::build(binary = TRUE, args = c(\'--preclean\'))']
62+
},
63+
name: 'Build Binary',
64+
group: vscode.TaskGroup.Build,
65+
problemMatchers: []
66+
},
5767

5868
{
5969
definition: {

0 commit comments

Comments
 (0)