use of org.jetbrains.kotlin.resolve.TargetPlatform in project kotlin by JetBrains.
the class ProjectStructureUtil method getCachedPlatformForModule.
@NotNull
static /* package */
TargetPlatform getCachedPlatformForModule(@NotNull final Module module) {
CachedValue<TargetPlatform> result = module.getUserData(PLATFORM_FOR_MODULE);
if (result == null) {
result = CachedValuesManager.getManager(module.getProject()).createCachedValue(new CachedValueProvider<TargetPlatform>() {
@Override
public Result<TargetPlatform> compute() {
TargetPlatform configuredInFacet = getPlatformConfiguredInFacet(module);
TargetPlatform platform = configuredInFacet != null ? configuredInFacet : hasJsStandardLibraryInDependencies(module) ? JsPlatform.INSTANCE : JvmPlatform.INSTANCE;
return Result.create(platform, ProjectRootModificationTracker.getInstance(module.getProject()));
}
}, false);
module.putUserData(PLATFORM_FOR_MODULE, result);
}
return result.getValue();
}
Aggregations