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

The following examples show how to use org.gradle.api.internal.file.IdentityFileResolver. These examples are extracted from open source projects. 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 Project: web3j-gradle-plugin   Source File: Web3jPlugin.java    License: 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 2
/**
 * 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 3
/**
 * 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 4
/**
 * 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 5
/**
 * 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 6
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 7
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 Project: Injector   Source File: Utils.java    License: 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 9
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
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
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
 
Example 12
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
 
Example 13
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}
 
Example 14
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
 
Example 15
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
 
Example 16
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}
 
Example 17
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
 
Example 18
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
 
Example 19
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}
 
Example 20
public DefaultFileCollectionResolveContext() {
    this(new IdentityFileResolver());
}
 
Example 21
public BuildDependenciesOnlyFileCollectionResolveContext() {
    super(new IdentityFileResolver(), new BuildableFileTreeInternalConverter(), new BuildableFileTreeInternalConverter());
}
 
Example 22
public ExecHandleBuilder() {
    super(new IdentityFileResolver());
}