Java Code Examples for org.gradle.api.internal.DefaultDomainObjectSet

The following examples show how to use org.gradle.api.internal.DefaultDomainObjectSet. 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
public DefaultJvmLibrarySpec(ComponentSpecIdentifier identifier, FunctionalSourceSet mainSourceSet) {
    this.identifier = identifier;
    this.mainSourceSet = mainSourceSet;
    sourceSets.addMainSources(mainSourceSet);
    this.languageOutputs.add(JvmResources.class);
    this.languageOutputs.add(JvmByteCode.class);
    this.binaries = new DefaultDomainObjectSet<BinarySpec>(JvmBinarySpec.class);
    this.jvmBinaries = this.binaries.withType(JvmBinarySpec.class);

}
 
Example 2
public DefaultConfiguration(String path, String name, ConfigurationsProvider configurationsProvider,
                            ConfigurationResolver resolver, ListenerManager listenerManager,
                            DependencyMetaDataProvider metaDataProvider,
                            ResolutionStrategyInternal resolutionStrategy) {
    this.path = path;
    this.name = name;
    this.configurationsProvider = configurationsProvider;
    this.resolver = resolver;
    this.listenerManager = listenerManager;
    this.metaDataProvider = metaDataProvider;
    this.resolutionStrategy = resolutionStrategy;

    resolutionListenerBroadcast = listenerManager.createAnonymousBroadcaster(DependencyResolutionListener.class);

    DefaultDomainObjectSet<Dependency> ownDependencies = new DefaultDomainObjectSet<Dependency>(Dependency.class);
    ownDependencies.beforeChange(new VetoContainerChangeAction());

    dependencies = new DefaultDependencySet(String.format("%s dependencies", getDisplayName()), ownDependencies);
    inheritedDependencies = new CompositeDomainObjectSet<Dependency>(Dependency.class).addCollection(ownDependencies);

    allDependencies = new DefaultDependencySet(String.format("%s all dependencies", getDisplayName()), inheritedDependencies);

    DefaultDomainObjectSet<PublishArtifact> ownArtifacts = new DefaultDomainObjectSet<PublishArtifact>(PublishArtifact.class);
    ownArtifacts.beforeChange(new VetoContainerChangeAction());

    artifacts = new DefaultPublishArtifactSet(String.format("%s artifacts", getDisplayName()), ownArtifacts);
    inheritedArtifacts = new CompositeDomainObjectSet<PublishArtifact>(PublishArtifact.class, ownArtifacts);
    allArtifacts = new DefaultPublishArtifactSet(String.format("%s all artifacts", getDisplayName()), inheritedArtifacts);
}
 
Example 3
public AbstractNativeComponentSpec(ComponentSpecIdentifier id, FunctionalSourceSet mainSourceSet) {
    this.mainSourceSet = mainSourceSet;
    sourceSets.addMainSources(mainSourceSet);
    this.id = id;
    this.binaries = new DefaultDomainObjectSet<BinarySpec>(NativeBinarySpec.class);
    this.nativeBinaries = this.binaries.withType(NativeBinarySpec.class);
    this.inputTypes.add(ObjectFile.class);
}
 
Example 4
public DomainObjectSet<NativeLibraryBinary> getBinaries(NativeLibraryRequirement requirement) {
    Project project = findProject(requirement);
    ComponentSpecContainer componentSpecContainer = project.getExtensions().findByType(ComponentSpecContainer.class);
    if (componentSpecContainer == null) {
        throw new LibraryResolveException(String.format("Project does not have a libraries container: '%s'", project.getPath()));
    }
    DomainObjectSet<NativeBinarySpec> projectBinaries = componentSpecContainer.withType(NativeLibrarySpec.class).getByName(requirement.getLibraryName()).getNativeBinaries();
    DomainObjectSet<NativeLibraryBinary> binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
    // TODO:DAZ Convert, don't cast
    for (NativeBinarySpec nativeBinarySpec : projectBinaries) {
        binaries.add((NativeLibraryBinary) nativeBinarySpec);
    }
    return binaries;
}
 
Example 5
public DefaultConfiguration(String path, String name, ConfigurationsProvider configurationsProvider,
                            ConfigurationResolver resolver, ListenerManager listenerManager,
                            DependencyMetaDataProvider metaDataProvider,
                            ResolutionStrategyInternal resolutionStrategy) {
    this.path = path;
    this.name = name;
    this.configurationsProvider = configurationsProvider;
    this.resolver = resolver;
    this.listenerManager = listenerManager;
    this.metaDataProvider = metaDataProvider;
    this.resolutionStrategy = resolutionStrategy;

    resolutionListenerBroadcast = listenerManager.createAnonymousBroadcaster(DependencyResolutionListener.class);

    DefaultDomainObjectSet<Dependency> ownDependencies = new DefaultDomainObjectSet<Dependency>(Dependency.class);
    ownDependencies.beforeChange(new VetoContainerChangeAction());

    dependencies = new DefaultDependencySet(String.format("%s dependencies", getDisplayName()), ownDependencies);
    inheritedDependencies = new CompositeDomainObjectSet<Dependency>(Dependency.class, ownDependencies);
    allDependencies = new DefaultDependencySet(String.format("%s all dependencies", getDisplayName()), inheritedDependencies);

    DefaultDomainObjectSet<PublishArtifact> ownArtifacts = new DefaultDomainObjectSet<PublishArtifact>(PublishArtifact.class);
    ownArtifacts.beforeChange(new VetoContainerChangeAction());
    artifacts = new DefaultPublishArtifactSet(String.format("%s artifacts", getDisplayName()), ownArtifacts);
    inheritedArtifacts = new CompositeDomainObjectSet<PublishArtifact>(PublishArtifact.class, ownArtifacts);
    allArtifacts = new DefaultPublishArtifactSet(String.format("%s all artifacts", getDisplayName()), inheritedArtifacts);
}
 
