private static void fillSdks(List<GlobalLibrary> globals) { for (Sdk sdk : ProjectJdkTable.getInstance().getAllJdks()) { final String name = sdk.getName(); final String homePath = sdk.getHomePath(); if (homePath == null) { continue; } final SdkAdditionalData data = sdk.getSdkAdditionalData(); final String additionalDataXml; final SdkType sdkType = (SdkType) sdk.getSdkType(); if (data == null) { additionalDataXml = null; } else { final Element element = new Element("additional"); sdkType.saveAdditionalData(data, element); additionalDataXml = JDOMUtil.writeElement(element, "\n"); } final List<String> paths = convertToLocalPaths(sdk.getRootProvider().getFiles(OrderRootType.CLASSES)); String versionString = sdk.getVersionString(); if (versionString != null && sdkType instanceof JavaSdk) { final JavaSdkVersion version = ((JavaSdk) sdkType).getVersion(versionString); if (version != null) { versionString = version.getDescription(); } } globals.add( new SdkLibrary( name, sdkType.getName(), versionString, homePath, paths, additionalDataXml)); } }
public static <T extends SdkType> T findInstance(final Class<T> sdkTypeClass) { for (SdkType sdkType : Extensions.getExtensions(EP_NAME)) { if (sdkTypeClass.equals(sdkType.getClass())) { //noinspection unchecked return (T) sdkType; } } assert false; return null; }
@Override public void setupSdkPaths(Sdk sdk) { final SdkModificator modificator = sdk.getSdkModificator(); SdkAdditionalData data = sdk.getSdkAdditionalData(); if (data == null) { data = DartSdkUtil.testDartSdk(sdk.getHomePath()); modificator.setSdkAdditionalData(data); } DartSdkUtil.setupSdkPaths(sdk.getHomeDirectory(), modificator); modificator.commitChanges(); super.setupSdkPaths(sdk); }
public static GoSdkType getInstance() { return SdkType.findInstance(GoSdkType.class); }
public static DartSdkType getInstance() { return SdkType.findInstance(DartSdkType.class); }
public static AndroidSdkType getInstance() { return SdkType.findInstance(AndroidSdkType.class); }