Add reference to packager in tools

This commit is contained in:
Cristian Maglie 2016-08-02 10:45:48 +02:00
parent 3db7ec2de0
commit 8efed7f2d2
2 changed files with 19 additions and 0 deletions

View File

@ -42,6 +42,20 @@ public abstract class ContributedTool {
public abstract List<HostDependentDownloadableContribution> getSystems();
private ContributedPackage contributedPackage;
public ContributedPackage getPackage() {
return contributedPackage;
}
public void setPackage(ContributedPackage pack) {
contributedPackage = pack;
}
public String getPackager() {
return contributedPackage.getName();
}
public DownloadableContribution getDownloadableContribution(Platform platform) {
for (HostDependentDownloadableContribution c : getSystems()) {
if (c.isCompatible(platform))

View File

@ -104,6 +104,11 @@ public class ContributionsIndexer {
.collect(Collectors.toList());
for (ContributedPackage pack : packages) {
// Fill references to package in tools
for (ContributedTool tool : pack.getTools()) {
tool.setPackage(pack);
}
for (ContributedPlatform platform : pack.getPlatforms()) {
// Set a reference to parent packages
platform.setParentPackage(pack);