use of org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider in project tycho by eclipse.
the class MirroringArtifactProviderTest method initSubject.
@Before
public void initSubject() throws Exception {
RepositoryArtifactProvider remoteProvider = new RepositoryArtifactProvider(Collections.singletonList(TestRepositoryContent.REPO_BUNDLE_AB), ArtifactTransferPolicies.forRemoteArtifacts(), p2Context.getAgent());
// initialize local repository content (see BUNDLE_L_KEY)
localRepositoryRoot = localRepositoryManager.getLocalRepositoryRoot();
FileUtils.copy(ResourceUtil.resourceFile("repositories/local_alt"), localRepositoryRoot, new File("."), true);
localRepository = localRepositoryManager.getLocalArtifactRepository();
subject = MirroringArtifactProvider.createInstance(localRepository, remoteProvider, mirrorPacked, logVerifier.getLogger());
}
use of org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider in project tycho by eclipse.
the class MirroringArtifactProviderPack200CornerCasesTest method testCanonicalArtifactCreatedIfPackedArtifactAlreadyMirrored.
@Theory
public void testCanonicalArtifactCreatedIfPackedArtifactAlreadyMirrored(Boolean mirrorPacked) throws Exception {
prefillLocalRepositoryWithPackedArtifact(localRepository, providerFor(TestRepositoryContent.REPO_BUNDLE_AB), BUNDLE_A_KEY);
// self-test
assertThat(localRepository.getArtifactDescriptors(BUNDLE_A_KEY).length, is(1));
// self-test
assertThat(isCanonicalFormat(localRepository.getArtifactDescriptors(BUNDLE_A_KEY)[0]), is(false));
// expect no remote download
RepositoryArtifactProvider emptyProvider = providerFor();
// also expect this for the non-pack200 mirroring implementation (so that it doesn't fail if a different build left the local Maven repository in this state)
subject = MirroringArtifactProvider.createInstance(localRepository, emptyProvider, mirrorPacked, logVerifier.getLogger());
assertThat(subject.getArtifactDescriptors(BUNDLE_A_KEY).length, is(2));
assertThat(localRepository.getArtifactDescriptors(BUNDLE_A_KEY).length, is(2));
}
use of org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider in project tycho by eclipse.
the class TargetPlatformFactoryImpl method createExternalArtifactProvider.
/**
* Provider for all target platform artifacts from outside the reactor.
*/
private IRawArtifactFileProvider createExternalArtifactProvider(Set<MavenRepositoryLocation> completeRepositories, List<TargetDefinitionContent> targetDefinitionsContent, IRawArtifactFileProvider pomDependencyArtifactRepository, boolean includePackedArtifacts) {
RepositoryArtifactProvider remoteArtifactProvider = createRemoteArtifactProvider(completeRepositories, targetDefinitionsContent);
MirroringArtifactProvider remoteArtifactCache = MirroringArtifactProvider.createInstance(localArtifactRepository, remoteArtifactProvider, includePackedArtifacts, logger);
IRawArtifactFileProvider jointArtifactsProvider = new CompositeArtifactProvider(pomDependencyArtifactRepository, remoteArtifactCache);
return jointArtifactsProvider;
}
Aggregations