Example 6
public DefaultJvmLibrarySpec(ComponentSpecIdentifier identifier, FunctionalSourceSet mainSourceSet) {
    this.identifier = identifier;
    this.mainSourceSet = mainSourceSet;
    sourceSets.addMainSources(mainSourceSet);
    this.languageOutputs.add(JvmResources.class);
    this.languageOutputs.add(JvmByteCode.class);
    this.binaries = new DefaultDomainObjectSet<BinarySpec>(JvmBinarySpec.class);
    this.jvmBinaries = this.binaries.withType(JvmBinarySpec.class);

}
 
Example 7
public DefaultConfiguration(String path, String name, ConfigurationsProvider configurationsProvider,
                            ConfigurationResolver resolver, ListenerManager listenerManager,
                            DependencyMetaDataProvider metaDataProvider,
                            ResolutionStrategyInternal resolutionStrategy) {
    this.path = path;
    this.name = name;
    this.configurationsProvider = configurationsProvider;
    this.resolver = resolver;
    this.listenerManager = listenerManager;
    this.metaDataProvider = metaDataProvider;
    this.resolutionStrategy = resolutionStrategy;

    resolutionListenerBroadcast = listenerManager.createAnonymousBroadcaster(DependencyResolutionListener.class);

    DefaultDomainObjectSet<Dependency> ownDependencies = new DefaultDomainObjectSet<Dependency>(Dependency.class);
    ownDependencies.beforeChange(new VetoContainerChangeAction());

    dependencies = new DefaultDependencySet(String.format("%s dependencies", getDisplayName()), ownDependencies);
    inheritedDependencies = new CompositeDomainObjectSet<Dependency>(Dependency.class).addCollection(ownDependencies);

    allDependencies = new DefaultDependencySet(String.format("%s all dependencies", getDisplayName()), inheritedDependencies);

    DefaultDomainObjectSet<PublishArtifact> ownArtifacts = new DefaultDomainObjectSet<PublishArtifact>(PublishArtifact.class);
    ownArtifacts.beforeChange(new VetoContainerChangeAction());

    artifacts = new DefaultPublishArtifactSet(String.format("%s artifacts", getDisplayName()), ownArtifacts);
    inheritedArtifacts = new CompositeDomainObjectSet<PublishArtifact>(PublishArtifact.class, ownArtifacts);
    allArtifacts = new DefaultPublishArtifactSet(String.format("%s all artifacts", getDisplayName()), inheritedArtifacts);
}
 
Example 8
public AbstractNativeComponentSpec(ComponentSpecIdentifier id, FunctionalSourceSet mainSourceSet) {
    this.mainSourceSet = mainSourceSet;
    sourceSets.addMainSources(mainSourceSet);
    this.id = id;
    this.binaries = new DefaultDomainObjectSet<BinarySpec>(NativeBinarySpec.class);
    this.nativeBinaries = this.binaries.withType(NativeBinarySpec.class);
    this.inputTypes.add(ObjectFile.class);
}
 
Example 9
public DomainObjectSet<NativeLibraryBinary> getBinaries(NativeLibraryRequirement requirement) {
    Project project = findProject(requirement);
    ComponentSpecContainer componentSpecContainer = project.getExtensions().findByType(ComponentSpecContainer.class);
    if (componentSpecContainer == null) {
        throw new LibraryResolveException(String.format("Project does not have a libraries container: '%s'", project.getPath()));
    }
    DomainObjectSet<NativeBinarySpec> projectBinaries = componentSpecContainer.withType(NativeLibrarySpec.class).getByName(requirement.getLibraryName()).getNativeBinaries();
    DomainObjectSet<NativeLibraryBinary> binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
    // TODO:DAZ Convert, don't cast
    for (NativeBinarySpec nativeBinarySpec : projectBinaries) {
        binaries.add((NativeLibraryBinary) nativeBinarySpec);
    }
    return binaries;
}
 
