commandLine.addParameter("--ignore-unrecognized-flags");
commandLine.addParameter("--enable_async");
final String vmOptions = runnerParameters.getVMOptions();
if (vmOptions != null) {
final StringTokenizer vmOptionsTokenizer = new CommandLineTokenizer(vmOptions);
while (vmOptionsTokenizer.hasMoreTokens()) {
commandLine.addParameter(vmOptionsTokenizer.nextToken());
}
}
if (runnerParameters.isCheckedMode()) {
commandLine.addParameter(DartiumUtil.CHECKED_MODE_OPTION);
}
final VirtualFile dartFile;
try {
dartFile = runnerParameters.getDartFile();
}
catch (RuntimeConfigurationError e) {
throw new ExecutionException(e);
}
final VirtualFile[] packageRoots = DartUrlResolver.getInstance(project, dartFile).getPackageRoots();
if (packageRoots.length > 0) {
// more than one package root is not supported by the [SDK]/bin/dart tool
commandLine.addParameter("--package-root=" + FileUtil.toSystemDependentName(packageRoots[0].getPath()));
}
if (DefaultDebugExecutor.EXECUTOR_ID.equals(getEnvironment().getExecutor().getId())) {
myDebuggingPort = NetUtils.tryToFindAvailableSocketPort();
commandLine.addParameter("--debug:" + myDebuggingPort);
commandLine.addParameter("--break-at-isolate-spawn");
}
myObservatoryPort = PubServerManager.findOneMoreAvailablePort(myDebuggingPort);
commandLine.addParameter("--enable-vm-service:" + myObservatoryPort);
commandLine.addParameter("--trace_service_pause_events");
commandLine.addParameter(FileUtil.toSystemDependentName(overriddenMainFilePath == null ? dartFile.getPath() : overriddenMainFilePath));
final String arguments = runnerParameters.getArguments();
if (arguments != null) {
StringTokenizer argumentsTokenizer = new CommandLineTokenizer(arguments);
while (argumentsTokenizer.hasMoreTokens()) {
commandLine.addParameter(argumentsTokenizer.nextToken());
}
}
}