org.gradle.api.internal.artifacts.configurations.ConfigurationInternal Java Examples
The following examples show how to use
org.gradle.api.internal.artifacts.configurations.ConfigurationInternal.
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: BasePlugin.java From javaide with GNU General Public License v3.0 | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } boolean hasIvyRepo = !uploadArchives.getRepositories().withType(IvyArtifactRepository.class).isEmpty(); if (!hasIvyRepo) { return; } // Maven repos are handled by MavenPlugin ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); Module module = configuration.getModule(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(module.getGroup(), module.getName(), module.getVersion()); publicationRegistry.registerPublication(module.getProjectPath(), new DefaultProjectPublication(publicationId)); } }); }
Example #2
Source File: BasePlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } boolean hasIvyRepo = !uploadArchives.getRepositories().withType(IvyArtifactRepository.class).isEmpty(); if (!hasIvyRepo) { return; } // Maven repos are handled by MavenPlugin ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(module.getGroup(), module.getName(), module.getVersion()); publicationRegistry.registerPublication(module.getProjectPath(), new DefaultProjectPublication(publicationId)); } }); }
Example #3
Source File: MavenPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) { MavenPom pom = resolver.getPom(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier( pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(), pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(), pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion() ); publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId)); } } }); }
Example #4
Source File: BasePlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } boolean hasIvyRepo = !uploadArchives.getRepositories().withType(IvyArtifactRepository.class).isEmpty(); if (!hasIvyRepo) { return; } // Maven repos are handled by MavenPlugin ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(module.getGroup(), module.getName(), module.getVersion()); publicationRegistry.registerPublication(module.getProjectPath(), new DefaultProjectPublication(publicationId)); } }); }
Example #5
Source File: PluginResolutionServiceResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
private ClassPath resolvePluginDependencies(final PluginUseMetaData metadata) { DependencyResolutionServices resolution = dependencyResolutionServicesFactory.create(); RepositoryHandler repositories = resolution.getResolveRepositoryHandler(); final String repoUrl = metadata.implementation.get("repo"); repositories.maven(new Action<MavenArtifactRepository>() { public void execute(MavenArtifactRepository mavenArtifactRepository) { mavenArtifactRepository.setUrl(repoUrl); } }); Dependency dependency = resolution.getDependencyHandler().create(metadata.implementation.get("gav")); ConfigurationContainerInternal configurations = (ConfigurationContainerInternal) resolution.getConfigurationContainer(); ConfigurationInternal configuration = configurations.detachedConfiguration(dependency); try { Set<File> files = configuration.getResolvedConfiguration().getFiles(Specs.satisfyAll()); return new DefaultClassPath(files); } catch (ResolveException e) { throw new DependencyResolutionException("Failed to resolve all plugin dependencies from " + repoUrl, e.getCause()); } }
Example #6
Source File: MavenPlugin.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) { MavenPom pom = resolver.getPom(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier( pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(), pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(), pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion() ); publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId)); } } }); }
Example #7
Source File: MavenPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) { MavenPom pom = resolver.getPom(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier( pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(), pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(), pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion() ); publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId)); } } }); }
Example #8
Source File: BasePlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } boolean hasIvyRepo = !uploadArchives.getRepositories().withType(IvyArtifactRepository.class).isEmpty(); if (!hasIvyRepo) { return; } // Maven repos are handled by MavenPlugin ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(module.getGroup(), module.getName(), module.getVersion()); publicationRegistry.registerPublication(module.getProjectPath(), new DefaultProjectPublication(publicationId)); } }); }
Example #9
Source File: MavenPlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(BasePlugin.UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); for (MavenResolver resolver : uploadArchives.getRepositories().withType(MavenResolver.class)) { MavenPom pom = resolver.getPom(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier( pom.getGroupId().equals(MavenProject.EMPTY_PROJECT_GROUP_ID) ? module.getGroup() : pom.getGroupId(), pom.getArtifactId().equals(MavenProject.EMPTY_PROJECT_ARTIFACT_ID) ? module.getName() : pom.getArtifactId(), pom.getVersion().equals(MavenProject.EMPTY_PROJECT_VERSION) ? module.getVersion() : pom.getVersion() ); publicationRegistry.registerPublication(project.getPath(), new DefaultProjectPublication(publicationId)); } } }); }
Example #10
Source File: BasePlugin.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
private void configureUploadArchivesTask() { configurationActionContainer.add(new Action<Project>() { public void execute(Project project) { Upload uploadArchives = project.getTasks().withType(Upload.class).findByName(UPLOAD_ARCHIVES_TASK_NAME); if (uploadArchives == null) { return; } boolean hasIvyRepo = !uploadArchives.getRepositories().withType(IvyArtifactRepository.class).isEmpty(); if (!hasIvyRepo) { return; } // Maven repos are handled by MavenPlugin ConfigurationInternal configuration = (ConfigurationInternal) uploadArchives.getConfiguration(); ModuleInternal module = configuration.getModule(); ModuleVersionIdentifier publicationId = new DefaultModuleVersionIdentifier(module.getGroup(), module.getName(), module.getVersion()); publicationRegistry.registerPublication(module.getProjectPath(), new DefaultProjectPublication(publicationId)); } }); }
Example #11
Source File: PluginResolutionServiceResolver.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
private ClassPath resolvePluginDependencies(final PluginUseMetaData metadata) { DependencyResolutionServices resolution = dependencyResolutionServicesFactory.create(); RepositoryHandler repositories = resolution.getResolveRepositoryHandler(); final String repoUrl = metadata.implementation.get("repo"); repositories.maven(new Action<MavenArtifactRepository>() { public void execute(MavenArtifactRepository mavenArtifactRepository) { mavenArtifactRepository.setUrl(repoUrl); } }); Dependency dependency = resolution.getDependencyHandler().create(metadata.implementation.get("gav")); ConfigurationContainerInternal configurations = (ConfigurationContainerInternal) resolution.getConfigurationContainer(); ConfigurationInternal configuration = configurations.detachedConfiguration(dependency); try { Set<File> files = configuration.getResolvedConfiguration().getFiles(Specs.satisfyAll()); return new DefaultClassPath(files); } catch (ResolveException e) { throw new DependencyResolutionException("Failed to resolve all plugin dependencies from " + repoUrl, e.getCause()); } }
Example #12
Source File: SelfResolvingDependencyResolver.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler, ResolverResults results) throws ResolveException { resolver.resolve(configuration, repositories, metadataHandler, results); ResolvedConfiguration resolvedConfiguration = results.getResolvedConfiguration(); Set<Dependency> dependencies = configuration.getAllDependencies(); CachingDependencyResolveContext resolveContext = new CachingDependencyResolveContext(configuration.isTransitive()); SelfResolvingFilesProvider provider = new SelfResolvingFilesProvider(resolveContext, dependencies); results.withResolvedConfiguration(new FilesAggregatingResolvedConfiguration(resolvedConfiguration, provider)); }
Example #13
Source File: CacheLockingArtifactDependencyResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(final ConfigurationInternal configuration, final List<? extends ResolutionAwareRepository> repositories, final ModuleMetadataProcessor metadataProcessor, final ResolverResults results) throws ResolveException { lockingManager.useCache(String.format("resolve %s", configuration), new Runnable() { public void run() { resolver.resolve(configuration, repositories, metadataProcessor, results); } }); }
Example #14
Source File: ShortcircuitEmptyConfigsArtifactDependencyResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, List<? extends ResolutionAwareRepository> repositories, ModuleMetadataProcessor metadataProcessor, ResolverResults results) throws ResolveException { if (configuration.getAllDependencies().isEmpty()) { ModuleVersionIdentifier id = DefaultModuleVersionIdentifier.newId(configuration.getModule()); ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(configuration.getModule()); ResolutionResult emptyResult = new DefaultResolutionResultBuilder().start(id, componentIdentifier).complete(); results.resolved(new EmptyResolvedConfiguration(), emptyResult); } else { dependencyResolver.resolve(configuration, repositories, metadataProcessor, results); } }
Example #15
Source File: SelfResolvingDependencyResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, List<? extends ResolutionAwareRepository> repositories, ModuleMetadataProcessor metadataProcessor, ResolverResults results) throws ResolveException { resolver.resolve(configuration, repositories, metadataProcessor, results); ResolvedConfiguration resolvedConfiguration = results.getResolvedConfiguration(); Set<Dependency> dependencies = configuration.getAllDependencies(); CachingDependencyResolveContext resolveContext = new CachingDependencyResolveContext(configuration.isTransitive()); SelfResolvingFilesProvider provider = new SelfResolvingFilesProvider(resolveContext, dependencies); results.withResolvedConfiguration(new FilesAggregatingResolvedConfiguration(resolvedConfiguration, provider)); }
Example #16
Source File: CacheLockingArtifactDependencyResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(final ConfigurationInternal configuration, final List<? extends ResolutionAwareRepository> repositories, final GlobalDependencyResolutionRules metadataHandler, final ResolverResults results) throws ResolveException { lockingManager.useCache(String.format("resolve %s", configuration), new Runnable() { public void run() { resolver.resolve(configuration, repositories, metadataHandler, results); } }); }
Example #17
Source File: ErrorHandlingArtifactDependencyResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler, ResolverResults results) throws ResolveException { try { dependencyResolver.resolve(configuration, repositories, metadataHandler, results); } catch (final Throwable e) { results.failed(new BrokenResolvedConfiguration(e, configuration), wrapException(e, configuration)); return; } ResolvedConfiguration wrappedConfiguration = new ErrorHandlingResolvedConfiguration(results.getResolvedConfiguration(), configuration); ResolutionResult wrappedResult = new ErrorHandlingResolutionResult(results.getResolutionResult(), configuration); results.resolved(wrappedConfiguration, wrappedResult); }
Example #18
Source File: DefaultArtifactResolutionQuery.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public ArtifactResolutionResult execute() { if (componentType == null) { throw new IllegalStateException("Must specify component type and artifacts to query."); } List<ResolutionAwareRepository> repositories = CollectionUtils.collect(repositoryHandler, Transformers.cast(ResolutionAwareRepository.class)); ConfigurationInternal configuration = configurationContainer.detachedConfiguration(); final RepositoryChain repositoryChain = ivyFactory.create(configuration, repositories, metadataHandler.getComponentMetadataProcessor()); final ArtifactResolver artifactResolver = new ErrorHandlingArtifactResolver(repositoryChain.getArtifactResolver()); return lockingManager.useCache("resolve artifacts", new Factory<ArtifactResolutionResult>() { public ArtifactResolutionResult create() { Set<ComponentResult> componentResults = Sets.newHashSet(); for (ComponentIdentifier componentId : componentIds) { if (!(componentId instanceof ModuleComponentIdentifier)) { throw new IllegalArgumentException(String.format("Cannot resolve the artifacts for component %s with unsupported type %s.", componentId.getDisplayName(), componentId.getClass().getName())); } ModuleComponentIdentifier moduleComponentId = (ModuleComponentIdentifier) componentId; try { componentResults.add(buildComponentResult(moduleComponentId, repositoryChain, artifactResolver)); } catch (Throwable t) { componentResults.add(new DefaultUnresolvedComponentResult(moduleComponentId, t)); } } return new DefaultArtifactResolutionResult(componentResults); } }); }
Example #19
Source File: ResolveIvyFactory.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public RepositoryChain create(ConfigurationInternal configuration, Iterable<? extends ResolutionAwareRepository> repositories, ModuleMetadataProcessor metadataProcessor) { ResolutionRules resolutionRules = configuration.getResolutionStrategy().getResolutionRules(); CachePolicy cachePolicy = configuration.getResolutionStrategy().getCachePolicy(); startParameterResolutionOverride.addResolutionRules(resolutionRules); UserResolverChain userResolverChain = new UserResolverChain(versionMatcher, latestStrategy); RepositoryChain parentLookupResolver = new ParentModuleLookupResolver(userResolverChain, cacheLockingManager); for (ResolutionAwareRepository repository : repositories) { ConfiguredModuleVersionRepository moduleVersionRepository = repository.createResolver(); if (moduleVersionRepository instanceof IvyAwareModuleVersionRepository) { ivyContextualize((IvyAwareModuleVersionRepository) moduleVersionRepository, userResolverChain, configuration.getName()); } if (moduleVersionRepository instanceof ExternalResourceResolver) { ((ExternalResourceResolver) moduleVersionRepository).setRepositoryChain(parentLookupResolver); } LocalAwareModuleVersionRepository localAwareRepository; if (moduleVersionRepository.isLocal()) { localAwareRepository = new LocalModuleVersionRepository(moduleVersionRepository, metadataProcessor); } else { LocalArtifactsModuleVersionRepository wrapperRepository = new CacheLockingModuleVersionRepository(moduleVersionRepository, cacheLockingManager); wrapperRepository = startParameterResolutionOverride.overrideModuleVersionRepository(wrapperRepository); localAwareRepository = new CachingModuleVersionRepository(wrapperRepository, moduleVersionsCache, moduleMetaDataCache, moduleArtifactsCache, artifactAtRepositoryCachedResolutionIndex, cachePolicy, timeProvider, metadataProcessor, getModuleExtractor(moduleVersionRepository)); } if (moduleVersionRepository.isDynamicResolveMode()) { localAwareRepository = new IvyDynamicResolveModuleVersionRepository(localAwareRepository); } localAwareRepository = inMemoryCache.cached(localAwareRepository); userResolverChain.add(localAwareRepository); } return userResolverChain; }
Example #20
Source File: SelfResolvingDependencyResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler, ResolverResults results) throws ResolveException { resolver.resolve(configuration, repositories, metadataHandler, results); ResolvedConfiguration resolvedConfiguration = results.getResolvedConfiguration(); Set<Dependency> dependencies = configuration.getAllDependencies(); CachingDependencyResolveContext resolveContext = new CachingDependencyResolveContext(configuration.isTransitive()); SelfResolvingFilesProvider provider = new SelfResolvingFilesProvider(resolveContext, dependencies); results.withResolvedConfiguration(new FilesAggregatingResolvedConfiguration(resolvedConfiguration, provider)); }
Example #21
Source File: ShortcircuitEmptyConfigsArtifactDependencyResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler, ResolverResults results) throws ResolveException { if (configuration.getAllDependencies().isEmpty()) { ModuleVersionIdentifier id = DefaultModuleVersionIdentifier.newId(configuration.getModule()); ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(configuration.getModule()); ResolutionResult emptyResult = new DefaultResolutionResultBuilder().start(id, componentIdentifier).complete(); results.resolved(new EmptyResolvedConfiguration(), emptyResult); } else { dependencyResolver.resolve(configuration, repositories, metadataHandler, results); } }
Example #22
Source File: DependencyGraphBuilder.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, ResolutionResultBuilder newModelBuilder, ResolvedConfigurationBuilder oldModelBuilder) throws ResolveException { DependencyGraphVisitor oldModelVisitor = new ResolvedConfigurationDependencyGraphVisitor(oldModelBuilder, artifactResolver); DependencyGraphVisitor newModelVisitor = new ResolutionResultDependencyGraphVisitor(newModelBuilder); DependencyGraphVisitor modelVisitor = new CompositeDependencyGraphVisitor(oldModelVisitor, newModelVisitor); resolveDependencyGraph(configuration, modelVisitor); }
Example #23
Source File: DependencyGraphBuilder.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private void resolveDependencyGraph(ConfigurationInternal configuration, DependencyGraphVisitor modelVisitor) { DefaultBuildableComponentResolveResult rootModule = new DefaultBuildableComponentResolveResult(); moduleResolver.resolve(configuration.getModule(), configuration.getAll(), rootModule); ResolveState resolveState = new ResolveState(rootModule, configuration.getName(), idResolver, metaDataResolver, dependencyToConfigurationResolver, artifactResolver); conflictHandler.registerResolver(new DirectDependencyForcingResolver(resolveState.root.moduleRevision)); traverseGraph(resolveState, conflictHandler); assembleResult(resolveState, modelVisitor); }
Example #24
Source File: DefaultArtifactResolutionQuery.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public ArtifactResolutionResult execute() { if (componentType == null) { throw new IllegalStateException("Must specify component type and artifacts to query."); } List<ResolutionAwareRepository> repositories = CollectionUtils.collect(repositoryHandler, Transformers.cast(ResolutionAwareRepository.class)); ConfigurationInternal configuration = configurationContainer.detachedConfiguration(); final RepositoryChain repositoryChain = ivyFactory.create(configuration, repositories, metadataHandler.getComponentMetadataProcessor()); final ArtifactResolver artifactResolver = new ErrorHandlingArtifactResolver(repositoryChain.getArtifactResolver()); return lockingManager.useCache("resolve artifacts", new Factory<ArtifactResolutionResult>() { public ArtifactResolutionResult create() { Set<ComponentResult> componentResults = Sets.newHashSet(); for (ComponentIdentifier componentId : componentIds) { if (!(componentId instanceof ModuleComponentIdentifier)) { throw new IllegalArgumentException(String.format("Cannot resolve the artifacts for component %s with unsupported type %s.", componentId.getDisplayName(), componentId.getClass().getName())); } ModuleComponentIdentifier moduleComponentId = (ModuleComponentIdentifier) componentId; try { componentResults.add(buildComponentResult(moduleComponentId, repositoryChain, artifactResolver)); } catch (Throwable t) { componentResults.add(new DefaultUnresolvedComponentResult(moduleComponentId, t)); } } return new DefaultArtifactResolutionResult(componentResults); } }); }
Example #25
Source File: ErrorHandlingArtifactDependencyResolver.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, List<? extends ResolutionAwareRepository> repositories, ModuleMetadataProcessor metadataProcessor, ResolverResults results) throws ResolveException { try { dependencyResolver.resolve(configuration, repositories, metadataProcessor, results); } catch (final Throwable e) { results.failed(new BrokenResolvedConfiguration(e, configuration), wrapException(e, configuration)); return; } ResolvedConfiguration wrappedConfiguration = new ErrorHandlingResolvedConfiguration(results.getResolvedConfiguration(), configuration); ResolutionResult wrappedResult = new ErrorHandlingResolutionResult(results.getResolutionResult(), configuration); results.resolved(wrappedConfiguration, wrappedResult); }
Example #26
Source File: Upload.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
@TaskAction protected void upload() { getLogger().info("Publishing configuration: " + configuration); ModuleInternal module = ((ConfigurationInternal) configuration).getModule(); ArtifactPublisher artifactPublisher = getPublicationServices().createArtifactPublisher(); File descriptorDestination = isUploadDescriptor() ? getDescriptorDestination() : null; List<PublicationAwareRepository> publishRepositories = collect(getRepositories(), Transformers.cast(PublicationAwareRepository.class)); try { artifactPublisher.publish(publishRepositories, module, configuration, descriptorDestination); } catch (Exception e) { throw new PublishException(String.format("Could not publish configuration '%s'", configuration.getName()), e); } }
Example #27
Source File: ErrorHandlingArtifactDependencyResolver.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler, ResolverResults results) throws ResolveException { try { dependencyResolver.resolve(configuration, repositories, metadataHandler, results); } catch (final Throwable e) { results.failed(new BrokenResolvedConfiguration(e, configuration), wrapException(e, configuration)); return; } ResolvedConfiguration wrappedConfiguration = new ErrorHandlingResolvedConfiguration(results.getResolvedConfiguration(), configuration); ResolutionResult wrappedResult = new ErrorHandlingResolutionResult(results.getResolutionResult(), configuration); results.resolved(wrappedConfiguration, wrappedResult); }
Example #28
Source File: CacheLockingArtifactDependencyResolver.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(final ConfigurationInternal configuration, final List<? extends ResolutionAwareRepository> repositories, final GlobalDependencyResolutionRules metadataHandler, final ResolverResults results) throws ResolveException { lockingManager.useCache(String.format("resolve %s", configuration), new Runnable() { public void run() { resolver.resolve(configuration, repositories, metadataHandler, results); } }); }
Example #29
Source File: Upload.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
@TaskAction protected void upload() { getLogger().info("Publishing configuration: " + configuration); ModuleInternal module = ((ConfigurationInternal) configuration).getModule(); ArtifactPublisher artifactPublisher = publicationServices.createArtifactPublisher(); File descriptorDestination = isUploadDescriptor() ? getDescriptorDestination() : null; List<PublicationAwareRepository> publishRepositories = collect(repositories, Transformers.cast(PublicationAwareRepository.class)); try { artifactPublisher.publish(publishRepositories, module, configuration, descriptorDestination); } catch (Exception e) { throw new PublishException(String.format("Could not publish configuration '%s'", configuration.getName()), e); } }
Example #30
Source File: DependencyGraphBuilder.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
public void resolve(ConfigurationInternal configuration, ResolutionResultBuilder newModelBuilder, ResolvedConfigurationBuilder oldModelBuilder) throws ResolveException { DefaultBuildableComponentResolveResult rootModule = new DefaultBuildableComponentResolveResult(); moduleResolver.resolve(configuration.getModule(), configuration.getAll(), rootModule); ResolveState resolveState = new ResolveState(rootModule, configuration.getName(), dependencyResolver, dependencyToConfigurationResolver, artifactResolver, oldModelBuilder); traverseGraph(resolveState); assembleResult(resolveState, oldModelBuilder, newModelBuilder); }