Rename types package and fix tests
This commit is contained in:
Родитель
0018d62a9d
Коммит
45fc036a69
|
@ -16,12 +16,12 @@ jobs:
|
|||
- name: Build & prepare extension
|
||||
uses: eskatos/gradle-command-action@v1
|
||||
with:
|
||||
arguments: extension:prepareForRelease types-package:build -x buildTypeScript -x buildTypeScriptTests
|
||||
arguments: extension:prepareForRelease npm-package:build -x buildTypeScript -x buildTypeScriptTests
|
||||
- name: Publish types
|
||||
env:
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
cd types-package
|
||||
cd npm-package
|
||||
tag=${GITHUB_REF#refs/tags/}
|
||||
echo "Setting package version $tag"
|
||||
npm --no-git-tag-version version "$tag"
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
},
|
||||
"typescript.tsc.autoDetect": "off",
|
||||
"eslint.validate": ["javascript", "typescript"],
|
||||
"eslint.workingDirectories": ["extension","types-package"],
|
||||
"eslint.workingDirectories": ["extension","npm-package"],
|
||||
"java.configuration.updateBuildConfiguration": "automatic",
|
||||
"cSpell.language": "en-GB",
|
||||
"cSpell.words": [
|
||||
|
|
|
@ -151,7 +151,7 @@ task buildTypeScriptTests(type: CrossPlatformExec) {
|
|||
}
|
||||
|
||||
task bundle(type: CrossPlatformExec) {
|
||||
dependsOn ':tasks-server:build', ':types-package:build', copyProtoJs, copyProtoTs
|
||||
dependsOn ':tasks-server:build', ':npm-package:build', copyProtoJs, copyProtoTs
|
||||
group 'build'
|
||||
description 'Bundles the extension files for release'
|
||||
buildDir = 'dist'
|
||||
|
|
|
@ -15,7 +15,7 @@ import {
|
|||
} from './config';
|
||||
import { logger } from './logger';
|
||||
import { GradleTasksClient } from './client';
|
||||
import { waitOnTcp } from './util';
|
||||
import { waitOnTcp, isTest } from './util';
|
||||
import {
|
||||
Output,
|
||||
GradleProject,
|
||||
|
@ -23,6 +23,7 @@ import {
|
|||
GradleBuild,
|
||||
} from './proto/gradle_tasks_pb';
|
||||
import { SERVER_TASK_NAME } from './server';
|
||||
import { OutputBuffer } from './OutputBuffer';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
|
@ -454,6 +455,12 @@ class CustomBuildTaskTerminal implements vscode.Pseudoterminal {
|
|||
}
|
||||
|
||||
private async doBuild(): Promise<void> {
|
||||
// This is only required in the tests, so we can check the stdout of the task
|
||||
const stdOutBuffer = new OutputBuffer(Output.OutputType.STDOUT);
|
||||
stdOutBuffer.onOutputLine((output: string) => {
|
||||
logger.info(output);
|
||||
});
|
||||
|
||||
const args: string[] = this.task.definition.args.split(' ').filter(Boolean);
|
||||
try {
|
||||
const javaDebugEnabled = this.task.definition.javaDebug;
|
||||
|
@ -467,12 +474,16 @@ class CustomBuildTaskTerminal implements vscode.Pseudoterminal {
|
|||
javaDebugPort,
|
||||
(output: Output): void => {
|
||||
this.handleOutput(output.getMessageByte());
|
||||
if (isTest()) {
|
||||
stdOutBuffer.write(output.getMessageByte());
|
||||
}
|
||||
}
|
||||
);
|
||||
if (javaDebugEnabled) {
|
||||
await this.startJavaDebug(javaDebugPort!);
|
||||
}
|
||||
await runTask;
|
||||
stdOutBuffer.dispose();
|
||||
vscode.commands.executeCommand(
|
||||
'gradle.updateJavaProjectConfiguration',
|
||||
vscode.Uri.file(this.task.definition.buildFile)
|
||||
|
|
|
@ -129,14 +129,14 @@ describe(fixtureName, () => {
|
|||
let hasMessage = false;
|
||||
const stdOutBuffer = new OutputBuffer(Output.OutputType.STDOUT);
|
||||
stdOutBuffer.onOutputLine((message: string) => {
|
||||
if (message === 'Hello, World!') {
|
||||
if (message.trim() === 'Hello, World!') {
|
||||
hasMessage = true;
|
||||
}
|
||||
});
|
||||
const runTaskOpts = {
|
||||
projectFolder: fixturePath,
|
||||
taskName: 'hello',
|
||||
showOutputColors: true,
|
||||
showOutputColors: false,
|
||||
onOutput: (output: Output): void => {
|
||||
stdOutBuffer.write(output.getMessageByte());
|
||||
},
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
description = 'vscode-gradle :: types'
|
||||
description = 'vscode-gradle :: npm-package'
|
||||
|
||||
def isWindows = System.getProperty('os.name').toLowerCase().contains('windows')
|
||||
|
||||
|
@ -17,6 +17,13 @@ task copyProtoLib(type: Copy) {
|
|||
into protoLib
|
||||
}
|
||||
|
||||
task copyOutputBuffer(type: Copy) {
|
||||
group 'copy'
|
||||
description 'Copies OutputBuffer helper class'
|
||||
from file("../extension/src/OutputBuffer.ts")
|
||||
into 'lib'
|
||||
}
|
||||
|
||||
task copyPublicApiTypes(type: Copy) {
|
||||
group 'copy'
|
||||
description 'Copies publc API types'
|
||||
|
@ -39,4 +46,8 @@ task compileTypeScript(type: CrossPlatformExec) {
|
|||
commandLine 'npm', 'run', 'compile'
|
||||
}
|
||||
|
||||
assemble.finalizedBy npmInstall, compileTypeScript, copyProtoLib, copyPublicApiTypes
|
||||
assemble.finalizedBy npmInstall,
|
||||
compileTypeScript,
|
||||
copyProtoLib,
|
||||
copyPublicApiTypes,
|
||||
copyOutputBuffer
|
|
@ -0,0 +1,11 @@
|
|||
import * as vscode from 'vscode';
|
||||
import { Output } from './lib/proto/gradle_tasks_pb';
|
||||
import { RunTaskHandler, RunTaskOpts } from './lib/runTask';
|
||||
import { OutputBuffer } from './lib/OutputBuffer';
|
||||
|
||||
interface ExtensionApi {
|
||||
runTask: RunTaskHandler;
|
||||
onTasksLoaded: vscode.Event<null>;
|
||||
}
|
||||
|
||||
export { Output, RunTaskHandler, RunTaskOpts, OutputBuffer, ExtensionApi };
|
|
@ -1,4 +1,4 @@
|
|||
rootProject.name = 'vscode-gradle'
|
||||
include('tasks-server')
|
||||
include('extension')
|
||||
include('types-package')
|
||||
include('npm-package')
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
import * as vscode from 'vscode';
|
||||
import { Output, RunTaskRequest } from './lib/proto/gradle_tasks_pb';
|
||||
import { RunTaskHandler, RunTaskOpts } from './lib/runTask';
|
||||
|
||||
export { Output, RunTaskRequest, RunTaskHandler, RunTaskOpts };
|
||||
|
||||
export interface ExtensionApi {
|
||||
runTask: RunTaskHandler;
|
||||
onTasksLoaded: vscode.Event<null>;
|
||||
}
|
Загрузка…
Ссылка в новой задаче