Search in sources :

Example 1 with RepositoryArtifactProvider

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());
}
Also used : File(java.io.File) RepositoryArtifactProvider(org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider) Before(org.junit.Before)

Example 2 with RepositoryArtifactProvider

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));
}
Also used : RepositoryArtifactProvider(org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider) Theory(org.junit.experimental.theories.Theory)

Example 3 with RepositoryArtifactProvider

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;
}
Also used : CompositeArtifactProvider(org.eclipse.tycho.repository.p2base.artifact.provider.CompositeArtifactProvider) IRawArtifactFileProvider(org.eclipse.tycho.repository.p2base.artifact.provider.IRawArtifactFileProvider) MirroringArtifactProvider(org.eclipse.tycho.repository.local.MirroringArtifactProvider) RepositoryArtifactProvider(org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider)

Aggregations

RepositoryArtifactProvider (org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider)3 File (java.io.File)1 MirroringArtifactProvider (org.eclipse.tycho.repository.local.MirroringArtifactProvider)1 CompositeArtifactProvider (org.eclipse.tycho.repository.p2base.artifact.provider.CompositeArtifactProvider)1 IRawArtifactFileProvider (org.eclipse.tycho.repository.p2base.artifact.provider.IRawArtifactFileProvider)1 Before (org.junit.Before)1 Theory (org.junit.experimental.theories.Theory)1