-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not fail target resolution if a referenced repository fails
Currently a (failing) referenced repository can fail the whole target resolution process. This now only warns if a referenced repository can not be loaded.
- Loading branch information
Showing
3 changed files
with
142 additions
and
31 deletions.
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/EmptyArtifactRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024 Christoph Läubrich and others. | ||
* This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License 2.0 | ||
* which accompanies this distribution, and is available at | ||
* https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Christoph Läubrich - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.tycho.p2.resolver; | ||
|
||
import java.io.OutputStream; | ||
import java.net.URI; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import org.eclipse.core.runtime.IProgressMonitor; | ||
import org.eclipse.core.runtime.IStatus; | ||
import org.eclipse.core.runtime.Status; | ||
import org.eclipse.equinox.p2.core.IProvisioningAgent; | ||
import org.eclipse.equinox.p2.core.ProvisionException; | ||
import org.eclipse.equinox.p2.metadata.IArtifactKey; | ||
import org.eclipse.equinox.p2.query.CollectionResult; | ||
import org.eclipse.equinox.p2.query.IQuery; | ||
import org.eclipse.equinox.p2.query.IQueryResult; | ||
import org.eclipse.equinox.p2.query.IQueryable; | ||
import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; | ||
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager; | ||
import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest; | ||
import org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository; | ||
import org.eclipse.tycho.p2maven.ListQueryable; | ||
|
||
public class EmptyArtifactRepository extends AbstractArtifactRepository { | ||
|
||
protected EmptyArtifactRepository(IProvisioningAgent agent, URI location) { | ||
super(agent, "Empty", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, null, location, null, null, Map.of()); | ||
} | ||
|
||
@Override | ||
public IStatus getRawArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { | ||
return Status.CANCEL_STATUS; | ||
} | ||
|
||
@Override | ||
public IQueryable<IArtifactDescriptor> descriptorQueryable() { | ||
return new ListQueryable<>(); | ||
} | ||
|
||
@Override | ||
public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) { | ||
return new CollectionResult<>(List.of()); | ||
} | ||
|
||
@Override | ||
public boolean contains(IArtifactDescriptor descriptor) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean contains(IArtifactKey key) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public IStatus getArtifact(IArtifactDescriptor descriptor, OutputStream destination, IProgressMonitor monitor) { | ||
return Status.CANCEL_STATUS; | ||
} | ||
|
||
@Override | ||
public IArtifactDescriptor[] getArtifactDescriptors(IArtifactKey key) { | ||
return new IArtifactDescriptor[0]; | ||
} | ||
|
||
@Override | ||
public IStatus getArtifacts(IArtifactRequest[] requests, IProgressMonitor monitor) { | ||
return Status.CANCEL_STATUS; | ||
} | ||
|
||
@Override | ||
public OutputStream getOutputStream(IArtifactDescriptor descriptor) throws ProvisionException { | ||
return OutputStream.nullOutputStream(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters