private boolean filterByARCH(String arch) { return !arch.equals(Platform.getOSArch()); }
public String getDisplayArch() { if (fArch == null || fArch.trim().length() == 0) return Platform.getOSArch(); return fArch.trim(); }
/** * Returns the target system architecture as specified on the <b>Environment</b> * tab of the <b>Plug-in Development > Target Platform</b> preference page. * * @return the target system architecture */ public static String getOSArch() { return getProperty(ICoreConstants.ARCH, Platform.getOSArch()); }
private static synchronized File getAdbExecutable() throws IOException { if (adbExecutable == null) { String platform = Platform.getOS() + "_" + Platform.getOSArch(); String platformDir = "/resources/adb/" + platform + "/"; File adbDir = new File(new File( new File(new File(System.getProperty("user.home")), ".sdbg"), "adb"), platform); String adbExecutableName = "adb" + (DartCore.isWindows() ? ".exe" : ""); if (platform.equals("win32_x86") || platform.equals("win32_x86_64")) { copy(platformDir + adbExecutableName, adbDir); copy(platformDir + "AdbWinApi.dll", adbDir); copy(platformDir + "AdbWinUsbApi.dll", adbDir); } else if (platform.equals("macosx_x86_64") || platform.equals("linux_x86") || platform.equals("linux_x86_64")) { copy(platformDir + adbExecutableName, adbDir); new ProcessRunner(new ProcessBuilder( "chmod", "+x", new File(adbDir, adbExecutableName).getAbsolutePath())).runSync(null); } else { throw new IOException("Unsupported platform: " + platform); } adbExecutable = new File(adbDir, adbExecutableName); } return adbExecutable; }
/** * Generates the environment properties string for this target definition's p2 profile. * * @return environment properties */ private String generateEnvironmentProperties(ITargetDefinition target) { // TODO: are there constants for these keys? StringBuffer env = new StringBuffer(); String ws = target.getWS(); if (ws == null) { ws = Platform.getWS(); } env.append("osgi.ws="); //$NON-NLS-1$ env.append(ws); env.append(","); //$NON-NLS-1$ String os = target.getOS(); if (os == null) { os = Platform.getOS(); } env.append("osgi.os="); //$NON-NLS-1$ env.append(os); env.append(","); //$NON-NLS-1$ String arch = target.getArch(); if (arch == null) { arch = Platform.getOSArch(); } env.append("osgi.arch="); //$NON-NLS-1$ env.append(arch); return env.toString(); }
@Override public String resolveValue(IDynamicVariable variable, String argument) throws CoreException { if ("ARCH".equals(argument)) { //$NON-NLS-1$ return Platform.getOSArch(); } else if ("ECLIPSE_HOME".equals(argument)) { //$NON-NLS-1$ URL installURL = Platform.getInstallLocation().getURL(); IPath ppath = new Path(installURL.getFile()).removeTrailingSeparator(); return getCorrectPath(ppath.toOSString()); } else if ("NL".equals(argument)) { //$NON-NLS-1$ return Platform.getNL(); } else if ("OS".equals(argument)) { //$NON-NLS-1$ return Platform.getOS(); } else if ("WS".equals(argument)) { //$NON-NLS-1$ return Platform.getWS(); } return null; }
private ConfigurationDescriptor getConfigdataFromProductFile(File installFolder) { Object[] productFileInfo = loadEclipseProductFile(installFolder); //Contrarily to the runtime, when the .eclipseproduct can't be found, we don't fallback to org.eclipse.platform. if (productFileInfo.length == 0) return null; return new ConfigurationDescriptor((String) productFileInfo[0], (Identifier) productFileInfo[1], getInstallDirHash(installFolder), Platform.getOS() + '_' + Platform.getWS() + '_' + Platform.getOSArch(), null); }
/** * Returns the target system architecture as specified on the <b>Environment</b> * tab of the <b>Plug-in Development > Target Platform</b> preference page. * * @return the target system architecture */ public static String getOSArch() { try { ITargetDefinition target = TargetPlatformService.getDefault().getWorkspaceTargetDefinition(); String result = target.getArch(); if (result != null) { return result; } } catch (CoreException e) { PDECore.log(e); } return Platform.getOSArch(); }
if (isMatch(definition.getArch(), plugin.getArch(), Platform.getOSArch()) && isMatch(definition.getNL(), plugin.getNL(), Platform.getNL()) && isMatch(definition.getOS(), plugin.getOS(), Platform.getOS()) && isMatch(definition.getWS(), plugin.getWS(), Platform.getWS())) { matchInfos.add(new NameVersionDescriptor(plugin.getId(), plugin.getVersion()));
if (osArch == null) osArch = Platform.getOSArch(); if (osArch.length() == 0) return null;
props.put("osgi.os", definition.getOS() != null ? definition.getOS() : Platform.getOS()); //$NON-NLS-1$ props.put("osgi.ws", definition.getWS() != null ? definition.getWS() : Platform.getWS()); //$NON-NLS-1$ props.put("osgi.arch", definition.getArch() != null ? definition.getArch() : Platform.getOSArch()); //$NON-NLS-1$ props.put("osgi.nl", definition.getNL() != null ? definition.getNL() : Platform.getNL()); //$NON-NLS-1$ props.put(IProfile.PROP_INSTALL_FEATURES, Boolean.TRUE.toString());
if (hasCategory(featureRefs[i], category)) { if (matches(featureRefs[i].getOS(), Platform.getOS()) && matches(featureRefs[i].getOSArch(), Platform.getOSArch()) && matches(featureRefs[i].getWS(), Platform.getWS())) { IFeature feature2 = featureRefs[i].getFeature(ProgressUtil.getSubMonitorFor(monitor, 5));
public void initializeDefaultPreferences() { Preferences preferences = PDECore.getDefault().getPluginPreferences(); preferences.setDefault( ICoreConstants.TARGET_MODE, ICoreConstants.VALUE_USE_THIS); preferences.setDefault( ICoreConstants.CHECKED_PLUGINS, ICoreConstants.VALUE_SAVED_ALL); if (preferences.getString(ICoreConstants.TARGET_MODE).equals(ICoreConstants.VALUE_USE_THIS)) preferences.setValue( ICoreConstants.PLATFORM_PATH, TargetPlatform.getDefaultLocation()); else preferences.setDefault( ICoreConstants.PLATFORM_PATH, TargetPlatform.getDefaultLocation()); // set defaults for the target environment variables. preferences.setDefault(ICoreConstants.OS, Platform.getOS()); preferences.setDefault(ICoreConstants.WS, Platform.getWS()); preferences.setDefault(ICoreConstants.NL, Locale.getDefault().toString()); preferences.setDefault(ICoreConstants.ARCH, Platform.getOSArch()); }
private ILaunchConfiguration refreshConfiguration(ILaunchConfigurationWorkingCopy wc) throws CoreException { wc.setAttribute(IPDELauncherConstants.PRODUCT, fProduct.getProductId()); wc.setAttribute(IPDELauncherConstants.APPLICATION, fProduct.getApplication()); String os = Platform.getOS(); String arch = Platform.getOSArch(); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS, getVMArguments(os, arch)); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, getProgramArguments(os, arch)); wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, getJREContainer(os)); StringBuilder wsplugins = new StringBuilder(); StringBuilder explugins = new StringBuilder(); IPluginModelBase[] models = getModels(); for (IPluginModelBase model : models) { if (model.getUnderlyingResource() == null) { appendBundle(explugins, model); } else { appendBundle(wsplugins, model); } } wc.setAttribute(IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS, wsplugins.toString()); wc.setAttribute(IPDELauncherConstants.SELECTED_TARGET_PLUGINS, explugins.toString()); String configIni = getTemplateConfigIni(os); wc.setAttribute(IPDELauncherConstants.CONFIG_GENERATE_DEFAULT, configIni == null); if (configIni != null) wc.setAttribute(IPDELauncherConstants.CONFIG_TEMPLATE_LOCATION, configIni); return wc.doSave(); }
String arch = (fEnvInfo != null) ? fEnvInfo.getArch() : null; if (arch == null || arch.length() == 0) arch = Platform.getOSArch(); result = containsProperty(arch, value);
target.setArch(Platform.getOSArch()); target.setOS(Platform.getOS()); target.setWS(Platform.getWS());