Permalink
Browse files

install all helper executables

  • Loading branch information...
JPMoresmau committed Sep 30, 2012
1 parent e350c3e commit 9dffd092be80c3eb4312554cb052241e8d22d73f
@@ -37,6 +37,8 @@
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 );
@@ -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;
}
@@ -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 );
@@ -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;
@@ -443,6 +443,7 @@
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;
@@ -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

0 comments on commit 9dffd09

Please sign in to comment.