use of com.jetbrains.cidr.xcode.plist.Plist in project intellij-plugins by JetBrains.
the class Reveal method getRevealVersion.
@Nullable
public static Version getRevealVersion(@NotNull File bundle) {
Plist plist = PlistDriver.readAnyFormatSafe(new File(bundle, "Contents/Info.plist"));
if (plist == null)
return null;
String version = plist.getString("CFBundleVersion");
if (version == null)
return null;
List<String> parts = StringUtil.split(version, ".");
if (parts.isEmpty())
return null;
return new Version(StringUtil.parseInt(parts.get(0), 0), parts.size() > 1 ? StringUtil.parseInt(parts.get(1), 0) : 0, parts.size() > 2 ? StringUtil.parseInt(parts.get(2), 0) : 0);
}
use of com.jetbrains.cidr.xcode.plist.Plist in project intellij-plugins by JetBrains.
the class RevealRunConfigurationExtension method getBundleID.
@NotNull
private static String getBundleID(@NotNull ExecutionEnvironment environment, @NotNull File product) throws ExecutionException {
String result = environment.getUserData(BUNDLE_ID_KEY);
if (result != null)
return result;
File plistFile = new File(product, "Info.plist");
Plist plist = PlistDriver.readAnyFormatSafe(plistFile);
if (plist == null)
throw new ExecutionException("Info.plist not found at " + plistFile);
result = plist.getString("CFBundleIdentifier");
if (result == null)
throw new ExecutionException("CFBundleIdentifier not found in " + plistFile);
environment.putUserData(BUNDLE_ID_KEY, result);
return result;
}