composite.setLayoutData(gd);
Label errorLabel = new Label(composite, SWT.NONE);
- errorLabel.setText(String.format(ERROR_LABEL, GBSOptionManager.CURRENT_GBS_VERSION));
+ errorLabel.setText(String.format(ERROR_LABEL, Double.toString(GBSOptionManager.MIN_GBS_VERSION)));
}
private void createCcacheOption(Composite parent, int index) {
public class GBSOptionManager {
private static ArrayList<GBSOption> options = new ArrayList<GBSOption>();
private static boolean initialized = false;
- public static String CURRENT_GBS_VERSION = "0.12";
+ public static double MIN_GBS_VERSION = 0.12;
public static void addOption(GBSOption op) {
options.add(op);
return false;
}
String result = CommandLauncher.executeOutput("gbs --version", null, true, null);
- if ( !result.contains(CURRENT_GBS_VERSION) ) {
+
+ // result format : gbs [version]
+ String[] results = result.trim().split(" ");
+ if (results.length != 2) {
+ return false;
+ }
+ String command = results[0];
+ double ver = Double.parseDouble(results[1]);
+
+ if ( !command.equals("gbs") || ver < MIN_GBS_VERSION) {
return false;
}