Java Code Examples for org.gradle.util.ConfigureUtil#configureByMap()

The following examples show how to use org.gradle.util.ConfigureUtil#configureByMap() . 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: DefaultRepositoryHandler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public DependencyResolver mavenRepo(Map<String, ?> args, Closure configClosure) {
    DeprecationLogger.nagUserOfReplacedMethod("RepositoryHandler.mavenRepo()", "maven()");
    Map<String, Object> modifiedArgs = new HashMap<String, Object>(args);
    if (modifiedArgs.containsKey("urls")) {
        List<?> urls = flattenCollections(modifiedArgs.remove("urls"));
        if (!urls.isEmpty()) {
            modifiedArgs.put("url", urls.get(0));
            List<?> extraUrls = urls.subList(1, urls.size());
            modifiedArgs.put("artifactUrls", extraUrls);
        }
    }

    MavenArtifactRepository repository = repositoryFactory.createMavenRepository();
    ConfigureUtil.configureByMap(modifiedArgs, repository);
    DependencyResolver resolver = repositoryFactory.toResolver(repository);
    ConfigureUtil.configure(configClosure, resolver);
    addRepository(repositoryFactory.createResolverBackedRepository(resolver), "mavenRepo");
    return resolver;
}
 
Example 2
Source File: DefaultRepositoryHandler.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public DependencyResolver mavenRepo(Map<String, ?> args, Closure configClosure) {
    DeprecationLogger.nagUserOfReplacedMethod("RepositoryHandler.mavenRepo()", "maven()");
    Map<String, Object> modifiedArgs = new HashMap<String, Object>(args);
    if (modifiedArgs.containsKey("urls")) {
        List<?> urls = flattenCollections(modifiedArgs.remove("urls"));
        if (!urls.isEmpty()) {
            modifiedArgs.put("url", urls.get(0));
            List<?> extraUrls = urls.subList(1, urls.size());
            modifiedArgs.put("artifactUrls", extraUrls);
        }
    }

    MavenArtifactRepository repository = repositoryFactory.createMavenRepository();
    ConfigureUtil.configureByMap(modifiedArgs, repository);
    DependencyResolver resolver = repositoryFactory.toResolver(repository);
    ConfigureUtil.configure(configClosure, resolver);
    addRepository(repositoryFactory.createResolverBackedRepository(resolver), "mavenRepo");
    return resolver;
}
 
Example 3
Source File: AbstractPluginAware.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Map<String, ?> options) {
    DefaultObjectConfigurationAction action = createObjectConfigurationAction();
    ConfigureUtil.configureByMap(options, action);
    action.execute();
}
 
Example 4
Source File: DefaultScript.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Map options) {
    DefaultObjectConfigurationAction action = createObjectConfigurationAction();
    ConfigureUtil.configureByMap(options, action);
    action.execute();
}
 
Example 5
Source File: ConfigureByMapAction.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void execute(T thing) {
    ConfigureUtil.configureByMap(properties, thing, mandatoryProperties);
}
 
Example 6
Source File: DefaultConfigurableFileTree.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultConfigurableFileTree(Map<String, ?> args, FileResolver resolver, TaskResolver taskResolver, FileCopier fileCopier) {
    this.resolver = resolver;
    this.fileCopier = fileCopier;
    ConfigureUtil.configureByMap(args, this);
    buildDependency = new DefaultTaskDependency(taskResolver);
}
 
Example 7
Source File: AbstractPluginAware.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Map<String, ?> options) {
    DefaultObjectConfigurationAction action = new DefaultObjectConfigurationAction(getFileResolver(), getScriptPluginFactory(), getScriptHandlerFactory(), getClassLoaderScope().getBase().createChild(), this);
    ConfigureUtil.configureByMap(options, action);
    action.execute();
}
 
Example 8
Source File: DefaultScript.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Map options) {
    DefaultObjectConfigurationAction action = createObjectConfigurationAction();
    ConfigureUtil.configureByMap(options, action);
    action.execute();
}
 
Example 9
Source File: ConfigureByMapAction.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void execute(T thing) {
    ConfigureUtil.configureByMap(properties, thing, mandatoryProperties);
}
 
Example 10
Source File: DefaultConfigurableFileTree.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultConfigurableFileTree(Map<String, ?> args, FileResolver resolver, TaskResolver taskResolver, FileCopier fileCopier) {
    this.resolver = resolver;
    this.fileCopier = fileCopier;
    ConfigureUtil.configureByMap(args, this);
    buildDependency = new DefaultTaskDependency(taskResolver);
}
 
Example 11
Source File: AbstractPluginAware.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Map<String, ?> options) {
    DefaultObjectConfigurationAction action = createObjectConfigurationAction();
    ConfigureUtil.configureByMap(options, action);
    action.execute();
}
 
Example 12
Source File: DefaultScript.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Map options) {
    DefaultObjectConfigurationAction action = createObjectConfigurationAction();
    ConfigureUtil.configureByMap(options, action);
    action.execute();
}
 
Example 13
Source File: ConfigureByMapAction.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void execute(T thing) {
    ConfigureUtil.configureByMap(properties, thing, mandatoryProperties);
}
 
Example 14
Source File: DefaultConfigurableFileTree.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultConfigurableFileTree(Map<String, ?> args, FileResolver resolver, TaskResolver taskResolver, FileCopier fileCopier) {
    this.resolver = resolver;
    this.fileCopier = fileCopier;
    ConfigureUtil.configureByMap(args, this);
    buildDependency = new DefaultTaskDependency(taskResolver);
}
 
Example 15
Source File: AbstractPluginAware.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Map<String, ?> options) {
    DefaultObjectConfigurationAction action = new DefaultObjectConfigurationAction(getFileResolver(), getScriptPluginFactory(), getScriptHandlerFactory(), getClassLoaderScope().getBase().createChild(), this);
    ConfigureUtil.configureByMap(options, action);
    action.execute();
}
 
Example 16
Source File: DefaultScript.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void apply(Map options) {
    DefaultObjectConfigurationAction action = createObjectConfigurationAction();
    ConfigureUtil.configureByMap(options, action);
    action.execute();
}
 
Example 17
Source File: ConfigureByMapAction.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void execute(T thing) {
    ConfigureUtil.configureByMap(properties, thing, mandatoryProperties);
}
 
Example 18
Source File: DefaultConfigurableFileTree.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultConfigurableFileTree(Map<String, ?> args, FileResolver resolver, TaskResolver taskResolver, FileCopier fileCopier) {
    this.resolver = resolver;
    this.fileCopier = fileCopier;
    ConfigureUtil.configureByMap(args, this);
    buildDependency = new DefaultTaskDependency(taskResolver);
}