Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected async launchTests(launchConfiguration: DebugConfiguration): Promise {
const commandParams: string[] = [];
if (launchConfiguration.vmArgs) {
commandParams.push(...launchConfiguration.vmArgs);
}
const javaDebugPort: number = await getPort();
if (!launchConfiguration.noDebug) {
commandParams.push('-Xdebug', `-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=${javaDebugPort}`);
}
if (launchConfiguration.encoding) {
commandParams.push(`-Dfile.encoding=${launchConfiguration.encoding}`);
}
if (launchConfiguration.classPaths) {
this.storagePathForCurrentSession = path.join(this.storagePath || os.tmpdir(), new Date().getTime().toString());
commandParams.push('-cp', await classpathUtils.getClassPathString(launchConfiguration.classPaths, this.storagePathForCurrentSession));
}
if (launchConfiguration.mainClass) {
commandParams.push(launchConfiguration.mainClass);
}
public addDebugEnv(): Thenable {
let env = Object.create(process.env);
if (this.debug) {
env.DEBUGGING = true;
env.use_nested_specs = "false";
env.SHOULD_BUILD_PROJECT = "true";
return getPort.default({ port: this.debugPort }).then((port) => {
if (this.config.getProject().isProjectLanguage(GaugeRunners.Dotnet)) {
env.GAUGE_CSHARP_PROJECT_CONFIG = "Debug";
}
if (this.config.getProject().isProjectLanguage(GaugeRunners.Java)) env.GAUGE_DEBUG_OPTS = port;
env.DEBUG_PORT = port;
this.debugPort = port;
return env;
});
} else {
return Promise.resolve(env);
}
}