Examples of DartSdk


Examples of com.google.dart.engine.sdk.DartSdk

   */
  protected AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
    if (factory == null) {
      return new AnalysisCache(new CachePartition[] {privatePartition});
    }
    DartSdk sdk = factory.getDartSdk();
    if (sdk == null) {
      return new AnalysisCache(new CachePartition[] {privatePartition});
    }
    return new AnalysisCache(new CachePartition[] {
        AnalysisEngine.getInstance().getPartitionManager().forSdk(sdk), privatePartition});
View Full Code Here

Examples of com.google.dart.engine.sdk.DartSdk

  @Override
  protected AnalysisCache createCacheFromSourceFactory(SourceFactory factory) {
    if (factory == null) {
      return super.createCacheFromSourceFactory(factory);
    }
    DartSdk sdk = factory.getDartSdk();
    if (sdk == null) {
      throw new IllegalArgumentException(
          "The source factory for an SDK analysis context must have a DartUriResolver");
    }
    return new AnalysisCache(
View Full Code Here

Examples of com.google.dart.engine.sdk.DartSdk

  private boolean checkForExportInternalLibrary(ExportDirective node, ExportElement exportElement) {
    if (isInSystemLibrary) {
      return false;
    }
    // should be private
    DartSdk sdk = currentLibrary.getContext().getSourceFactory().getDartSdk();
    String uri = exportElement.getUri();
    SdkLibrary sdkLibrary = sdk.getSdkLibrary(uri);
    if (sdkLibrary == null) {
      return false;
    }
    if (!sdkLibrary.isInternal()) {
      return false;
View Full Code Here

Examples of com.google.dart.engine.sdk.DartSdk

  private boolean checkForImportInternalLibrary(ImportDirective node, ImportElement importElement) {
    if (isInSystemLibrary) {
      return false;
    }
    // should be private
    DartSdk sdk = currentLibrary.getContext().getSourceFactory().getDartSdk();
    String uri = importElement.getUri();
    SdkLibrary sdkLibrary = sdk.getSdkLibrary(uri);
    if (sdkLibrary == null) {
      return false;
    }
    if (!sdkLibrary.isInternal()) {
      return false;
View Full Code Here

Examples of com.google.dart.engine.sdk.DartSdk

  @DartBlockBody({"throw new AnalysisException(\"Could not resolve dart:core\");"})
  public static void missingCoreLibrary(AnalysisContext analysisContext, Source coreLibrarySource)
      throws AnalysisException {
    InstrumentationBuilder instrumentation = Instrumentation.builder("ErrorNoCoreLibrary");
    try {
      DartSdk sdk = analysisContext.getSourceFactory().getDartSdk();
      if (sdk == null) {
        instrumentation.data("sdkPath", "--null--");
      } else if (sdk instanceof DirectoryBasedDartSdk) {
        File directory = ((DirectoryBasedDartSdk) sdk).getDirectory();
        if (directory == null) {
View Full Code Here

Examples of com.jetbrains.lang.dart.sdk.DartSdk

    }
  }

  @Nullable
  public static String getStandardLibraryNameByRelativePath(final @NotNull Project project, final @NotNull String relativePath) {
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    final List<String> libNames = sdk == null ? null : getLibraryNameToRelativePathMap(project, sdk).getKeysByValue(relativePath);
    return libNames == null || libNames.isEmpty() ? null : libNames.get(0);
  }
View Full Code Here

Examples of com.jetbrains.lang.dart.sdk.DartSdk

    return libNames == null || libNames.isEmpty() ? null : libNames.get(0);
  }

  @Nullable
  public static VirtualFile getStandardLibraryFromSdk(final @NotNull Project project, final @NotNull String libraryName) {
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    final String relativeLibPath = sdk == null ? null : getLibraryNameToRelativePathMap(project, sdk).get(libraryName);
    return relativeLibPath == null ? null : LocalFileSystem.getInstance().findFileByPath(sdk.getHomePath() + "/lib/" + relativeLibPath);
  }
View Full Code Here

Examples of com.jetbrains.lang.dart.sdk.DartSdk

    final String relativeLibPath = sdk == null ? null : getLibraryNameToRelativePathMap(project, sdk).get(libraryName);
    return relativeLibPath == null ? null : LocalFileSystem.getInstance().findFileByPath(sdk.getHomePath() + "/lib/" + relativeLibPath);
  }

  public static Collection<String> getAllStandardLibrariesFromSdk(final @NotNull Project project) {
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    return sdk == null ? Collections.<String>emptyList() : getLibraryNameToRelativePathMap(project, sdk).keySet();
  }
View Full Code Here

Examples of com.jetbrains.lang.dart.sdk.DartSdk

    return dartFile;
  }

  public void check(final @NotNull Project project) throws RuntimeConfigurationError {
    // check sdk
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    if (sdk == null) {
      throw new RuntimeConfigurationError(DartBundle.message("dart.sdk.is.not.configured"), new Runnable() {
        public void run() {
          ShowSettingsUtilImpl.showSettingsDialog(project, DartConfigurable.DART_SETTINGS_PAGE_ID, "");
        }
View Full Code Here

Examples of com.jetbrains.lang.dart.sdk.DartSdk

    ProcessTerminatedListener.attach(processHandler, getEnvironment().getProject());
    return processHandler;
  }

  private GeneralCommandLine createCommandLine(final @Nullable String overriddenMainFilePath) throws ExecutionException {
    final DartSdk sdk = DartSdk.getGlobalDartSdk();
    if (sdk == null) {
      throw new ExecutionException(DartBundle.message("dart.sdk.is.not.configured"));
    }

    final String dartExePath = DartSdkUtil.getDartExePath(sdk);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.