if (debug) { if (installedVersion != null) { if (installedVersion.isAboveOrEqual(VERSION_WITH_DEFAULT_SOURCEMAP)) { } else if (installedVersion.isAboveOrEqual(MINIMAL_VERSION_WITH_SOURCEMAP)) { params.add(SOURCEMAP_PARAM); } else { && installedVersion.isAboveOrEqual(VERSION_WITH_DEFAULT_SOURCEMAP)) { params.add(String.format(SOURCEMAP_WITH_VALUE_PARAM, "none")); // NOI18N
@CheckForNull private static Version getVersion() { assert !EventQueue.isDispatchThread(); if (version != null) { return version; } VersionOutputProcessorFactory versionOutputProcessorFactory = new VersionOutputProcessorFactory(VERSION_PATTERN); try { SassExecutable sassExecutable = getDefault(); sassExecutable.getExecutable("Sass version", TMP_DIR) // NOI18N .additionalParameters(Collections.singletonList(VERSION_PARAM)) .runAndWait(getSilentDescriptor(), versionOutputProcessorFactory, "Detecting Sass version..."); // NOI18N String detectedVersion = versionOutputProcessorFactory.getVersion(); if (detectedVersion != null) { version = Version.fromDottedNotationWithFallback(detectedVersion); return version; } } catch (CancellationException ex) { // cancelled, cannot happen assert false; } catch (ExecutionException ex) { LOGGER.log(Level.INFO, null, ex); } catch (InvalidExternalExecutableException ex) { // cannot happen LOGGER.log(Level.WARNING, null, ex); assert false; } return null; }
private NodeJsDataProvider(Project project) { this.loadingStarted = false; this.isSupportEnabled = project == null; this.docFolder = null; if (project != null) { NodeJsSupport support = null; support = project.getLookup().lookup(NodeJsSupport.class); if (support != null) { listener = new ProjectSupportChangeListener(project); support.addChangeListener(WeakListeners.change(listener, support)); this.isSupportEnabled = support.isSupportEnabled(); this.docFolder = support.getDocumentationFolder(); if (support.getDocumentationUrl() != null) { this.docUrl = support.getDocumentationUrl(); } if (support.getVersion() != null) { docApiFilePath = new StringBuilder().append(CACHE_FOLDER_NAME).append(File.separator) .append(support.getVersion().toString()).append(File.separator).append(API_ALL_JSON_FILE).toString(); } } } }
@CheckForNull private static Version getVersion() { assert !EventQueue.isDispatchThread(); if (version != null) { return version; } VersionOutputProcessorFactory versionOutputProcessorFactory = new VersionOutputProcessorFactory(VERSION_PATTERN); try { LessExecutable lessExecutable = getDefault(); lessExecutable.getExecutable("Less version", TMP_DIR) // NOI18N .additionalParameters(lessExecutable.getVersionParameters()) .runAndWait(getSilentDescriptor(), versionOutputProcessorFactory, "Detecting Less version..."); // NOI18N String detectedVersion = versionOutputProcessorFactory.getVersion(); if (detectedVersion != null) { version = Version.fromDottedNotationWithFallback(detectedVersion); return version; } } catch (CancellationException ex) { // cancelled, cannot happen assert false; } catch (ExecutionException ex) { LOGGER.log(Level.INFO, null, ex); } catch (InvalidExternalExecutableException ex) { // cannot happen LOGGER.log(Level.WARNING, null, ex); assert false; } return null; }
List<String> getCompileParameters(File inputFile, File outputFile, List<String> compilerOptions) { List<String> params = new ArrayList<>(); // debug boolean debug = CssPrepOptions.getInstance().getLessDebug(); if (debug) { // #241628 Version installedVersion = getVersion(); if (installedVersion != null && installedVersion.isAboveOrEqual(MINIMAL_VERSION_WITH_SOURCEMAP)) { params.add(SOURCE_MAP_PARAM); params.add(String.format(SOURCE_MAP_ROOTPATH_PARAM, getRelativeRootPath(inputFile, outputFile))); params.add(String.format(SOURCE_MAP_URL_PARAM, outputFile.getName() + ".map")); // NOI18N } else { // older versions params.add(DEBUG_PARAM); } } // compiler options params.addAll(compilerOptions); // input params.add(inputFile.getAbsolutePath()); // output params.add(outputFile.getAbsolutePath()); return params; }