@Nullable @Override public DomainObjectSet<NativeLibraryBinary> getBinaries(LibraryIdentifier libraryIdentifier) { ModelRegistry projectModel = projectModelResolver.resolveProjectModel(libraryIdentifier.getProjectPath()); ComponentSpecContainer components = projectModel.find("components", ComponentSpecContainer.class); if (components == null) { return null; } String libraryName = libraryIdentifier.getLibraryName(); NativeLibrarySpec library = components.withType(NativeLibrarySpec.class).get(libraryName); if (library == null) { return null; } ModelMap<NativeBinarySpec> projectBinaries = library.getBinaries().withType(NativeBinarySpec.class); DomainObjectSet<NativeLibraryBinary> binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class); for (NativeBinarySpec nativeBinarySpec : projectBinaries.values()) { binaries.add((NativeLibraryBinary) nativeBinarySpec); } return binaries; }
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); }
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); }
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); }
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; }
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); }
public DefaultVariant(String name, AttributeContainerInternal parentAttributes, NotationParser<Object, ConfigurablePublishArtifact> artifactNotationParser, FileCollectionFactory fileCollectionFactory) { this.name = name; attributes = new DefaultAttributeContainer(parentAttributes); this.artifactNotationParser = artifactNotationParser; artifacts = new DefaultPublishArtifactSet(name + " artifacts", new DefaultDomainObjectSet<PublishArtifact>(PublishArtifact.class), fileCollectionFactory); }
public DefaultConfiguration(Path identityPath, Path path, String name, ConfigurationsProvider configurationsProvider, ConfigurationResolver resolver, ListenerManager listenerManager, DependencyMetaDataProvider metaDataProvider, ResolutionStrategyInternal resolutionStrategy, ProjectAccessListener projectAccessListener, ProjectFinder projectFinder, ConfigurationComponentMetaDataBuilder configurationComponentMetaDataBuilder, FileCollectionFactory fileCollectionFactory, ComponentIdentifierFactory componentIdentifierFactory, BuildOperationExecutor buildOperationExecutor, Instantiator instantiator, NotationParser<Object, ConfigurablePublishArtifact> artifactNotationParser) { this.identityPath = identityPath; this.path = path; this.name = name; this.configurationsProvider = configurationsProvider; this.resolver = resolver; this.listenerManager = listenerManager; this.metaDataProvider = metaDataProvider; this.resolutionStrategy = resolutionStrategy; this.projectAccessListener = projectAccessListener; this.projectFinder = projectFinder; this.configurationComponentMetaDataBuilder = configurationComponentMetaDataBuilder; this.fileCollectionFactory = fileCollectionFactory; this.componentIdentifierFactory = componentIdentifierFactory; dependencyResolutionListeners = listenerManager.createAnonymousBroadcaster(DependencyResolutionListener.class); this.buildOperationExecutor = buildOperationExecutor; this.instantiator = instantiator; this.artifactNotationParser = artifactNotationParser; DefaultDomainObjectSet<Dependency> ownDependencies = new DefaultDomainObjectSet<Dependency>(Dependency.class); ownDependencies.beforeChange(validateMutationType(this, MutationType.DEPENDENCIES)); final String displayName = getDisplayName(); dependencies = new DefaultDependencySet(displayName + " dependencies", this, ownDependencies); inheritedDependencies = CompositeDomainObjectSet.create(Dependency.class, ownDependencies); allDependencies = new DefaultDependencySet(displayName + " all dependencies", this, inheritedDependencies); DefaultDomainObjectSet<PublishArtifact> ownArtifacts = new DefaultDomainObjectSet<PublishArtifact>(PublishArtifact.class); ownArtifacts.beforeChange(validateMutationType(this, MutationType.ARTIFACTS)); artifacts = new DefaultPublishArtifactSet(displayName + " artifacts", ownArtifacts, fileCollectionFactory); inheritedArtifacts = CompositeDomainObjectSet.create(PublishArtifact.class, ownArtifacts); allArtifacts = new DefaultPublishArtifactSet(displayName + " all artifacts", inheritedArtifacts, fileCollectionFactory); resolutionStrategy.setMutationValidator(this); outgoing = instantiator.newInstance(DefaultConfigurationPublications.class, artifacts, configurationAttributes, instantiator, artifactNotationParser, fileCollectionFactory); }
public DefaultPrebuiltLibrary(String name, SourceDirectorySetFactory sourceDirectorySetFactory) { this.name = name; headers = sourceDirectorySetFactory.create("headers", "headers for prebuilt library '" + name + "'"); binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class); }
/** * 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)); }
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) { this.name = name; headers = new DefaultSourceDirectorySet("headers", fileResolver); binaries = new DefaultDomainObjectSet<NativeLibraryBinary>(NativeLibraryBinary.class); }
public AbstractProjectNativeComponent(NativeProjectComponentIdentifier id) { this.id = id; this.sourceSets = new DefaultDomainObjectSet<LanguageSourceSet>(LanguageSourceSet.class); binaries = new DefaultDomainObjectSet<NativeBinary>(NativeBinary.class); }
public DefaultPrebuiltLibrary(String name, FileResolver fileResolver) { this.name = name; headers = new DefaultSourceDirectorySet("headers", fileResolver); binaries = new DefaultDomainObjectSet<NativeBinary>(NativeBinary.class); }
/** * 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; }
/** * 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; }