/*******************************************************************************
* Copyright (c) 2012, 2016, 2017 PDT Extension Group and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* PDT Extension Group - initial API and implementation
* Kaloyan Raev - [501269] externalize strings
*******************************************************************************/
package org.eclipse.php.composer.ui.job;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.exec.ExecuteException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Platform;
import org.eclipse.php.composer.core.launch.ScriptLauncher;
public class InstallJob extends ComposerJob {
public InstallJob(IProject project) {
super(project, Messages.InstallJob_Name);
}
protected void launch(ScriptLauncher launcher) throws ExecuteException, IOException, InterruptedException {
List<String> params = new ArrayList<>();
params.add("--no-dev"); //$NON-NLS-1$
// workaround for incorrect progress displaying on Windows
if (Platform.OS_WIN32.equals(Platform.getOS())) {
params.add("--no-progress"); //$NON-NLS-1$
}
launcher.launch("install", params.toArray(new String[0])); //$NON-NLS-1$
}
}