Java 类org.gradle.api.internal.file.IdentityFileResolver 实例源码

项目:Reer    文件:VmstatAvailableMemory.java   
private List<String> getVmstatOutput() {
    try {
        StreamByteBuffer buffer = new StreamByteBuffer();
        ExecHandleBuilder builder = new DefaultExecActionFactory(new IdentityFileResolver()).newExec();
        builder.setWorkingDir(new File(".").getAbsolutePath());
        builder.setCommandLine(VMSTAT_EXECUTABLE_PATH);
        builder.setStandardOutput(buffer.getOutputStream());
        builder.build().start().waitForFinish().assertNormalExitValue();

        BufferedReader reader = new BufferedReader(new InputStreamReader(buffer.getInputStream()));
        List<String> lines = Lists.newArrayList();
        String line;
        while ((line = reader.readLine()) != null) {
            lines.add(line);
        }
        return lines;
    } catch (Exception e) {
        throw new UnsupportedOperationException("Unable to read memory info from " + VMSTAT_EXECUTABLE_PATH, e);
    }
}
项目:Reer    文件:BuildProcess.java   
/**
 * Attempts to configure the current process to run with the required build parameters.
 * @return True if the current process could be configured, false otherwise.
 */
public boolean configureForBuild(DaemonParameters requiredBuildParameters) {
    boolean javaHomeMatch = getJvm().equals(requiredBuildParameters.getEffectiveJvm());

    final JvmOptions jvmOptions = new JvmOptions(new IdentityFileResolver());
    jvmOptions.systemProperties(getJvmOptions().getImmutableSystemProperties());
    List<String> currentImmutables = jvmOptions.getAllImmutableJvmArgs();
    List<String> requiredImmutables = requiredBuildParameters.getEffectiveSingleUseJvmArgs();
    requiredImmutables.removeAll(DaemonParameters.DEFAULT_JVM_ARGS);

    boolean noImmutableJvmArgsRequired = requiredImmutables.equals(currentImmutables);
    if (javaHomeMatch && noImmutableJvmArgsRequired) {
        // Set the system properties and use this process
        Properties properties = new Properties();
        properties.putAll(requiredBuildParameters.getEffectiveSystemProperties());
        System.setProperties(properties);
        return true;
    }
    return false;
}
项目:Pushjet-Android    文件:CurrentProcess.java   
/**
 * Attempts to configure the current process to run with the required build parameters.
 * @return True if the current process could be configured, false otherwise.
 */
public boolean configureForBuild(DaemonParameters requiredBuildParameters) {
    boolean javaHomeMatch = getJavaHome().equals(requiredBuildParameters.getEffectiveJavaHome());

    List<String> currentImmutable = new JvmOptions(new IdentityFileResolver()).getAllImmutableJvmArgs();
    List<String> requiredImmutable = requiredBuildParameters.getEffectiveJvmArgs();
    List<String> requiredImmutableMinusDefaults = removeDefaults(requiredImmutable);
    boolean noImmutableJvmArgsRequired = requiredImmutableMinusDefaults.equals(currentImmutable);

    if (javaHomeMatch && noImmutableJvmArgsRequired) {
        // Set the system properties and use this process
        Properties properties = new Properties();
        properties.putAll(requiredBuildParameters.getEffectiveSystemProperties());
        System.setProperties(properties);
        return true;
    }
    return false;
}
项目:Pushjet-Android    文件:CurrentProcess.java   
/**
 * Attempts to configure the current process to run with the required build parameters.
 * @return True if the current process could be configured, false otherwise.
 */
public boolean configureForBuild(DaemonParameters requiredBuildParameters) {
    boolean javaHomeMatch = getJavaHome().equals(requiredBuildParameters.getEffectiveJavaHome());

    JvmOptions optionsWithNoArgsSet = new JvmOptions(new IdentityFileResolver());
    boolean noImmutableJvmArgsRequired = requiredBuildParameters.isUsingDefaultJvmArgs()
            || requiredBuildParameters.getEffectiveJvmArgs().equals(optionsWithNoArgsSet.getAllImmutableJvmArgs());

    if (javaHomeMatch && noImmutableJvmArgsRequired) {
        // Set the system properties and use this process
        Properties properties = new Properties();
        properties.putAll(requiredBuildParameters.getEffectiveSystemProperties());
        System.setProperties(properties);
        return true;
    }
    return false;
}
项目:Reer    文件:CurrentProcess.java   
private static JvmOptions inferJvmOptions() {
    // Try to infer the effective jvm options for the currently running process.
    // We only care about 'managed' jvm args, anything else is unimportant to the running build
    JvmOptions jvmOptions = new JvmOptions(new IdentityFileResolver());
    jvmOptions.setAllJvmArgs(ManagementFactory.getRuntimeMXBean().getInputArguments());
    return jvmOptions;
}
项目:Pushjet-Android    文件:CurrentProcess.java   
private static JvmOptions inferJvmOptions() {
    // Try to infer the effective jvm options for the currently running process.
    // We only care about 'managed' jvm args, anything else is unimportant to the running build
    JvmOptions jvmOptions = new JvmOptions(new IdentityFileResolver());
    jvmOptions.setAllJvmArgs(ManagementFactory.getRuntimeMXBean().getInputArguments());
    return jvmOptions;
}
项目:Pushjet-Android    文件:CurrentProcess.java   
private static JvmOptions inferJvmOptions() {
    // Try to infer the effective jvm options for the currently running process.
    // We only care about 'managed' jvm args, anything else is unimportant to the running build
    JvmOptions jvmOptions = new JvmOptions(new IdentityFileResolver());
    jvmOptions.setAllJvmArgs(ManagementFactory.getRuntimeMXBean().getInputArguments());
    return jvmOptions;
}
项目:Reer    文件:CommandLineActionFactory.java   
protected void createActionFactories(ServiceRegistry loggingServices, Collection<CommandLineAction> actions) {
    actions.add(new GuiActionsFactory());
    actions.add(new BuildActionsFactory(loggingServices, new ParametersConverter(), new CachingJvmVersionDetector(new DefaultJvmVersionDetector(new DefaultExecActionFactory(new IdentityFileResolver())))));
}
项目:Reer    文件:DefaultExecHandleBuilder.java   
public DefaultExecHandleBuilder() {
    super(new IdentityFileResolver());
}
项目:Reer    文件:PathKeyFileStore.java   
public PathKeyFileStore(File baseDir) {
    this.baseDir = baseDir;
    IdentityFileResolver fileResolver = new IdentityFileResolver();
    deleter = new Deleter(fileResolver, fileResolver.getFileSystem());
}
项目:Pushjet-Android    文件:DefaultFileCollectionResolveContext.java   
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
项目:Pushjet-Android    文件:BuildDependenciesOnlyFileCollectionResolveContext.java   
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
项目:Pushjet-Android    文件:ExecHandleBuilder.java   
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}
项目:Pushjet-Android    文件:DefaultFileCollectionResolveContext.java   
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
项目:Pushjet-Android    文件:BuildDependenciesOnlyFileCollectionResolveContext.java   
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
项目:Pushjet-Android    文件:ExecHandleBuilder.java   
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}
项目:nw-gradle    文件:SAPManifestTest.java   
public static SAPManifest createSAPManifest() {
  FileResolver fileResolver = new IdentityFileResolver();
  SAPManifest sapManifest = new SAPManifest(fileResolver);
  return sapManifest;
}