本文整理汇总了Java中org.gradle.api.artifacts.ModuleVersionIdentifier类的典型用法代码示例。如果您正苦于以下问题:Java ModuleVersionIdentifier类的具体用法?Java ModuleVersionIdentifier怎么用?Java ModuleVersionIdentifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ModuleVersionIdentifier类属于org.gradle.api.artifacts包,在下文中一共展示了ModuleVersionIdentifier类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: configureUploadArchivesTask
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
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();
Module 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));
}
}
});
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:23,代码来源:MavenPlugin.java
示例2: resolve
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public ModuleVersionIdentifier resolve(ProjectDependency dependency) {
Project dependencyProject = dependency.getDependencyProject();
((ProjectInternal) dependencyProject).evaluate();
PublishingExtension publishing = dependencyProject.getExtensions().findByType(PublishingExtension.class);
if (publishing == null || publishing.getPublications().withType(PublicationInternal.class).isEmpty()) {
// Project does not apply publishing (or has no publications): simply use the project name in place of the dependency name
return new DefaultModuleVersionIdentifier(dependency.getGroup(), dependencyProject.getName(), dependency.getVersion());
}
// See if all publications have the same identifier
Set<? extends PublicationInternal> publications = publishing.getPublications().withType(PublicationInternal.class);
Iterator<? extends PublicationInternal> iterator = publications.iterator();
ModuleVersionIdentifier candidate = iterator.next().getCoordinates();
while (iterator.hasNext()) {
ModuleVersionIdentifier alternative = iterator.next().getCoordinates();
if (!candidate.equals(alternative)) {
throw new UnsupportedOperationException("Publishing is not yet able to resolve a dependency on a project with multiple different publications.");
}
}
return candidate;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:25,代码来源:ProjectDependencyPublicationResolver.java
示例3: collectArtifacts
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
private void collectArtifacts(Configuration configuration,
Map<ModuleVersionIdentifier, List<ResolvedArtifact>> artifacts) {
Set<ResolvedArtifact> allArtifacts;
if (!extraModelInfo.getMode().equals(STANDARD)) {
allArtifacts = configuration.getResolvedConfiguration().getLenientConfiguration().getArtifacts(
Specs.satisfyAll());
} else {
allArtifacts = configuration.getResolvedConfiguration().getResolvedArtifacts();
}
for (ResolvedArtifact artifact : allArtifacts) {
ModuleVersionIdentifier id = artifact.getModuleVersion().getId();
List<ResolvedArtifact> moduleArtifacts = artifacts.get(id);
if (moduleArtifacts == null) {
moduleArtifacts = Lists.newArrayList();
artifacts.put(id, moduleArtifacts);
}
if (!moduleArtifacts.contains(artifact)) {
moduleArtifacts.add(artifact);
}
}
}
开发者ID:alibaba,项目名称:atlas,代码行数:26,代码来源:AtlasDepTreeParser.java
示例4: computeArtifactPath
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
@NonNull
private String computeArtifactPath(
@NonNull ModuleVersionIdentifier moduleVersion,
@NonNull ResolvedArtifact artifact) {
StringBuilder pathBuilder = new StringBuilder(
moduleVersion.getGroup().length()
+ moduleVersion.getName().length()
+ moduleVersion.getVersion().length()
+ 10); // in case of classifier which is rare.
pathBuilder.append(normalize(logger, moduleVersion, moduleVersion.getGroup()))
.append(File.separatorChar)
.append(normalize(logger, moduleVersion, moduleVersion.getName()))
.append(File.separatorChar)
.append(normalize(logger, moduleVersion,
moduleVersion.getVersion()));
if (artifact.getClassifier() != null && !artifact.getClassifier().isEmpty()) {
pathBuilder.append(File.separatorChar).append(normalize(logger, moduleVersion,
artifact.getClassifier()));
}
return pathBuilder.toString();
}
开发者ID:alibaba,项目名称:atlas,代码行数:25,代码来源:DependencyManager.java
示例5: computeArtifactName
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
@NonNull
private static String computeArtifactName(
@NonNull ModuleVersionIdentifier moduleVersion,
@NonNull ResolvedArtifact artifact) {
StringBuilder nameBuilder = new StringBuilder(
moduleVersion.getGroup().length()
+ moduleVersion.getName().length()
+ moduleVersion.getVersion().length()
+ 10); // in case of classifier which is rare.
nameBuilder.append(moduleVersion.getGroup())
.append(':')
.append(moduleVersion.getName())
.append(':')
.append(moduleVersion.getVersion());
if (artifact.getClassifier() != null && !artifact.getClassifier().isEmpty()) {
nameBuilder.append(':').append(artifact.getClassifier());
}
return nameBuilder.toString();
}
开发者ID:alibaba,项目名称:atlas,代码行数:23,代码来源:DependencyManager.java
示例6: getIdeRepoFileDependencies
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
/**
* Gets IDE repository file dependencies.
*
* @param configuration Configuration
* @return IDE repository file dependencies
*/
public List<IdeExtendedRepoFileDependency> getIdeRepoFileDependencies(Configuration configuration) {
ResolutionResult result = getIncomingResolutionResult(configuration);
final Set<ResolvedComponentResult> resolvedRepoFileComponents = CollectionUtils.filter(result.getAllComponents(), new Spec<ResolvedComponentResult>() {
@Override
public boolean isSatisfiedBy(ResolvedComponentResult element) {
return element.getId() instanceof ModuleComponentIdentifier;
}
});
Set<ModuleVersionIdentifier> mappedResolvedDependencies = mapResolvedDependencies(resolvedRepoFileComponents);
Set<ResolvedArtifact> artifacts = getExternalArtifacts(configuration);
List<IdeExtendedRepoFileDependency> externalDependencies = new ArrayList<IdeExtendedRepoFileDependency>();
for (ResolvedArtifact artifact : artifacts) {
if (mappedResolvedDependencies.contains(artifact.getModuleVersion().getId())) {
IdeExtendedRepoFileDependency ideRepoFileDependency = new IdeExtendedRepoFileDependency(artifact.getFile());
ideRepoFileDependency.setId(artifact.getModuleVersion().getId());
externalDependencies.add(ideRepoFileDependency);
}
}
return externalDependencies;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:28,代码来源:DefaultIdeDependencyResolver.java
示例7: computeArtifactPath
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
@NonNull
public static String computeArtifactPath(@NonNull ModuleVersionIdentifier moduleVersion,
@NonNull ResolvedArtifact artifact) {
StringBuilder pathBuilder = new StringBuilder();
pathBuilder.append(normalize(moduleVersion, moduleVersion.getGroup()))
.append("/")
.append(normalize(moduleVersion, moduleVersion.getName()))
.append("/")
.append(normalize(moduleVersion, moduleVersion.getVersion()));
if (artifact.getClassifier() != null && !artifact.getClassifier().isEmpty()) {
pathBuilder.append("/")
.append(normalize(moduleVersion, artifact.getClassifier()));
}
return pathBuilder.toString();
}
开发者ID:alibaba,项目名称:atlas,代码行数:19,代码来源:AtlasDepHelper.java
示例8: computeArtifactName
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
@NonNull
public static String computeArtifactName(@NonNull ModuleVersionIdentifier moduleVersion,
@NonNull ResolvedArtifact artifact) {
StringBuilder nameBuilder = new StringBuilder();
nameBuilder.append(moduleVersion.getGroup())
.append(":")
.append(moduleVersion.getName())
.append(":")
.append(moduleVersion.getVersion());
if (artifact.getClassifier() != null && !artifact.getClassifier().isEmpty()) {
nameBuilder.append(":").append(artifact.getClassifier());
}
return nameBuilder.toString();
}
开发者ID:alibaba,项目名称:atlas,代码行数:18,代码来源:AtlasDepHelper.java
示例9: addResolvedDependencyInfo
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
/**
* A recursive approach to dependency resolution
*
* @param parentDependency
* @param resolvedDependenciesMap
*/
private void addResolvedDependencyInfo(ResolvedDependencyInfo parentDependency,
Multimap<ModuleVersionIdentifier, ResolvedDependencyInfo>
resolvedDependenciesMap) {
int indent = parentDependency.getIndent();
ModuleVersionIdentifier identifier = parentDependency.getModuleVersionIdentifier();
Collection<ResolvedDependencyInfo> childDependencies = resolvedDependenciesMap.get(identifier);
//TODO here
for (ResolvedDependencyInfo childDependency : childDependencies) {
if (childDependency.getIndent() > indent) {
// System.out.println(parentDependency + " indent " + indent + "->" + childDependency
// + " indent " + childDependency.getIndent());
parentDependency.getChildren().add(childDependency);
if (childDependency.getIndent() <= 1) {
addResolvedDependencyInfo(childDependency, resolvedDependenciesMap);
}
}
}
}
开发者ID:alibaba,项目名称:atlas,代码行数:26,代码来源:DependencyResolver.java
示例10: isAwbDependency
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public static boolean isAwbDependency(DependencyResult dependencyResult,
Map<ModuleVersionIdentifier, List<ResolvedArtifact>> artifacts) {
if (dependencyResult instanceof ResolvedDependencyResult) {
ResolvedDependencyResult resolvedDependencyResult = (ResolvedDependencyResult)dependencyResult;
ModuleVersionIdentifier moduleVersionIdentifier = resolvedDependencyResult.getSelected().getModuleVersion();
List<ResolvedArtifact> resolvedArtifacts = artifacts.get(moduleVersionIdentifier);
if (resolvedArtifacts.size() > 0) {
ResolvedArtifact resolvedArtifact = resolvedArtifacts.get(0);
return ("awb".equals(resolvedArtifact.getType()));
}
}
return false;
}
开发者ID:alibaba,项目名称:atlas,代码行数:15,代码来源:DependencyConvertUtils.java
示例11: mustRefreshVersionList
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public boolean mustRefreshVersionList(final ModuleIdentifier moduleIdentifier, Set<ModuleVersionIdentifier> matchingVersions, long ageMillis) {
CachedDependencyResolutionControl dependencyResolutionControl = new CachedDependencyResolutionControl(moduleIdentifier, matchingVersions, ageMillis);
for (Action<? super DependencyResolutionControl> rule : dependencyCacheRules) {
rule.execute(dependencyResolutionControl);
if (dependencyResolutionControl.ruleMatch()) {
return dependencyResolutionControl.mustCheck();
}
}
return false;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:DefaultCachePolicy.java
示例12: mustRefreshModule
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
private boolean mustRefreshModule(ModuleVersionIdentifier moduleVersionId, ResolvedModuleVersion version, long ageMillis, boolean changingModule) {
CachedModuleResolutionControl moduleResolutionControl = new CachedModuleResolutionControl(moduleVersionId, version, changingModule, ageMillis);
for (Action<? super ModuleResolutionControl> rule : moduleCacheRules) {
rule.execute(moduleResolutionControl);
if (moduleResolutionControl.ruleMatch()) {
return moduleResolutionControl.mustCheck();
}
}
return false;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:13,代码来源:DefaultCachePolicy.java
示例13: mustRefreshModuleArtifacts
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public boolean mustRefreshModuleArtifacts(ModuleVersionIdentifier moduleVersionId, Set<ArtifactIdentifier> artifacts,
long ageMillis, boolean belongsToChangingModule, boolean moduleDescriptorInSync) {
if (belongsToChangingModule && !moduleDescriptorInSync) {
return true;
}
return mustRefreshModule(moduleVersionId, new DefaultResolvedModuleVersion(moduleVersionId), ageMillis, belongsToChangingModule);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultCachePolicy.java
示例14: getIdentifier
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
/**
* dependent
* @param identifier
* @return
*/
private String getIdentifier(ModuleVersionIdentifier identifier) {
StringBuilder sb = new StringBuilder();
sb.append(identifier.getGroup()).append(":");
sb.append(identifier.getName()).append(":");
sb.append(identifier.getVersion());
return sb.toString();
}
开发者ID:alibaba,项目名称:atlas,代码行数:13,代码来源:CircleDependencyCheck.java
示例15: DefaultArtifactSet
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public DefaultArtifactSet(ModuleVersionIdentifier ownerId, ModuleSource moduleSource, ModuleExclusion exclusions, Set<? extends VariantMetadata> variants,
ArtifactResolver artifactResolver, Map<ComponentArtifactIdentifier, ResolvedArtifact> allResolvedArtifacts, long id) {
this.moduleVersionIdentifier = ownerId;
this.moduleSource = moduleSource;
this.exclusions = exclusions;
this.variants = variants;
this.artifactResolver = artifactResolver;
this.allResolvedArtifacts = allResolvedArtifacts;
this.id = id;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultArtifactSet.java
示例16: read
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public ComponentResult read(Decoder decoder) throws IOException {
long resultId = decoder.readSmallLong();
ModuleVersionIdentifier id = idSerializer.read(decoder);
ComponentSelectionReason reason = reasonSerializer.read(decoder);
ComponentIdentifier componentId = componentIdSerializer.read(decoder);
return new DefaultComponentResult(resultId, id, reason, componentId);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:ComponentResultSerializer.java
示例17: getVersion
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public ModuleVersionResolveState getVersion(ModuleVersionIdentifier id) {
ModuleVersionResolveState moduleRevision = versions.get(id);
if (moduleRevision == null) {
moduleRevision = new ModuleVersionResolveState(idGenerator.generateId(), this, id, metaDataResolver);
versions.put(id, moduleRevision);
}
return moduleRevision;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:10,代码来源:DependencyGraphBuilder.java
示例18: DefaultResolvedArtifact
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public DefaultResolvedArtifact(ModuleVersionIdentifier owner, IvyArtifactName artifact, ComponentArtifactIdentifier artifactId, TaskDependency buildDependencies, Factory<File> artifactSource) {
this.owner = owner;
this.artifact = artifact;
this.artifactId = artifactId;
this.buildDependencies = buildDependencies;
this.artifactSource = artifactSource;
this.attributes = DefaultArtifactAttributes.forIvyArtifactName(artifact);
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:9,代码来源:DefaultResolvedArtifact.java
示例19: toRootComponentMetaData
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public ComponentResolveMetadata toRootComponentMetaData() {
Module module = getModule();
ComponentIdentifier componentIdentifier = componentIdentifierFactory.createComponentIdentifier(module);
ModuleVersionIdentifier moduleVersionIdentifier = DefaultModuleVersionIdentifier.newId(module);
ProjectInternal project = projectFinder.findProject(module.getProjectPath());
AttributesSchema schema = project == null ? null : project.getAttributesSchema();
DefaultLocalComponentMetadata metaData = new DefaultLocalComponentMetadata(moduleVersionIdentifier, componentIdentifier, module.getStatus(), schema);
configurationComponentMetaDataBuilder.addConfigurations(metaData, configurationsProvider.getAll());
return metaData;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:11,代码来源:DefaultConfiguration.java
示例20: DefaultArtifactIdentifier
import org.gradle.api.artifacts.ModuleVersionIdentifier; //导入依赖的package包/类
public DefaultArtifactIdentifier(ModuleVersionIdentifier moduleVersionIdentifier, String name, String type, String extension, String classifier) {
this.moduleVersionIdentifier = moduleVersionIdentifier;
this.name = name;
this.type = type;
this.extension = extension;
this.classifier = classifier;
}
开发者ID:lxxlxx888,项目名称:Reer,代码行数:8,代码来源:DefaultArtifactIdentifier.java
注:本文中的org.gradle.api.artifacts.ModuleVersionIdentifier类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论