Java Code Examples for org.gradle.util.CollectionUtils#toList()

The following examples show how to use org.gradle.util.CollectionUtils#toList() . 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: DefaultPayloadClassLoaderRegistry.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public ClassLoaderDetails transform(ClassLoader classLoader) {
    ClassLoaderSpecVisitor visitor = new ClassLoaderSpecVisitor(classLoader);
    visitor.visit(classLoader);

    if (visitor.spec == null) {
        if (visitor.classPath == null) {
            visitor.spec = ClassLoaderSpec.SYSTEM_CLASS_LOADER;
        } else {
            visitor.spec = new MutableURLClassLoader.Spec(CollectionUtils.toList(visitor.classPath));
        }
    }

    UUID uuid = UUID.randomUUID();
    ClassLoaderDetails details = new ClassLoaderDetails(uuid, visitor.spec);
    for (ClassLoader parent : visitor.parents) {
        details.parents.add(getDetails(parent));
    }
    return details;
}
 
Example 2
Source File: DefaultPayloadClassLoaderRegistry.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public ClassLoaderDetails transform(ClassLoader classLoader) {
    ClassLoaderSpecVisitor visitor = new ClassLoaderSpecVisitor(classLoader);
    visitor.visit(classLoader);

    if (visitor.spec == null) {
        if (visitor.classPath == null) {
            visitor.spec = ClassLoaderSpec.SYSTEM_CLASS_LOADER;
        } else {
            visitor.spec = new MutableURLClassLoader.Spec(CollectionUtils.toList(visitor.classPath));
        }
    }

    UUID uuid = UUID.randomUUID();
    ClassLoaderDetails details = new ClassLoaderDetails(uuid, visitor.spec);
    for (ClassLoader parent : visitor.parents) {
        details.parents.add(getDetails(parent));
    }
    return details;
}
 
Example 3
Source File: DefaultPayloadClassLoaderRegistry.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private ClassLoaderDetails getDetails(ClassLoader classLoader) {
    lock.lock();
    try {
        ClassLoaderDetails details = classLoaderDetails.get(classLoader);
        if (details != null) {
            return details;
        }

        ClassLoaderSpecVisitor visitor = new ClassLoaderSpecVisitor(classLoader);
        visitor.visit(classLoader);

        if (visitor.spec == null) {
            if (visitor.classPath == null) {
                visitor.spec = ClassLoaderSpec.SYSTEM_CLASS_LOADER;
            } else {
                visitor.spec = new MutableURLClassLoader.Spec(CollectionUtils.toList(visitor.classPath));
            }
        }

        UUID uuid = UUID.randomUUID();
        details = new ClassLoaderDetails(uuid, visitor.spec);
        for (ClassLoader parent : visitor.parents) {
            details.parents.add(getDetails(parent));
        }

        classLoaderDetails.put(classLoader, details);
        classLoaderIds.put(details.uuid, classLoader);
        return details;
    } finally {
        lock.unlock();
    }
}
 
Example 4
Source File: DefaultPayloadClassLoaderRegistry.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private ClassLoaderDetails getDetails(ClassLoader classLoader) {
    lock.lock();
    try {
        ClassLoaderDetails details = classLoaderDetails.get(classLoader);
        if (details != null) {
            return details;
        }

        ClassLoaderSpecVisitor visitor = new ClassLoaderSpecVisitor(classLoader);
        visitor.visit(classLoader);

        if (visitor.spec == null) {
            if (visitor.classPath == null) {
                visitor.spec = ClassLoaderSpec.SYSTEM_CLASS_LOADER;
            } else {
                visitor.spec = new MutableURLClassLoader.Spec(CollectionUtils.toList(visitor.classPath));
            }
        }

        UUID uuid = UUID.randomUUID();
        details = new ClassLoaderDetails(uuid, visitor.spec);
        for (ClassLoader parent : visitor.parents) {
            details.parents.add(getDetails(parent));
        }

        classLoaderDetails.put(classLoader, details);
        classLoaderIds.put(details.uuid, classLoader);
        return details;
    } finally {
        lock.unlock();
    }
}
 
Example 5
Source File: AbstractModuleDescriptorBackedMetaData.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setDependencies(Iterable<? extends DependencyMetaData> dependencies) {
    this.dependencies = CollectionUtils.toList(dependencies);
    for (DefaultConfigurationMetaData configuration : configurations.values()) {
        configuration.dependencies = null;
    }
}
 
