Java Code Examples for org.gradle.internal.classpath.ClassPath#isEmpty()

The following examples show how to use org.gradle.internal.classpath.ClassPath#isEmpty() . 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: DefaultClassLoaderScope.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public ClassLoader addLocal(ClassPath classpath) {
    if (locked) {
        throw new IllegalStateException("class loader scope is locked");
    }
    if (!classpath.isEmpty()) {
        if (local == null) {
            local = new ArrayList<ClassLoader>(1);
        }

        ClassLoader newClassLoader = classLoaderCache.get(base.getChildClassLoader(), classpath, null);
        local.add(newClassLoader);

        if (localClassLoader != null) { // classloader was eagerly created, have to add
            addLocal(newClassLoader);
        }

        return newClassLoader;
    } else {
        return base.getChildClassLoader();
    }
}
 
Example 2
Source File: DefaultClassLoaderScope.java    From pushfish-android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public ClassLoader export(ClassPath classpath) {
    if (locked) {
        throw new IllegalStateException("class loader scope is locked");
    }
    if (classpath.isEmpty()) {
        return parent.getChildClassLoader();
    } else {
        if (exportingClassLoader == null) {
            exportingClassLoader = new MultiParentClassLoader();
        }

        ClassLoader classLoader = classLoaderCache.get(parent.getChildClassLoader(), classpath, null);
        exportingClassLoader.addParent(classLoader);
        return classLoader;
    }
}
 
Example 3
Source File: DefaultClassLoaderScope.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public ClassLoader addLocal(ClassPath classpath) {
    if (locked) {
        throw new IllegalStateException("class loader scope is locked");
    }
    if (!classpath.isEmpty()) {
        if (local == null) {
            local = new ArrayList<ClassLoader>(1);
        }

        ClassLoader newClassLoader = classLoaderCache.get(base.getChildClassLoader(), classpath, null);
        local.add(newClassLoader);

        if (localClassLoader != null) { // classloader was eagerly created, have to add
            addLocal(newClassLoader);
        }

        return newClassLoader;
    } else {
        return base.getChildClassLoader();
    }
}
 
Example 4
Source File: DefaultClassLoaderScope.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 6 votes vote down vote up
public ClassLoader export(ClassPath classpath) {
    if (locked) {
        throw new IllegalStateException("class loader scope is locked");
    }
    if (classpath.isEmpty()) {
        return parent.getChildClassLoader();
    } else {
        if (exportingClassLoader == null) {
            exportingClassLoader = new MultiParentClassLoader();
        }

        ClassLoader classLoader = classLoaderCache.get(parent.getChildClassLoader(), classpath, null);
        exportingClassLoader.addParent(classLoader);
        return classLoader;
    }
}
 
Example 5
Source File: DefaultClassLoaderScope.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ClassLoaderScope local(ClassPath classPath) {
    if (classPath.isEmpty()) {
        return this;
    }

    assertNotLocked();
    if (localClassLoader != null) {
        localClassLoader.addParent(loader(classPath));
    } else {
        local.add(classPath);
    }

    return this;
}
 
Example 6
Source File: DefaultClassLoaderScope.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ClassLoaderScope export(ClassPath classPath) {
    if (classPath.isEmpty()) {
        return this;
    }

    assertNotLocked();
    if (exportingClassLoader != null) {
        exportingClassLoader.addParent(loader(classPath));
    } else {
        export.add(classPath);
    }

    return this;
}
 
Example 7
Source File: BuildSourceBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ClassLoaderScope buildAndCreateClassLoader(StartParameter startParameter) {
    ClassPath classpath = createBuildSourceClasspath(startParameter);
    if (classpath.isEmpty()) {
        return classLoaderScope;
    } else {
        ClassLoaderScope childScope = classLoaderScope.createChild();
        childScope.export(classpath);
        childScope.lock();
        return childScope;
    }
}
 
Example 8
Source File: DefaultClassLoaderScope.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ClassLoaderScope local(ClassPath classPath) {
    if (classPath.isEmpty()) {
        return this;
    }

    assertNotLocked();
    if (localClassLoader != null) {
        localClassLoader.addParent(loader(classPath));
    } else {
        local.add(classPath);
    }

    return this;
}
 
Example 9
Source File: DefaultClassLoaderScope.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ClassLoaderScope export(ClassPath classPath) {
    if (classPath.isEmpty()) {
        return this;
    }

    assertNotLocked();
    if (exportingClassLoader != null) {
        exportingClassLoader.addParent(loader(classPath));
    } else {
        export.add(classPath);
    }

    return this;
}
 
Example 10
Source File: BuildSourceBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ClassLoaderScope buildAndCreateClassLoader(StartParameter startParameter) {
    ClassPath classpath = createBuildSourceClasspath(startParameter);
    if (classpath.isEmpty()) {
        return classLoaderScope;
    } else {
        ClassLoaderScope childScope = classLoaderScope.createChild();
        childScope.export(classpath);
        childScope.lock();
        return childScope;
    }
}