Skip to content

Commit

Permalink
install all helper executables
Browse files Browse the repository at this point in the history
  • Loading branch information
JPMoresmau committed Sep 30, 2012
1 parent e350c3e commit 9dffd09
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class InstallExecutableDialog extends Dialog {
private Button bUser;
private Button bIgnore;

private Button bExtras;

public InstallExecutableDialog( final Shell parentShell,final boolean buildWrapper, final String buildWrapperMinVersion,
final boolean scionBrowser, final String scionBrowserMinVersion) {
super( parentShell );
Expand Down Expand Up @@ -97,13 +99,22 @@ protected Control createDialogArea( final Composite parent ) {
gd.horizontalSpan=2;
l.setLayoutData( gd );

bExtras=new Button(c,SWT.CHECK);
bExtras.setText( UITexts.executables_extra );
bExtras.setSelection( true );
gd=new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan=2;
bExtras.setLayoutData( gd );

bUser=new Button(c,SWT.CHECK);
bUser.setText( UITexts.executablesmissing_user );
bUser.setSelection( true );

bIgnore=new Button(c,SWT.CHECK);
bIgnore.setText( UITexts.executablesmissing_ignore);



return c;
}

Expand Down Expand Up @@ -131,7 +142,12 @@ protected void okPressed() {
}
if (scionBrowser){
j.getPackages().add( new InstallExecutableRunnable.Package( "scion-browser", IPreferenceConstants.SCION_BROWSER_SERVER_EXECUTABLE) );

}
if (bExtras.getSelection()){
j.getPackages().add( new InstallExecutableRunnable.Package( "hoogle", IPreferenceConstants.SCION_BROWSER_EXTRA_HOOGLE_PATH) );
j.getPackages().add( new InstallExecutableRunnable.Package( "hlint", IPreferenceConstants.HLINT_EXECUTABLE) );
j.getPackages().add( new InstallExecutableRunnable.Package( "stylish-haskell",IPreferenceConstants.STYLISHHASKELL_EXECUTABLE) );
j.getPackages().add( new InstallExecutableRunnable.Package( "SourceGraph",IPreferenceConstants.SOURCEGRAPH_EXECUTABLE) );
}
//j.setBuildWrapper( buildWrapper );
j.setCabalUpdate( true );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,13 @@ public void run(){
commands.add(new Command(UITexts.scionBrowserInstallProgress,"scion-browser",IPreferenceConstants.SCION_BROWSER_SERVER_EXECUTABLE,Arrays.asList( cabalExecutable , "install","scion-browser", global?"--global": "--user" )));
}*/
for (Package p:packages){
commands.add(new Command(NLS.bind( UITexts.installExecutableProgress,p.name),p.name,p.getName(),Arrays.asList( cabalExecutable , "install",p.name, global?"--global": "--user" )));
List<String> args=new ArrayList<String>(Arrays.asList( cabalExecutable , "install",p.getName(), global?"--global": "--user" ));

File f=new File(binDir,FileUtil.makeExecutableName( p.getName() ));
if (!f.exists()){ // the exe does not exist, we force reinstall to make sure it wasn't deleted manually
args.add( "--reinstall" );
}
commands.add(new Command(NLS.bind( UITexts.installExecutableProgress,p.getName()),p.getName(),p.getPreference(),args));
}
final File fBinDir=binDir;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,7 @@ public final class UITexts extends NLS {
public static String executablestoo_old_message2;
public static String error_getVersion;
public static String error_checkVersion;
public static String executables_extra;

public static String executablesmissing_title;
public static String executablesmissing_message1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ executablesmissing_install=Install
executablesmissing_user=Install for current user only
executablesmissing_ignore=Do not ask me again

executables_extra=Install optional helper executables (hoogle, hlint, stylish-haskell, SourceGraph)

error_getVersion = Error retrieving executable version
error_checkVersion = Error checking executable version

Expand Down

0 comments on commit 9dffd09

Please sign in to comment.