Example 10
public DefaultConfiguration(String path, String name, ConfigurationsProvider configurationsProvider,
                            ConfigurationResolver resolver, ListenerManager listenerManager,
                            DependencyMetaDataProvider metaDataProvider,
                            ResolutionStrategyInternal resolutionStrategy) {
    this.path = path;
    this.name = name;
    this.configurationsProvider = configurationsProvider;
    this.resolver = resolver;
    this.listenerManager = listenerManager;
    this.metaDataProvider = metaDataProvider;
    this.resolutionStrategy = resolutionStrategy;

    resolutionListenerBroadcast = listenerManager.createAnonymousBroadcaster(DependencyResolutionListener.class);

    DefaultDomainObjectSet<Dependency> ownDependencies = new DefaultDomainObjectSet<Dependency>(Dependency.class);
    ownDependencies.beforeChange(new VetoContainerChangeAction());

    dependencies = new DefaultDependencySet(String.format("%s dependencies", getDisplayName()), ownDependencies);
    inheritedDependencies = new CompositeDomainObjectSet<Dependency>(Dependency.class, ownDependencies);
    allDependencies = new DefaultDependencySet(String.format("%s all dependencies", getDisplayName()), inheritedDependencies);

    DefaultDomainObjectSet<PublishArtifact> ownArtifacts = new DefaultDomainObjectSet<PublishArtifact>(PublishArtifact.class);
    ownArtifacts.beforeChange(new VetoContainerChangeAction());
    artifacts = new DefaultPublishArtifactSet(String.format("%s artifacts", getDisplayName()), ownArtifacts);
    inheritedArtifacts = new CompositeDomainObjectSet<PublishArtifact>(PublishArtifact.class, ownArtifacts);
    allArtifacts = new DefaultPublishArtifactSet(String.format("%s all artifacts", getDisplayName()), inheritedArtifacts);
}
 
Example 11
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) {
    this.name = name;
    headers = new DefaultSourceDirectorySet("headers", fileResolver);
    binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
}
 
Example 12
Source Project: pushfish-android   Source File: WrapUtil.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Wraps the given items in a mutable domain object set.
 */
public static <T> DomainObjectSet<T> toDomainObjectSet(Class<T> type, T... items) {
    return new DefaultDomainObjectSet<T>(type, toSet(items));
}
 
Example 13
public AbstractProjectNativeComponent(NativeProjectComponentIdentifier id) {
    this.id = id;
    this.sourceSets = new DefaultDomainObjectSet<LanguageSourceSet>(LanguageSourceSet.class);
    binaries = new DefaultDomainObjectSet<NativeBinary>(NativeBinary.class);
}
 
Example 14
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) {
    this.name = name;
    headers = new DefaultSourceDirectorySet("headers", fileResolver);
    binaries = new DefaultDomainObjectSet<NativeBinary>(NativeBinary.class);
}
 
Example 15
Source Project: pushfish-android   Source File: WrapUtil.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Wraps the given items in a mutable domain object set.
 */
public static <T> DomainObjectSet<T> toDomainObjectSet(Class<T> type, T... items) {
    return new DefaultDomainObjectSet<T>(type, toSet(items));
}
 
Example 16
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) {
    this.name = name;
    headers = new DefaultSourceDirectorySet("headers", fileResolver);
    binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class);
}
 
Example 17
Source Project: Pushjet-Android   Source File: WrapUtil.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Wraps the given items in a mutable domain object set.
 */
public static <T> DomainObjectSet<T> toDomainObjectSet(Class<T> type, T... items) {
    return new DefaultDomainObjectSet<T>(type, toSet(items));
}
 
Example 18
public AbstractProjectNativeComponent(NativeProjectComponentIdentifier id) {
    this.id = id;
    this.sourceSets = new DefaultDomainObjectSet<LanguageSourceSet>(LanguageSourceSet.class);
    binaries = new DefaultDomainObjectSet<NativeBinary>(NativeBinary.class);
}
 
Example 19
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) {
    this.name = name;
    headers = new DefaultSourceDirectorySet("headers", fileResolver);
    binaries = new DefaultDomainObjectSet<NativeBinary>(NativeBinary.class);
}
 
Example 20
Source Project: Pushjet-Android   Source File: WrapUtil.java    License: BSD 2-Clause "Simplified" License 4 votes vote down vote up
/**
 * Wraps the given items in a mutable domain object set.
 */
public static <T> DomainObjectSet<T> toDomainObjectSet(Class<T> type, T... items) {
    return new DefaultDomainObjectSet<T>(type, toSet(items));
}
 
Example 21
Source Project: javaide   Source File: AppExtension.java    License: GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the list of Application variants. Since the collections is built after evaluation, it
 * should be used with Gradle's <code>all</code> iterator to process future items.
 */
public DefaultDomainObjectSet<ApplicationVariant> getApplicationVariants() {
    return applicationVariantList;
}
 
Example 22
Source Project: javaide   Source File: LibraryExtension.java    License: GNU General Public License v3.0 2 votes vote down vote up
/**
 * Returns the list of library variants. Since the collections is built after evaluation, it
 * should be used with Gradle's <code>all</code> iterator to process future items.
 */
public DefaultDomainObjectSet<LibraryVariant> getLibraryVariants() {
    return libraryVariantList;
}