Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-03-26 16:26:49 -0400
committerAndrew Niefer2010-03-26 16:26:49 -0400
commitda6a59e31131354342828aa534428d2d66a7d411 (patch)
treef43bc0fb4608cbc39eb0e0cc1f59d25394a45b28 /bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse
parent5f5a6c25f61cb04862b50d0e61ec6788b1c8f679 (diff)
downloadrt.equinox.p2-da6a59e31131354342828aa534428d2d66a7d411.tar.gz
rt.equinox.p2-da6a59e31131354342828aa534428d2d66a7d411.tar.xz
rt.equinox.p2-da6a59e31131354342828aa534428d2d66a7d411.zip
bug 272061 - context repositories for export
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryFileSet.java9
2 files changed, 19 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
index a8d947303..bd9d05760 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
@@ -34,17 +34,19 @@ public abstract class AbstractRepositoryTask extends Task {
protected List<FileSet> sourceRepos = new ArrayList<FileSet>();
protected List<DestinationRepository> destinations = new ArrayList<DestinationRepository>();
- protected void addMetadataSourceRepository(URI repoLocation) {
+ protected void addMetadataSourceRepository(URI repoLocation, boolean optional) {
RepositoryDescriptor source = new RepositoryDescriptor();
source.setLocation(repoLocation);
source.setKind(RepositoryDescriptor.KIND_METADATA);
+ source.setOptional(optional);
application.addSource(source);
}
- protected void addArtifactSourceRepository(URI repoLocation) {
+ protected void addArtifactSourceRepository(URI repoLocation, boolean optional) {
RepositoryDescriptor source = new RepositoryDescriptor();
source.setLocation(repoLocation);
source.setKind(RepositoryDescriptor.KIND_ARTIFACT);
+ source.setOptional(optional);
application.addSource(source);
}
@@ -138,9 +140,9 @@ public abstract class AbstractRepositoryTask extends Task {
if (fileset.getRepoLocation() != null) {
if (!fileset.getRepoLocation().startsWith(ANT_PREFIX)) {
if (fileset.isArtifact())
- addArtifactSourceRepository(fileset.getRepoLocationURI());
+ addArtifactSourceRepository(fileset.getRepoLocationURI(), fileset.isOptional());
if (fileset.isMetadata())
- addMetadataSourceRepository(fileset.getRepoLocationURI());
+ addMetadataSourceRepository(fileset.getRepoLocationURI(), fileset.isOptional());
}
} else if (fileset.getDir() != null) {
DirectoryScanner scanner = fileset.getDirectoryScanner(getProject());
@@ -154,12 +156,12 @@ public abstract class AbstractRepositoryTask extends Task {
uri = URIUtil.toJarURI(uri, null);
}
if (fileset.isBoth()) {
- addArtifactSourceRepository(uri);
- addMetadataSourceRepository(uri);
+ addArtifactSourceRepository(uri, fileset.isOptional());
+ addMetadataSourceRepository(uri, fileset.isOptional());
} else if (fileset.isArtifact())
- addArtifactSourceRepository(uri);
+ addArtifactSourceRepository(uri, fileset.isOptional());
else if (fileset.isMetadata())
- addMetadataSourceRepository(uri);
+ addMetadataSourceRepository(uri, fileset.isOptional());
else
throw new BuildException(NLS.bind(Messages.unknown_repository_type, uri));
}
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryFileSet.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryFileSet.java
index 79b16675c..2abccae3f 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryFileSet.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/RepositoryFileSet.java
@@ -24,6 +24,7 @@ public class RepositoryFileSet extends FileSet {
public final static int TYPE_METADATA = IRepository.TYPE_METADATA;
private int kind = RepositoryDescriptor.TYPE_BOTH;
+ private boolean optional = false;
protected String myLocation = null;
public void setKind(String repoKind) {
@@ -34,6 +35,14 @@ public class RepositoryFileSet extends FileSet {
return kind;
}
+ public void setOptional(boolean optional) {
+ this.optional = optional;
+ }
+
+ public boolean isOptional() {
+ return optional;
+ }
+
public boolean isBoth() {
return kind == RepositoryDescriptor.TYPE_BOTH;
}

Back to the top