Example 6
Source File: DefaultTaskExecutionPlan.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private <T> void addAllReversed(List<T> list, TreeSet<T> set) {
    List<T> elements = CollectionUtils.toList(set);
    Collections.reverse(elements);
    list.addAll(elements);
}
 
Example 7
Source File: AbstractModuleDescriptorBackedMetaData.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setDependencies(Iterable<? extends DependencyMetaData> dependencies) {
    this.dependencies = CollectionUtils.toList(dependencies);
    for (DefaultConfigurationMetaData configuration : configurations.values()) {
        configuration.dependencies = null;
    }
}
 
Example 8
Source File: DefaultTaskExecutionPlan.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private <T> void addAllReversed(List<T> list, TreeSet<T> set) {
    List<T> elements = CollectionUtils.toList(set);
    Collections.reverse(elements);
    list.addAll(elements);
}
 
Example 9
Source File: AbstractModuleDescriptorBackedMetaData.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setDependencies(Iterable<? extends DependencyMetaData> dependencies) {
    this.dependencies = CollectionUtils.toList(dependencies);
    for (DefaultConfigurationMetaData configuration : configurations.values()) {
        configuration.dependencies = null;
    }
}
 
Example 10
Source File: DefaultTaskExecutionPlan.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private <T> void addAllReversed(List<T> list, TreeSet<T> set) {
    List<T> elements = CollectionUtils.toList(set);
    Collections.reverse(elements);
    list.addAll(elements);
}
 
Example 11
Source File: AbstractModuleDescriptorBackedMetaData.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void setDependencies(Iterable<? extends DependencyMetaData> dependencies) {
    this.dependencies = CollectionUtils.toList(dependencies);
    for (DefaultConfigurationMetaData configuration : configurations.values()) {
        configuration.dependencies = null;
    }
}
 
Example 12
Source File: DefaultTaskExecutionPlan.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private <T> void addAllReversed(List<T> list, TreeSet<T> set) {
    List<T> elements = CollectionUtils.toList(set);
    Collections.reverse(elements);
    list.addAll(elements);
}
 
Example 13
Source File: IncrementalNativeCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 3 votes vote down vote up
private IncrementalCompileProcessor createProcessor(SourceIncludesParser sourceIncludesParser, Iterable<File> includes) {
    PersistentStateCache<CompilationState> compileStateCache = createCompileStateCache(task.getPath());

    DefaultSourceIncludesResolver dependencyParser = new DefaultSourceIncludesResolver(CollectionUtils.toList(includes));

    return new IncrementalCompileProcessor(compileStateCache, dependencyParser, sourceIncludesParser, fileSnapshotter);
}
 
Example 14
Source File: AbstractIncrementalNativeCompiler.java    From pushfish-android with BSD 2-Clause "Simplified" License 3 votes vote down vote up
private IncrementalCompileProcessor createProcessor(Iterable<File> includes) {
    PersistentStateCache<CompilationState> compileStateCache = createCompileStateCache(task.getPath());

    DefaultSourceIncludesResolver dependencyParser = new DefaultSourceIncludesResolver(CollectionUtils.toList(includes));

    return new IncrementalCompileProcessor(compileStateCache, dependencyParser, sourceIncludesParser, fileSnapshotter);
}
 
Example 15
Source File: IncrementalNativeCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 3 votes vote down vote up
private IncrementalCompileProcessor createProcessor(SourceIncludesParser sourceIncludesParser, Iterable<File> includes) {
    PersistentStateCache<CompilationState> compileStateCache = createCompileStateCache(task.getPath());

    DefaultSourceIncludesResolver dependencyParser = new DefaultSourceIncludesResolver(CollectionUtils.toList(includes));

    return new IncrementalCompileProcessor(compileStateCache, dependencyParser, sourceIncludesParser, fileSnapshotter);
}
 
Example 16
Source File: AbstractIncrementalNativeCompiler.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 3 votes vote down vote up
private IncrementalCompileProcessor createProcessor(Iterable<File> includes) {
    PersistentStateCache<CompilationState> compileStateCache = createCompileStateCache(task.getPath());

    DefaultSourceIncludesResolver dependencyParser = new DefaultSourceIncludesResolver(CollectionUtils.toList(includes));

    return new IncrementalCompileProcessor(compileStateCache, dependencyParser, sourceIncludesParser, fileSnapshotter);
}