Search in sources :

Example 1 with ApplePlatform

use of com.jetbrains.cidr.xcode.frameworks.ApplePlatform in project intellij-plugins by JetBrains.

the class Reveal method getRevealLib.

@Contract("_, null -> null")
public static File getRevealLib(@NotNull File bundle, @Nullable AppleSdk sdk) {
    if (sdk == null)
        return null;
    ApplePlatform platform = sdk.getPlatform();
    String libraryPath = "/Contents/SharedSupport/";
    if (platform.isIOS()) {
        libraryPath += "iOS-Libraries/";
    } else if (platform.isTv()) {
        libraryPath += "tvOS-Libraries/";
    }
    if (isCompatibleWithRevealTwoOrHigher(bundle)) {
        libraryPath += "RevealServer.framework/RevealServer";
    } else if (platform.isTv()) {
        libraryPath += "libReveal-tvOS.dylib";
    } else {
        libraryPath += "libReveal.dylib";
    }
    File result = new File(bundle, libraryPath);
    return result.exists() ? result : null;
}
Also used : ApplePlatform(com.jetbrains.cidr.xcode.frameworks.ApplePlatform) File(java.io.File) Contract(org.jetbrains.annotations.Contract)

Aggregations

ApplePlatform (com.jetbrains.cidr.xcode.frameworks.ApplePlatform)1 File (java.io.File)1 Contract (org.jetbrains.annotations.Contract)1