當前位置: 首頁>>代碼示例>>Java>>正文


Java MutableModuleComponentResolveMetaData類代碼示例

本文整理匯總了Java中org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData的典型用法代碼示例。如果您正苦於以下問題:Java MutableModuleComponentResolveMetaData類的具體用法?Java MutableModuleComponentResolveMetaData怎麽用?Java MutableModuleComponentResolveMetaData使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MutableModuleComponentResolveMetaData類屬於org.gradle.internal.component.external.model包,在下文中一共展示了MutableModuleComponentResolveMetaData類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: resolveComponentMetaData

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
public void resolveComponentMetaData(DependencyMetaData dependency, ModuleComponentIdentifier moduleComponentIdentifier, BuildableModuleComponentMetaDataResolveResult result) {
    DependencyMetaData forced = dependency.withChanging();
    delegate.getRemoteAccess().resolveComponentMetaData(forced, moduleComponentIdentifier, result);
    switch (result.getState()) {
        case Missing:
            moduleMetaDataCache.cacheMissing(delegate, moduleComponentIdentifier);
            break;
        case Resolved:
            MutableModuleComponentResolveMetaData metaData = result.getMetaData();
            ModuleSource moduleSource = metaData.getSource();
            ModuleMetaDataCache.CachedMetaData cachedMetaData = moduleMetaDataCache.cacheMetaData(delegate, metaData);
            metadataProcessor.processMetadata(metaData);
            moduleSource = new CachingModuleSource(cachedMetaData.getDescriptorHash(), dependency.isChanging() || metaData.isChanging(), moduleSource);
            metaData.setSource(moduleSource);
            result.resolved(metaData);
            break;
        case Failed:
            break;
        default:
            throw new IllegalStateException("Unexpected resolve state: " + result.getState());
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:23,代碼來源:CachingModuleComponentRepository.java

示例2: apply

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
public void apply(ComponentSelectionInternal selection, Collection<SpecRuleAction<? super ComponentSelection>> specRuleActions, Factory<? extends MutableModuleComponentResolveMetaData> metaDataSupplier) {
    MetadataProvider metadataProvider = new MetadataProvider(metaDataSupplier);

    List<SpecRuleAction<? super ComponentSelection>> noInputRules = Lists.newArrayList();
    List<SpecRuleAction<? super ComponentSelection>> inputRules = Lists.newArrayList();
    for (SpecRuleAction<? super ComponentSelection> specRuleAction : specRuleActions) {
        if (specRuleAction.getAction().getInputTypes().isEmpty()) {
            noInputRules.add(specRuleAction);
        } else {
            inputRules.add(specRuleAction);
        }
    }

    if (processRules(noInputRules, selection, metadataProvider)) {
        processRules(inputRules, selection, metadataProvider);
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:18,代碼來源:ComponentSelectionRulesProcessor.java

示例3: resolve

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
public void resolve(DependencyMetaData dependency, ComponentIdentifier identifier, BuildableComponentResolveResult result) {
    resolver.resolve(dependency, identifier, result);

    if (result.getFailure() != null) {
        return;
    }
    if (dependency instanceof DslOriginDependencyMetaData) {
        ModuleDependency maybeClientModule = ((DslOriginDependencyMetaData) dependency).getSource();
        if (maybeClientModule instanceof ClientModule) {
            ClientModule clientModule = (ClientModule) maybeClientModule;

            MutableModuleComponentResolveMetaData clientModuleMetaData = ((MutableModuleComponentResolveMetaData)result.getMetaData()).copy();
            addClientModuleDependencies(clientModule, clientModuleMetaData);

            setClientModuleArtifact(clientModuleMetaData);

            result.setMetaData(clientModuleMetaData);
        }
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:21,代碼來源:ClientModuleResolver.java

示例4: transformDependencies

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
private void transformDependencies(BuildableModuleComponentMetaDataResolveResult result) {
    MutableModuleComponentResolveMetaData metaData = result.getMetaData();
    List<DependencyMetaData> transformed = new ArrayList<DependencyMetaData>();
    for (DependencyMetaData dependency : metaData.getDependencies()) {
        transformed.add(dependency.withRequestedVersion(dependency.getDescriptor().getDynamicConstraintDependencyRevisionId().getRevision()));
    }
    metaData.setDependencies(transformed);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:9,代碼來源:IvyDynamicResolveModuleComponentRepositoryAccess.java

示例5: doParseDescriptorWithProvidedParser

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
private MutableModuleComponentResolveMetaData doParseDescriptorWithProvidedParser(Parser parser, boolean validate) throws IOException, ParseException {
    parser.setValidate(validate);
    parser.parse();
    DefaultModuleDescriptor moduleDescriptor = parser.getModuleDescriptor();
    postProcess(moduleDescriptor);

    return parser.getMetaData();
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:9,代碼來源:IvyXmlModuleDescriptorParser.java

示例6: doParseDescriptor

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
protected MutableModuleComponentResolveMetaData doParseDescriptor(DescriptorParseContext parserSettings, LocallyAvailableExternalResource resource, boolean validate) throws IOException, ParseException, SAXException {
    PomReader pomReader = new PomReader(resource);
    GradlePomModuleDescriptorBuilder mdBuilder = new GradlePomModuleDescriptorBuilder(pomReader);

    doParsePom(parserSettings, mdBuilder, pomReader);

    DefaultModuleDescriptor moduleDescriptor = mdBuilder.getModuleDescriptor();
    if(pomReader.getRelocation() != null) {
        return new DefaultMavenModuleResolveMetaData(moduleDescriptor, "pom", true);
    }
    return new DefaultMavenModuleResolveMetaData(moduleDescriptor, pomReader.getPackaging(), false);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:13,代碼來源:GradlePomModuleDescriptorParser.java

示例7: resolveComponentMetaDataFromCache

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
private void resolveComponentMetaDataFromCache(DependencyMetaData dependency, ModuleComponentIdentifier moduleComponentIdentifier, BuildableModuleComponentMetaDataResolveResult result) {
    ModuleMetaDataCache.CachedMetaData cachedMetaData = moduleMetaDataCache.getCachedModuleDescriptor(delegate, moduleComponentIdentifier);
    if (cachedMetaData == null) {
        return;
    }
    if (cachedMetaData.isMissing()) {
        if (cachePolicy.mustRefreshMissingModule(moduleComponentIdentifier, cachedMetaData.getAgeMillis())) {
            LOGGER.debug("Cached meta-data for missing module is expired: will perform fresh resolve of '{}' in '{}'", moduleComponentIdentifier, delegate.getName());
            return;
        }
        LOGGER.debug("Detected non-existence of module '{}' in resolver cache '{}'", moduleComponentIdentifier, delegate.getName());
        result.missing();
        // When age == 0, verified since the start of this build, assume still missing
        result.setAuthoritative(cachedMetaData.getAgeMillis() == 0);
        return;
    }
    MutableModuleComponentResolveMetaData metaData = cachedMetaData.getMetaData();
    metadataProcessor.processMetadata(metaData);
    if (dependency.isChanging() || metaData.isChanging()) {
        if (cachePolicy.mustRefreshChangingModule(moduleComponentIdentifier, cachedMetaData.getModuleVersion(), cachedMetaData.getAgeMillis())) {
            LOGGER.debug("Cached meta-data for changing module is expired: will perform fresh resolve of '{}' in '{}'", moduleComponentIdentifier, delegate.getName());
            return;
        }
        LOGGER.debug("Found cached version of changing module '{}' in '{}'", moduleComponentIdentifier, delegate.getName());
    } else {
        if (cachePolicy.mustRefreshModule(moduleComponentIdentifier, cachedMetaData.getModuleVersion(), cachedMetaData.getAgeMillis())) {
            LOGGER.debug("Cached meta-data for module must be refreshed: will perform fresh resolve of '{}' in '{}'", moduleComponentIdentifier, delegate.getName());
            return;
        }
    }

    LOGGER.debug("Using cached module metadata for module '{}' in '{}'", moduleComponentIdentifier, delegate.getName());
    metaData.setSource(new CachingModuleSource(cachedMetaData.getDescriptorHash(), metaData.isChanging(), metaData.getSource()));
    result.resolved(metaData);
    // When age == 0, verified since the start of this build, assume the meta-data hasn't changed
    result.setAuthoritative(cachedMetaData.getAgeMillis() == 0);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:38,代碼來源:CachingModuleComponentRepository.java

示例8: addClientModuleDependencies

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
private void addClientModuleDependencies(ClientModule clientModule, MutableModuleComponentResolveMetaData clientModuleMetaData) {
    List<DependencyMetaData> dependencies = Lists.newArrayList();
    for (ModuleDependency moduleDependency : clientModule.getDependencies()) {
        DependencyMetaData dependencyMetaData = dependencyDescriptorFactory.createDependencyDescriptor(moduleDependency.getConfiguration(), clientModuleMetaData.getDescriptor(), moduleDependency);
        dependencies.add(dependencyMetaData);
    }
    clientModuleMetaData.setDependencies(dependencies);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:9,代碼來源:ClientModuleResolver.java

示例9: processMetadata

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
public void processMetadata(MutableModuleComponentResolveMetaData metadata) {
    ComponentMetadataDetails details = instantiator.newInstance(ComponentMetadataDetailsAdapter.class, metadata);
    ruleActions.execute(details);
    executeRuleClosures(metadata, details);
    if (!metadata.getStatusScheme().contains(metadata.getStatus())) {
        throw new ModuleVersionResolveException(metadata.getId(), "Unexpected status '" + metadata.getStatus() + "' specified for %s. Expected one of: " +  metadata.getStatusScheme());
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:9,代碼來源:DefaultComponentMetadataHandler.java

示例10: parseMetaDataFromArtifact

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
@Override
@Nullable
protected MutableModuleComponentResolveMetaData parseMetaDataFromArtifact(ModuleComponentIdentifier moduleComponentIdentifier, ExternalResourceArtifactResolver artifactResolver, ResourceAwareResolveResult result) {
    MutableModuleComponentResolveMetaData metaData = super.parseMetaDataFromArtifact(moduleComponentIdentifier, artifactResolver, result);
    if (metaData == null) {
        return null;
    }

    if (isOrphanedPom(mavenMetaData(metaData), artifactResolver)) {
        return null;
    }
    return metaData;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:14,代碼來源:MavenLocalResolver.java

示例11: validateMetadata

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
private void validateMetadata(IvyNormalizedPublication publication) {
    IvyPublicationIdentity identity = publication.getProjectIdentity();

    IvyFieldValidator organisation = field(publication, "organisation", identity.getOrganisation())
            .notEmpty()
            .validInFileName();
    IvyFieldValidator moduleName = field(publication, "module name", identity.getModule())
            .notEmpty()
            .validInFileName();
    IvyFieldValidator revision = field(publication, "revision", identity.getRevision())
            .notEmpty()
            .validInFileName();

    MutableModuleComponentResolveMetaData metadata = parseIvyFile(publication);
    ModuleVersionIdentifier moduleId = metadata.getId();
    organisation.matches(moduleId.getGroup());
    moduleName.matches(moduleId.getName());
    revision.matches(moduleId.getVersion());

    field(publication, "branch", metadata.getDescriptor().getModuleRevisionId().getBranch())
            .optionalNotEmpty()
            .doesNotContainSpecialCharacters(true);

    field(publication, "status", metadata.getStatus())
            .optionalNotEmpty()
            .validInFileName();
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:28,代碼來源:ValidatingIvyPublisher.java

示例12: parseIvyFile

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
private MutableModuleComponentResolveMetaData parseIvyFile(IvyNormalizedPublication publication) {
    try {
        return moduleDescriptorParser.parseMetaData(parserSettings, publication.getDescriptorFile());
    } catch (MetaDataParseException pe) {
        throw new InvalidIvyPublicationException(publication.getName(), pe.getLocalizedMessage(), pe);
    }
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:8,代碼來源:ValidatingIvyPublisher.java

示例13: RepositoryChainModuleResolution

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
public RepositoryChainModuleResolution(ModuleComponentRepository repository, MutableModuleComponentResolveMetaData module) {
    this.repository = repository;
    this.module = module;
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:5,代碼來源:RepositoryChainModuleResolution.java

示例14: isRejectedByRules

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
public boolean isRejectedByRules(ModuleComponentIdentifier candidateIdentifier, Factory<? extends MutableModuleComponentResolveMetaData> metaDataSupplier) {
    return isRejectedByRules(candidateIdentifier, componentSelectionRules.getRules(), metaDataSupplier);
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:4,代碼來源:NewestVersionComponentChooser.java

示例15: create

import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData; //導入依賴的package包/類
public MutableModuleComponentResolveMetaData create() {
    DefaultBuildableModuleComponentMetaDataResolveResult result = new DefaultBuildableModuleComponentMetaDataResolveResult();
    repository.resolveComponentMetaData(dependency.withRequestedVersion(id.getVersion()), id, result);
    return result.getMetaData();
}
 
開發者ID:Pushjet,項目名稱:Pushjet-Android,代碼行數:6,代碼來源:NewestVersionComponentChooser.java


注:本文中的org.gradle.internal.component.external.model.MutableModuleComponentResolveMetaData類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。