当前位置: 首页>>代码示例>>Java>>正文


Java PathEnvironmentVariableUtil类代码示例

本文整理汇总了Java中com.intellij.execution.configurations.PathEnvironmentVariableUtil的典型用法代码示例。如果您正苦于以下问题:Java PathEnvironmentVariableUtil类的具体用法?Java PathEnvironmentVariableUtil怎么用?Java PathEnvironmentVariableUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PathEnvironmentVariableUtil类属于com.intellij.execution.configurations包,在下文中一共展示了PathEnvironmentVariableUtil类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findExecutable

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@NotNull
protected static String findExecutable(@NotNull String programName,
                                       @NotNull String unixExec,
                                       @NotNull String winExec,
                                       @NotNull Collection<String> envs) {
  String exec = findEnvValue(programName, envs);
  if (exec != null) {
    return exec;
  }
  File fileExec = PathEnvironmentVariableUtil.findInPath(SystemInfo.isWindows ? winExec : unixExec);
  if (fileExec != null) {
    return fileExec.getAbsolutePath();
  }
  throw new IllegalStateException(programName + " executable not found. " + (envs.size() > 0 ?
                                                                             "Please define a valid environment variable " +
                                                                             envs.iterator().next() +
                                                                             " pointing to the " +
                                                                             programName +
                                                                             " executable." : ""));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:Executor.java

示例2: suggestSdkDirectoryPathFromEnv

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@Nullable
private static String suggestSdkDirectoryPathFromEnv() {
    File fileFromPath = PathEnvironmentVariableUtil.findInPath(SquirrelConstants.SQUIRREL_COMPILER_NAME);
    if (fileFromPath != null) {
        File canonicalFile;
        try {
            canonicalFile = fileFromPath.getCanonicalFile();
            String path = canonicalFile.getPath();
            if (path.endsWith("bin/" + SquirrelConstants.SQUIRREL_COMPILER_NAME)) {
                return StringUtil.trimEnd(path, "bin/" + SquirrelConstants.SQUIRREL_COMPILER_NAME);
            }
        } catch (IOException ignore) {
        }
    }
    return null;
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:17,代码来源:SquirrelSdkUtil.java

示例3: getExecuteFullPathSingle

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
public static String getExecuteFullPathSingle(String exeName) {
    List<File> fromPath = PathEnvironmentVariableUtil.findAllExeFilesInPath(exeName);
    if (fromPath != null && fromPath.size() > 0) {
        return fromPath.get(0).toString();
    }
    return null;
}
 
开发者ID:beansoftapp,项目名称:react-native-console,代码行数:8,代码来源:RNPathUtil.java

示例4: findAllStylintExe

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@NotNull
public static List<File> findAllStylintExe() {
    Set<File> exes = ContainerUtil.newLinkedHashSet();
    // TODO looks like on windows it only searches system path and not user's
    List<File> fromPath = PathEnvironmentVariableUtil.findAllExeFilesInPath(NodeFinder.getBinName("stylint"));
    exes.addAll(fromPath);
    return ContainerUtil.newArrayList(exes);
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:9,代码来源:StylintFinder.java

示例5: searchNodeModulesBin

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@NotNull
public static List<File> searchNodeModulesBin(String exeFileName) {
    Set<File> interpreters = ContainerUtil.newLinkedHashSet();
    List<File> fromPath = PathEnvironmentVariableUtil.findAllExeFilesInPath(exeFileName);
    List<File> nvmInterpreters = listNodeInterpretersFromNvm(exeFileName);
    List<File> brewInterpreters = listNodeInterpretersFromHomeBrew(exeFileName);
    interpreters.addAll(fromPath);
    interpreters.removeAll(nvmInterpreters);
    interpreters.removeAll(brewInterpreters);
    interpreters.addAll(nvmInterpreters);
    interpreters.addAll(brewInterpreters);
    return ContainerUtil.newArrayList(interpreters);
}
 
开发者ID:sertae,项目名称:stylint-plugin,代码行数:14,代码来源:NodeFinder.java

示例6: execute

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@NotNull
public static OSProcessHandler execute(@NotNull String exePath,
                                       @Nullable String workingDirectory,
                                       @Nullable VirtualFile scriptFile,
                                       String[] parameters,
                                       @Nullable Charset charset) throws ExecutionException {
  exePath = PathEnvironmentVariableUtil.findAbsolutePathOnMac(exePath);
  return doExecute(exePath, workingDirectory, scriptFile, parameters, charset);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ScriptRunnerUtil.java

示例7: createCommandLine

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@Nullable
public GeneralCommandLine createCommandLine(DataContext dataContext) {
  if (StringUtil.isEmpty(getWorkingDirectory())) {
    setWorkingDirectory("$ProjectFileDir$");
  }

  GeneralCommandLine commandLine = new GeneralCommandLine();
  try {
    String paramString = MacroManager.getInstance().expandMacrosInString(getParameters(), true, dataContext);
    String workingDir = MacroManager.getInstance().expandMacrosInString(getWorkingDirectory(), true, dataContext);
    String exePath = MacroManager.getInstance().expandMacrosInString(getProgram(), true, dataContext);

    commandLine.getParametersList().addParametersString(
      MacroManager.getInstance().expandMacrosInString(paramString, false, dataContext));
    final String workDirExpanded = MacroManager.getInstance().expandMacrosInString(workingDir, false, dataContext);
    if (!StringUtil.isEmpty(workDirExpanded)) {
      commandLine.setWorkDirectory(workDirExpanded);
    }
    exePath = MacroManager.getInstance().expandMacrosInString(exePath, false, dataContext);
    if (exePath == null) return null;

    File exeFile = new File(exePath);
    if (exeFile.isDirectory() && exeFile.getName().endsWith(".app")) {
      commandLine.setExePath("open");
      commandLine.getParametersList().prependAll("-a", exePath);
    }
    else {
      exePath = PathEnvironmentVariableUtil.toLocatableExePath(exePath);
      commandLine.setExePath(exePath);
    }
  }
  catch (Macro.ExecutionCancelledException ignored) {
    return null;
  }
  return commandLine;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:Tool.java

示例8: getCondaExecutable

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@Nullable
public static String getCondaExecutable() {
  final String condaName = SystemInfo.isWindows ? "conda.exe" : "conda";
  final File condaInPath = PathEnvironmentVariableUtil.findInPath(condaName);
  if (condaInPath != null) return condaInPath.getPath();
  return getCondaExecutable(condaName);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:PyCondaPackageService.java

示例9: findExecutable

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@Nonnull
public static String findExecutable(@Nonnull String programName, @Nonnull String unixExec, @Nonnull String winExec, @Nonnull Collection<String> envs) {
  String exec = findEnvValue(programName, envs);
  if (exec != null) {
    return exec;
  }
  File fileExec = PathEnvironmentVariableUtil.findInPath(SystemInfo.isWindows ? winExec : unixExec);
  if (fileExec != null) {
    return fileExec.getAbsolutePath();
  }
  throw new IllegalStateException(programName +
                                  " executable not found. " +
                                  (envs.size() > 0 ? "Please define a valid environment variable " + envs.iterator().next() + " pointing to the " + programName + " executable." : ""));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:ExecutableHelper.java

示例10: get

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@NotNull
public static SceneBuilderInfo get(Project project, boolean choosePathIfEmpty) {
  JavaFxSettings settings = JavaFxSettings.getInstance();
  String pathToSceneBuilder = settings.getPathToSceneBuilder();

  if (StringUtil.isEmptyOrSpaces(pathToSceneBuilder) || !new File(pathToSceneBuilder).exists()) {
    VirtualFile sceneBuilderFile = null;
    if (choosePathIfEmpty) {
      sceneBuilderFile = FileChooser.chooseFile(JavaFxSettingsConfigurable.createSceneBuilderDescriptor(), project, getPredefinedPath());
    }
    if (sceneBuilderFile == null) {
      return EMPTY;
    }

    pathToSceneBuilder = FileUtil.toSystemIndependentName(sceneBuilderFile.getPath());
    settings.setPathToSceneBuilder(pathToSceneBuilder);
  }

  File sceneBuilderLibsFile;

  if (SystemInfo.isMac) {
    sceneBuilderLibsFile = new File(new File(pathToSceneBuilder, "Contents"), "Java");
  }
  else if (SystemInfo.isWindows) {
    File sceneBuilderRoot = new File(pathToSceneBuilder);
    File sceneBuilderRootDir = sceneBuilderRoot.getParentFile();
    if (sceneBuilderRootDir == null) {
      final File foundInPath = PathEnvironmentVariableUtil.findInPath(pathToSceneBuilder);
      if (foundInPath != null) {
        sceneBuilderRootDir = foundInPath.getParentFile();
      }
    }
    sceneBuilderRoot = sceneBuilderRootDir != null ? sceneBuilderRootDir.getParentFile() : null;
    if (sceneBuilderRoot != null) {
      final File appFile = new File(sceneBuilderRootDir, "app");
      if (appFile.isDirectory()) {
        sceneBuilderLibsFile = appFile;
      }
      else {
        final File libFile = new File(sceneBuilderRoot, "lib");
        sceneBuilderLibsFile = libFile.isDirectory() ? libFile : null;
      }
    }
    else {
      sceneBuilderLibsFile = null;
    }
  }
  else {
    sceneBuilderLibsFile = new File(new File(pathToSceneBuilder).getParent(), "app");
  }

  if (sceneBuilderLibsFile != null && (!sceneBuilderLibsFile.exists() || !sceneBuilderLibsFile.isDirectory())) {
    sceneBuilderLibsFile = null;
  }

  return new SceneBuilderInfo(pathToSceneBuilder, sceneBuilderLibsFile == null ? null : sceneBuilderLibsFile.getAbsolutePath());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:58,代码来源:SceneBuilderInfo.java

示例11: getMakeExecutable

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
@Nullable
public static String getMakeExecutable() {
    File make = PathEnvironmentVariableUtil.findInPath("make");
    if (make == null) return null;
    return make.getAbsolutePath();
}
 
开发者ID:shvetsgroup,项目名称:squirrel-lang-idea-plugin,代码行数:7,代码来源:SquirrelSdkUtil.java

示例12: findInPath

import com.intellij.execution.configurations.PathEnvironmentVariableUtil; //导入依赖的package包/类
public File findInPath(String fileName) {
  return PathEnvironmentVariableUtil.findInPath(fileName);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:4,代码来源:SystemEnvironmentProvider.java


注:本文中的com.intellij.execution.configurations.PathEnvironmentVariableUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。