From a4957fc27c68e543f093dfa17b28eda595caeedb Mon Sep 17 00:00:00 2001 From: "donghyuk.yang" Date: Fri, 8 Feb 2013 15:20:01 +0900 Subject: [PATCH] [Title] Fixed bug for comparing GBS version --- .../nativeplatform/build/ui/GBSBuildConfigurationTab.java | 2 +- .../src/org/tizen/nativeplatform/gbs/GBSOptionManager.java | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/ui/GBSBuildConfigurationTab.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/ui/GBSBuildConfigurationTab.java index 27afc56..51ff10c 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/ui/GBSBuildConfigurationTab.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/build/ui/GBSBuildConfigurationTab.java @@ -201,7 +201,7 @@ public class GBSBuildConfigurationTab extends AbstractCBuildPropertyTab { 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) { diff --git a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/gbs/GBSOptionManager.java b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/gbs/GBSOptionManager.java index 1fe254b..545c766 100644 --- a/org.tizen.nativeplatform/src/org/tizen/nativeplatform/gbs/GBSOptionManager.java +++ b/org.tizen.nativeplatform/src/org/tizen/nativeplatform/gbs/GBSOptionManager.java @@ -34,7 +34,7 @@ import org.tizen.nativeplatform.util.CommandLauncher; public class GBSOptionManager { private static ArrayList options = new ArrayList(); 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); @@ -67,7 +67,16 @@ public class GBSOptionManager { 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; } -- 2.7.4