-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is just the basic start, and only a code deployer to start with (and one that doesn't deploy at that, as I don't know the command)
- Loading branch information
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
'use strict'; | ||
|
||
import * as jsonc from 'jsonc-parser'; | ||
import * as path from 'path'; | ||
import * as vscode from 'vscode'; | ||
import { ICodeDeployer, IExecuteAPI, IExternalAPI, IPreferencesAPI } from 'vscode-wpilibapi'; | ||
import { gradleRun, readFileAsync } from '../utilities'; | ||
|
||
class DeployCodeDeployer implements ICodeDeployer { | ||
private preferences: IPreferencesAPI; | ||
private executeApi: IExecuteAPI; | ||
|
||
constructor(externalApi: IExternalAPI) { | ||
this.preferences = externalApi.getPreferencesAPI(); | ||
this.executeApi = externalApi.getExecuteAPI(); | ||
} | ||
|
||
public async getIsCurrentlyValid(workspace: vscode.WorkspaceFolder): Promise<boolean> { | ||
const prefs = this.preferences.getPreferences(workspace); | ||
const currentLanguage = prefs.getCurrentLanguage(); | ||
return currentLanguage === 'none' || currentLanguage === 'java'; | ||
} | ||
|
||
public async runDeployer(teamNumber: number, workspace: vscode.WorkspaceFolder, | ||
_: vscode.Uri | undefined, ...args: string[]): Promise<boolean> { | ||
// TODO actaully deploy | ||
return false; | ||
} | ||
|
||
public getDisplayName(): string { | ||
return 'python'; | ||
} | ||
|
||
public getDescription(): string { | ||
return 'Python Deploy'; | ||
} | ||
} | ||
|
||
export class DeployDebug { | ||
private deployDeployer: DeployCodeDeployer; | ||
|
||
constructor(externalApi: IExternalAPI) { | ||
const deployDebugApi = externalApi.getDeployDebugAPI(); | ||
deployDebugApi.addLanguageChoice('python'); | ||
|
||
//this.deployDebuger = new DebugCodeDeployer(externalApi); | ||
this.deployDeployer = new DeployCodeDeployer(externalApi); | ||
//this.simulator = new SimulateCodeDeployer(externalApi); | ||
|
||
deployDebugApi.registerCodeDeploy(this.deployDeployer); | ||
|
||
// if (allowDebug) { | ||
// deployDebugApi.registerCodeDebug(this.deployDebuger); | ||
// deployDebugApi.registerCodeSimulate(this.simulator); | ||
// } | ||
} | ||
|
||
public dispose() { | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict'; | ||
|
||
import * as path from 'path'; | ||
import * as vscode from 'vscode'; | ||
import { IExternalAPI } from "vscode-wpilibapi"; | ||
import { DeployDebug } from './deploydebug'; | ||
|
||
export async function activatePython(context: vscode.ExtensionContext, coreExports: IExternalAPI) { | ||
|
||
const extensionResourceLocation = path.join(context.extensionPath, 'resources', 'python'); | ||
|
||
const preferences = coreExports.getPreferencesAPI(); | ||
const exampleTemplate = coreExports.getExampleTemplateAPI(); | ||
const commandApi = coreExports.getCommandAPI(); | ||
|
||
const deployDebug = new DeployDebug(coreExports); | ||
context.subscriptions.push(deployDebug); | ||
|
||
|
||
} |