Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Merks2016-01-06 06:18:17 +0000
committerEd Merks2016-01-06 06:18:17 +0000
commit9d9093b77ab3dcb1f772d634f222b7d557316e57 (patch)
treef4ccc3a3997e47c6fa91f02a2b0c90e19a8e2298 /plugins/org.eclipse.oomph.util/src/org
parent6ef905e51925759ce81ad168d03c500038281ca0 (diff)
downloadorg.eclipse.oomph-9d9093b77ab3dcb1f772d634f222b7d557316e57.tar.gz
org.eclipse.oomph-9d9093b77ab3dcb1f772d634f222b7d557316e57.tar.xz
org.eclipse.oomph-9d9093b77ab3dcb1f772d634f222b7d557316e57.zip
[429245] Support for conditional task execution
https://bugs.eclipse.org/bugs/show_bug.cgi?id=429245
Diffstat (limited to 'plugins/org.eclipse.oomph.util/src/org')
-rw-r--r--plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java33
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java
index 1e56cd7dd..b3fb6e2b2 100644
--- a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java
+++ b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/OS.java
@@ -23,6 +23,7 @@ import java.io.IOException;
import java.lang.reflect.Method;
import java.net.URI;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
/**
@@ -32,6 +33,8 @@ public abstract class OS
{
public static final OS INSTANCE = create();
+ public static final List<OS> INSTANCES = createAll();
+
private final String osgiOS;
private final String osgiWS;
@@ -90,6 +93,17 @@ public abstract class OS
return true;
}
+ public int getBitness()
+ {
+ String osgiArch = getOsgiArch();
+ if (Platform.ARCH_IA64_32.equals(osgiArch) || Platform.ARCH_X86.equals(osgiArch))
+ {
+ return 32;
+ }
+
+ return 64;
+ }
+
public boolean isLineEndingConversionNeeded()
{
return false;
@@ -257,6 +271,25 @@ public abstract class OS
throw new IllegalStateException("Operating system not supported: " + os);
}
+ private static List<OS> createAll()
+ {
+ List<OS> result = new ArrayList<OS>();
+
+ result.add(Win64.INSTANCE);
+ result.add(Win32.INSTANCE);
+ result.add(new Mac(Platform.WS_COCOA, Platform.ARCH_X86_64));
+ result.add(new Linux(Platform.WS_GTK, Platform.ARCH_X86_64));
+ result.add(new Linux(Platform.WS_GTK, Platform.ARCH_X86));
+
+ return Collections.unmodifiableList(result);
+ }
+
+ @Override
+ public String toString()
+ {
+ return getOsgiOS() + " " + getOsgiWS() + " " + getOsgiArch();
+ }
+
/**
* @author Eike Stepper
*/

Back to the top