org.gradle.api.internal.file.IdentityFileResolver Java Examples

The following examples show how to use org.gradle.api.internal.file.IdentityFileResolver. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CurrentProcess.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * 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;
}
 
Example #2
Source File: CurrentProcess.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * 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;
}
 
Example #3
Source File: CurrentProcess.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * 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;
}
 
Example #4
Source File: CurrentProcess.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * 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;
}
 
Example #5
Source File: Web3jPlugin.java    From web3j-gradle-plugin with Apache License 2.0 6 votes vote down vote up
private SourceDirectorySet buildSourceDirectorySet(final SourceSet sourceSet) {

        final String displayName = capitalize((CharSequence) sourceSet.getName()) + " Solidity ABI";

        final SourceDirectorySet directorySet =
                new DefaultSourceDirectorySet(
                        sourceSet.getName(),
                        displayName,
                        new IdentityFileResolver(),
                        new DefaultDirectoryFileTreeFactory());

        directorySet.srcDir(buildOutputDir(sourceSet));
        directorySet.include("**/*.abi");

        return directorySet;
    }
 
Example #6
Source File: Utils.java    From Injector with Apache License 2.0 5 votes vote down vote up
public static Dependency createDependencyFrom(ResolvedArtifact resolvedArtifact) {
	ModuleVersionIdentifier identifier = resolvedArtifact.getModuleVersion().getId();
	return identifier.getGroup().isEmpty() ? new DefaultSelfResolvingDependency(
			resolvedArtifact.getId().getComponentIdentifier(),
			new DefaultFileCollectionFactory(new IdentityFileResolver(), null).fixed(resolvedArtifact.getFile())
	) : new DefaultExternalModuleDependency(
			identifier.getGroup(),
			identifier.getName(),
			identifier.getVersion());
}
 
Example #7
Source File: CurrentProcess.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #8
Source File: CurrentProcess.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #9
Source File: CurrentProcess.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #10
Source File: CurrentProcess.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #11
Source File: DefaultFileCollectionResolveContext.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
 
Example #12
Source File: BuildDependenciesOnlyFileCollectionResolveContext.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
 
Example #13
Source File: ExecHandleBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}
 
Example #14
Source File: ExecHandleBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}
 
Example #15
Source File: BuildDependenciesOnlyFileCollectionResolveContext.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
 
Example #16
Source File: DefaultFileCollectionResolveContext.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
 
Example #17
Source File: BuildDependenciesOnlyFileCollectionResolveContext.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
 
Example #18
Source File: ExecHandleBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}
 
Example #19
Source File: DefaultFileCollectionResolveContext.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
 
Example #20
Source File: DefaultFileCollectionResolveContext.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
 
Example #21
Source File: BuildDependenciesOnlyFileCollectionResolveContext.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
 
Example #22
Source File: ExecHandleBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}