org.gradle.api.artifacts.ResolvedModuleVersion Java Examples

The following examples show how to use org.gradle.api.artifacts.ResolvedModuleVersion. 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: DependencyTaskTest.java    From play-services-plugins with Apache License 2.0 6 votes vote down vote up
private ResolvedArtifact prepareArtifact(
    String name, String group, String filePath, String version) {
  ModuleVersionIdentifier moduleId = mock(ModuleVersionIdentifier.class);
  when(moduleId.getGroup()).thenReturn(group);
  when(moduleId.getVersion()).thenReturn(version);

  ResolvedModuleVersion moduleVersion = mock(ResolvedModuleVersion.class);
  when(moduleVersion.getId()).thenReturn(moduleId);

  File artifactFile = mock(File.class);
  when(artifactFile.getAbsolutePath()).thenReturn(filePath);

  ResolvedArtifact artifact = mock(ResolvedArtifact.class);
  when(artifact.getName()).thenReturn(name);
  when(artifact.getFile()).thenReturn(artifactFile);
  when(artifact.getModuleVersion()).thenReturn(moduleVersion);

  return artifact;
}
 
Example #2
Source File: DefaultResolvedDependency.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ResolvedModuleVersion getModule() {
    return new ResolvedModuleVersion() {
        public ModuleVersionIdentifier getId() {
            return id.getId();
        }
    };
}
 
Example #3
Source File: AppModelGradleResolverTest.java    From quarkus with Apache License 2.0 5 votes vote down vote up
@Test
void testToAppDependency() {
    ResolvedArtifact artifact = mock(ResolvedArtifact.class);
    ResolvedModuleVersion version = mock(ResolvedModuleVersion.class);
    when(version.toString()).thenReturn(":commons-lang3-3.9:");
    when(artifact.getModuleVersion()).thenReturn(version);
    when(artifact.getFile()).thenReturn(Files.currentFolder());
    assertThatCode(() -> AppModelGradleResolver.toAppDependency(artifact)).doesNotThrowAnyException();
}
 
Example #4
Source File: DefaultResolvedDependency.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ResolvedModuleVersion getModule() {
    return new ResolvedModuleVersion() {
        public ModuleVersionIdentifier getId() {
            return id.getId();
        }
    };
}
 
Example #5
Source File: DefaultResolvedArtifact.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public DefaultResolvedArtifact(ResolvedModuleVersion owner, Factory<ResolvedDependency> ownerSource, IvyArtifactName artifact, Factory<File> artifactSource, long id) {
    this.ownerSource = ownerSource;
    this.owner = owner;
    this.artifact = artifact;
    this.id = id;
    this.artifactSource = artifactSource;
}
 
Example #6
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #7
Source File: DefaultCachePolicy.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #8
Source File: DefaultResolvedDependency.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ResolvedModuleVersion getModule() {
    return new ResolvedModuleVersion() {
        public ModuleVersionIdentifier getId() {
            return id.getId();
        }
    };
}
 
Example #9
Source File: DefaultResolvedDependency.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public ResolvedModuleVersion getModule() {
    return new ResolvedModuleVersion() {
        public ModuleVersionIdentifier getId() {
            return id.getId();
        }
    };
}
 
Example #10
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #11
Source File: DefaultResolvedArtifact.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public DefaultResolvedArtifact(ResolvedModuleVersion owner, Factory<ResolvedDependency> ownerSource, IvyArtifactName artifact, Factory<File> artifactSource, long id) {
    this.ownerSource = ownerSource;
    this.owner = owner;
    this.artifact = artifact;
    this.id = id;
    this.artifactSource = artifactSource;
}
 
Example #12
Source File: DefaultCachePolicy.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
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;
}
 
Example #13
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public boolean mustRefreshChangingModule(ModuleVersionIdentifier moduleVersionId, ResolvedModuleVersion resolvedModuleVersion, long ageMillis) {
    return mustRefreshModule(moduleVersionId, resolvedModuleVersion, ageMillis, true);
}
 
Example #14
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public boolean mustRefreshModule(ModuleVersionIdentifier moduleVersionId, ResolvedModuleVersion resolvedModuleVersion, ModuleRevisionId moduleRevisionId, final long ageMillis) {
    return mustRefreshModule(moduleVersionId, resolvedModuleVersion, ageMillis, false);
}
 
