Java Code Examples for org.gradle.util.DeprecationLogger#nagUserOfReplacedMethod()

The following examples show how to use org.gradle.util.DeprecationLogger#nagUserOfReplacedMethod() . 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: AbstractProject.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * @deprecated Use the {@link #mkdir(Object)} instead.
 */
@Deprecated
public Directory dir(String path) {
    DeprecationLogger.nagUserOfReplacedMethod("AbstractProject.dir()", "mkdir()");
    String[] pathElements = path.split("/");
    String name = "";
    Directory dirTask = null;
    for (String pathElement : pathElements) {
        name += name.length() != 0 ? "/" + pathElement : pathElement;
        Task task = taskContainer.findByName(name);
        if (task instanceof Directory) {
            dirTask = (Directory) task;
        } else if (task != null) {
            throw new InvalidUserDataException(String.format("Cannot add directory task '%s' as a non-directory task with this name already exists.", name));
        } else {
            dirTask = taskContainer.create(name, Directory.class);
        }
    }
    return dirTask;
}
 
Example 3
Source File: AbstractProject.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
/**
 * @deprecated Use the {@link #mkdir(Object)} instead.
 */
@Deprecated
public Directory dir(String path) {
    DeprecationLogger.nagUserOfReplacedMethod("AbstractProject.dir()", "mkdir()");
    String[] pathElements = path.split("/");
    String name = "";
    Directory dirTask = null;
    for (String pathElement : pathElements) {
        name += name.length() != 0 ? "/" + pathElement : pathElement;
        Task task = taskContainer.findByName(name);
        if (task instanceof Directory) {
            dirTask = (Directory) task;
        } else if (task != null) {
            throw new InvalidUserDataException(String.format("Cannot add directory task '%s' as a non-directory task with this name already exists.", name));
        } else {
            dirTask = taskContainer.create(name, Directory.class);
        }
    }
    return dirTask;
}
 
Example 4
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 5
Source File: Specs.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static <T> Set<T> filterIterable(Iterable<? extends T> iterable, Spec<? super T> spec) {
    DeprecationLogger.nagUserOfReplacedMethod("Specs.filterIterable", "CollectionUtils.filter");
    Set<T> result = new LinkedHashSet<T>();
    for (T t : iterable) {
        if (spec.isSatisfiedBy(t)) {
            result.add(t);
        }
    }
    return result;
}
 
Example 6
Source File: Specs.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public static <T> Set<T> filterIterable(Iterable<? extends T> iterable, Spec<? super T> spec) {
    DeprecationLogger.nagUserOfReplacedMethod("Specs.filterIterable", "CollectionUtils.filter");
    Set<T> result = new LinkedHashSet<T>();
    for (T t : iterable) {
        if (spec.isSatisfiedBy(t)) {
            result.add(t);
        }
    }
    return result;
}
 
Example 7
Source File: DefaultTaskContainer.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public Task add(String name) {
    DeprecationLogger.nagUserOfReplacedMethod("TaskContainer.add()", "create()");
    return create(name);
}
 
Example 8
Source File: CompileOptions.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Deprecated.
 *
 * @deprecated use {@link #isDebug()}
 */
@Deprecated
public boolean getDebug() {
    DeprecationLogger.nagUserOfReplacedMethod("CompileOptions.getDebug()", "CompileOptions.isDebug()");
    return debug;
}
 
Example 9
Source File: DefaultConvention.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void add(String name, Class<?> type, Object... constructionArguments) {
    DeprecationLogger.nagUserOfReplacedMethod("extensions.add(String, Class, Object...)", "extensions.create(String, Class, Object...)");
    create(name, type, constructionArguments);
}
 
Example 10
Source File: DefaultTaskContainer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public Task add(Map<String, ?> options) {
    DeprecationLogger.nagUserOfReplacedMethod("TaskContainer.add()", "create()");
    return create(options);
}
 
Example 11
Source File: DefaultSourceSetContainer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public SourceSet add(String name) {
    DeprecationLogger.nagUserOfReplacedMethod("SourceSetContainer.add()", "create()");
    return create(name);
}
 
Example 12
Source File: DefaultUnresolvedDependency.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public String getId() {
    DeprecationLogger.nagUserOfReplacedMethod("UnresolvedDependency.getId()", "UnresolvedDependency.getSelector()");
    return IvyUtil.createModuleRevisionId(selector.getGroup(), selector.getName(), selector.getVersion()).toString();
}
 
Example 13
Source File: DefaultSourceSetContainer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public SourceSet add(String name, Closure closure) {
    DeprecationLogger.nagUserOfReplacedMethod("SourceSetContainer.add()", "create()");
    return create(name, closure);
}
 
Example 14
Source File: AbstractCopyTask.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Returns the default source for this task.
 * @deprecated Use getSource() instead.
 */
@Deprecated
public FileCollection getDefaultSource() {
    DeprecationLogger.nagUserOfReplacedMethod("AbstractCopyTask.getDefaultSource()", "getSource()");
    return null;
}
 
Example 15
Source File: DefaultSourceSetContainer.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public SourceSet add(String name, Closure closure) {
    DeprecationLogger.nagUserOfReplacedMethod("SourceSetContainer.add()", "create()");
    return create(name, closure);
}
 
Example 16
Source File: CompileOptions.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Deprecated.
 *
 * @deprecated use {@link #isDebug()}
 */
@Deprecated
public boolean getDebug() {
    DeprecationLogger.nagUserOfReplacedMethod("CompileOptions.getDebug()", "CompileOptions.isDebug()");
    return debug;
}
 
Example 17
Source File: DefaultTaskContainer.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public <T extends Task> T add(String name, Class<T> type) {
    DeprecationLogger.nagUserOfReplacedMethod("TaskContainer.add()", "create()");
    return create(name, type);
}
 
Example 18
Source File: DefaultConfigurationContainer.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public Configuration add(String name, Closure closure) {
    DeprecationLogger.nagUserOfReplacedMethod("ConfigurationContainer.add()", "create()");
    return create(name, closure);
}
 
Example 19
Source File: DefaultConfigurationContainer.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public Configuration add(String name) {
    DeprecationLogger.nagUserOfReplacedMethod("ConfigurationContainer.add()", "create()");
    return create(name);
}
 
Example 20
Source File: SourceTask.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 2 votes vote down vote up
/**
 * Returns the default source for this task, if any.
 *
 * @return The source. May return null.
 * @deprecated Use getSource() instead.
 */
@Deprecated
protected FileTree getDefaultSource() {
    DeprecationLogger.nagUserOfReplacedMethod("SourceTask.getDefaultSource()", "getSource()");
    return null;
}