Example #15
Source File: DefaultResolvedArtifact.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ResolvedModuleVersion getModuleVersion() {
    return owner;
}
 
Example #16
Source File: DefaultResolvedArtifact.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public DefaultResolvedArtifact(ResolvedModuleVersion owner, IvyArtifactName artifact, Factory<File> artifactSource, long id) {
    this.owner = owner;
    this.artifact = artifact;
    this.id = id;
    this.artifactSource = artifactSource;
}
 
Example #17
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private CachedModuleResolutionControl(ModuleVersionIdentifier moduleVersionId, ResolvedModuleVersion cachedVersion, boolean changing, long ageMillis) {
    super(moduleVersionId, cachedVersion, ageMillis);
    this.changing = changing;
}
 
Example #18
Source File: DefaultCachedMetaData.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ResolvedModuleVersion getModuleVersion() {
    return isMissing() ? null : new DefaultResolvedModuleVersion(getMetaData().getId());
}
 
Example #19
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private CachedModuleResolutionControl(ModuleVersionIdentifier moduleVersionId, ResolvedModuleVersion cachedVersion, boolean changing, long ageMillis) {
    super(moduleVersionId, cachedVersion, ageMillis);
    this.changing = changing;
}
 
Example #20
Source File: DefaultCachedMetaData.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ResolvedModuleVersion getModuleVersion() {
    return isMissing() ? null : new DefaultResolvedModuleVersion(getMetaData().getId());
}
 
Example #21
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private boolean mustRefreshModule(ModuleComponentIdentifier component, ResolvedModuleVersion version, long ageMillis, boolean changingModule) {
    return mustRefreshModule(DefaultModuleVersionIdentifier.newId(component), version, ageMillis, changingModule);
}
 
Example #22
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public boolean mustRefreshChangingModule(ModuleComponentIdentifier component, ResolvedModuleVersion resolvedModuleVersion, long ageMillis) {
    return mustRefreshModule(component, resolvedModuleVersion, ageMillis, true);
}
 
Example #23
Source File: DefaultCachePolicy.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public boolean mustRefreshModule(ModuleComponentIdentifier component, ResolvedModuleVersion resolvedModuleVersion, long ageMillis) {
    return mustRefreshModule(component, resolvedModuleVersion, ageMillis, false);
}
 
Example #24
Source File: DefaultResolvedArtifact.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ResolvedModuleVersion getModuleVersion() {
    return owner;
}
 
Example #25
Source File: DefaultCachePolicy.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public boolean mustRefreshChangingModule(ModuleComponentIdentifier component, ResolvedModuleVersion resolvedModuleVersion, long ageMillis) {
    return mustRefreshModule(component, resolvedModuleVersion, ageMillis, true);
}
 
Example #26
Source File: DefaultResolvedArtifact.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ResolvedModuleVersion getModuleVersion() {
    return owner;
}
 
Example #27
Source File: DefaultCachePolicy.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public boolean mustRefreshModule(ModuleComponentIdentifier component, ResolvedModuleVersion resolvedModuleVersion, long ageMillis) {
    return mustRefreshModule(component, resolvedModuleVersion, ageMillis, false);
}
 
Example #28
Source File: DefaultCachedMetaData.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public ResolvedModuleVersion getModuleVersion() {
    return isMissing() ? null : new DefaultResolvedModuleVersion(getMetaData().getId());
}
 
Example #29
Source File: DefaultCachePolicy.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private CachedModuleResolutionControl(ModuleVersionIdentifier moduleVersionId, ResolvedModuleVersion cachedVersion, boolean changing, long ageMillis) {
    super(moduleVersionId, cachedVersion, ageMillis);
    this.changing = changing;
}
 
Example #30
Source File: DefaultCachePolicy.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private boolean mustRefreshModule(ModuleComponentIdentifier component, ResolvedModuleVersion version, long ageMillis, boolean changingModule) {
    return mustRefreshModule(DefaultModuleVersionIdentifier.newId(component), version, ageMillis, changingModule);
}